diff -Nru ppl-1.1/aclocal.m4 ppl-1.2/aclocal.m4 --- ppl-1.1/aclocal.m4 2013-10-28 12:44:49.000000000 +0000 +++ ppl-1.2/aclocal.m4 2016-02-11 12:31:39.000000000 +0000 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.14 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -35,7 +35,7 @@ [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,7 +51,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -573,7 +573,8 @@ END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further @@ -1148,6 +1149,7 @@ ]) # _AM_PROG_TAR m4_include([m4/ac_check_ciao.m4]) +m4_include([m4/ac_check_cxx11.m4]) m4_include([m4/ac_check_fpu_control.m4]) m4_include([m4/ac_check_gmp.m4]) m4_include([m4/ac_check_sicstus_prolog.m4]) @@ -1168,6 +1170,7 @@ m4_include([m4/ac_prog_javac.m4]) m4_include([m4/ac_prog_javah.m4]) m4_include([m4/ac_text_md5sum.m4]) +m4_include([m4/ac_use_libtool.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff -Nru ppl-1.1/ChangeLog ppl-1.2/ChangeLog --- ppl-1.1/ChangeLog 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/ChangeLog 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,3186 @@ -2013-10-28 Roberto Bagnara +2016-02-11 Roberto Bagnara - * PPL 1.1 released. + * PPL 1.2 released. + +2016-02-10 Roberto Bagnara + + * README: Updated. + +2016-02-10 Roberto Bagnara + + * NEWS: Updated. + +2016-02-10 Roberto Bagnara + + * ChangeLog, doc/libppl.3, doc/libppl_c.3, doc/ppl-config.1: + Updated. + +2016-02-10 Roberto Bagnara + + * config.guess, config.sub: Updated. + +2016-02-10 Roberto Bagnara + + * configure.ac: Version number bumped. + +2016-02-10 Roberto Bagnara + + * : commit e1d8ae6dff428bd849b8fe3b0adc7d40e9e0891f Author: Enea + Zaffanella Date: Wed Feb 10 09:49:57 2016 + +0100 + +2016-02-10 Enea Zaffanella + + * src/BD_Shape_templates.hh, src/Box_defs.hh, src/Box_templates.hh, + src/Octagonal_Shape_templates.hh, src/Polyhedron_nonpublic.cc, + src/Polyhedron_public.cc, src/Polyhedron_templates.hh: Be more + consistent in the usage of PPL_DIRTY_TEMP macros. Got rid of a + couple of FIXME's. + +2016-02-05 Roberto Bagnara + + * configure.ac, m4/Makefile.am, m4/ac_check_gmp.m4, + m4/ac_use_libtool.m4: Avoid overriding LD_LIBRARY_PATH; use libtool + instead. + +2016-01-03 Roberto Bagnara + + * : commit 1a50eab30f191ed0fd9963d4e90a2753d715a6be Author: Roberto + Bagnara Date: Sun Jan 3 15:06:03 + 2016 +0100 + +2015-11-26 Enea Zaffanella + + * src/Temp_defs.hh, src/Temp_inlines.hh, src/Temp_templates.hh: + Avoid a memory leak due to the global list of dirty temporaries. The memory leak was not causing a real problem, in that the list of + dirty temporaries is meant to survive up to the end of the process. + However, it could cause a problem if/when the library is extended to + become multi-thread safe, since in such a scenario it is meaningful + to have a list of dirty temporaries for each thread (to be released + on thread exit). + +2015-11-26 Enea Zaffanella + + * interfaces/C/tests/formatted_output.c, + interfaces/C/tests/pip_test.c: Avoid a couple of memory leaks in the + C interface tests. + +2015-11-26 Enea Zaffanella + + * src/Polyhedron_conversion_templates.hh: Get rid of temporary print + previously added for debugging purposes. + +2015-11-24 Roberto Bagnara + + * interfaces/Prolog/SWI/pl_clpq.pl: Adapted to SWI-Prolog version + 7.x. + +2015-11-24 Roberto Bagnara + + * + interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_te + st_pl_code.m4: Warnings avoided. + +2015-11-23 Enea Zaffanella + + * src/Polyhedron_conversion_templates.hh, + tests/Polyhedron/Makefile.am, tests/Polyhedron/hypercubes.cc: + Implemented the quick adjacency check in the conversion procedure. The test allows for significant performce improvements on certain + classes of polyhedra (e.g., hypercubes) in that it saves many + saturation subset checks. Added preprocessing flags to allow for enabling/disabling the new + check (as well as the old quick non-adjacency check). Added new + testcase tests/Polyhedron/hypercubes.cc that can be used for a + performance comparison. The efficiency benefits can also be appreciated when running the + ppl_lcdd demo testsuite. + +2015-11-19 Enea Zaffanella + + * interfaces/Java/parma_polyhedra_library/Constraint.java, + interfaces/Java/tests/Parma_Polyhedra_Library_test2.java: In Java, + throw an exception when trying to build a disequality. + +2015-11-19 Enea Zaffanella + + * NEWS: Mention fixed bug. + +2015-11-19 Enea Zaffanella + + * src/Pointset_Powerset_defs.hh, src/Pointset_Powerset_inlines.hh, + src/Pointset_Powerset_templates.hh: Provide a common, correct + implementation for the methods + Pointset_Powerset::relation_with() working on Constraint and + Congruence objects. + +2015-11-19 Enea Zaffanella + + * tests/Powerset/relationwith1.cc: Corrected expected result for + test02(). The test shows a bug in current implementation of method Pointset_Powerset::relation_with(const Congruence& c) const + +2015-11-19 Enea Zaffanella + + * src/Pointset_Powerset_templates.hh: Fixed bug in + Pointset_Powerset::relation_with(const Constraint&) const. The bug was causing wrong results for relations + strictly_intersects() and saturates() on some inputs. + +2015-11-19 Enea Zaffanella + + * tests/Powerset/relationwith1.cc: Corrected expected result for + test06(). Added a new testcase as test11(). The two tests show a + bug in current implementation of method + Pointset_Powerset::relation_with(const Constraint& c) const + +2015-06-30 Roberto Bagnara + + * CREDITS: Updated. + +2015-03-15 Roberto Bagnara + + * doc/devref-language-interface.doxyconf.in, + doc/user-language-interface.doxyconf.in: Updated. + +2015-03-15 Roberto Bagnara + + * tests/Watchdog/Makefile.am: Added missing linker options. + +2015-03-15 Roberto Bagnara + + * doc/devref-language-interface.tex, doc/devref.tex, + doc/user-language-interface.tex, doc/user.tex: Added missing + definitions. + +2015-03-15 Roberto Bagnara + + * doc/devref.doxyconf-html.in, doc/devref.doxyconf-latex.in, + doc/user.doxyconf-html.in, doc/user.doxyconf-latex.in: Updated. + +2015-03-15 Roberto Bagnara + + * doc/devref-language-interface.tex, doc/devref.tex, + doc/user-language-interface.tex, doc/user.tex: Added missing \+ + command to build LaTeX manual. + +2015-03-15 Roberto Bagnara + + * src/Linear_Expression_defs.hh: Typo fixed. + +2015-03-15 Roberto Bagnara + + * config.guess, config.sub: Updated. + +2015-02-26 Roberto Bagnara + + * src/PIP_Tree.cc: Dead store avoided. + +2015-01-20 Roberto Bagnara + + * src/Init.cc, src/initializer.hh: Initialization machinery + improved. Previously there was undefined behavior for the case + where the user defined PPL_NO_AUTOMATIC_INITIALIZATION. (Thanks to + Esseger.) + +2015-01-20 Roberto Bagnara + + * configure.ac: Version number bumped. + +2015-01-01 Roberto Bagnara + + * devtools/bump_copyright_years: Improved. + +2015-01-01 Roberto Bagnara + + * devtools/bump_copyright_years: Extended copyright years. + +2015-01-01 Roberto Bagnara + + * Makefile.am, NEWS, README, README.alpha, README.arm, + README.configure, README.solaris, STANDARDS, configure.ac, + debian/libppl-pwl.copyright.in, debian/libppl.copyright.in, + demos/Makefile.am, demos/ppl_lcdd/Makefile.am, + demos/ppl_lcdd/examples/Makefile.am, demos/ppl_lcdd/ppl_lcdd.1, + demos/ppl_lcdd/ppl_lcdd.cc, demos/ppl_lcdd/ppl_lcdd_extra_man_text, + demos/ppl_lpsol/Makefile.am, demos/ppl_lpsol/dummy.cc, + demos/ppl_lpsol/examples/Makefile.am, demos/ppl_lpsol/ppl_lpsol.1, + demos/ppl_lpsol/ppl_lpsol.c, + demos/ppl_lpsol/ppl_lpsol_extra_man_text, + demos/ppl_pips/Makefile.am, demos/ppl_pips/examples/Makefile.am, + demos/ppl_pips/ppl_pips.1, demos/ppl_pips/ppl_pips.cc, + demos/ppl_pips/ppl_pips_extra_man_text, + devtools/bump_copyright_years, devtools/generate_dox_biblio, + devtools/generate_man_pages, devtools/print_nonascii_lines, + devtools/update_ChangeLog, doc/Makefile.am, doc/README.doc, + doc/definitions.dox, doc/devref-language-interface.tex, + doc/devref.tex, doc/libppl.3, doc/libppl_c.3, doc/ppl-config.1, + doc/ppl-config_extra_man_text, doc/ppl.bib, doc/ppl.sty, + doc/ppl_citations.bib, doc/user-language-interface.tex, + doc/user.tex, fedora/ppl.hh, fedora/ppl_c.h, fedora/pwl.hh, + instchk.hh, interfaces/C/C_interface.dox, interfaces/C/Makefile.am, + interfaces/C/ppl_c_header.h, + interfaces/C/ppl_c_implementation_common.cc, + interfaces/C/ppl_c_implementation_common_defs.hh, + interfaces/C/ppl_c_implementation_common_inlines.hh, + interfaces/C/ppl_c_version.h.in, + interfaces/C/ppl_interface_generator_c_cc_code.m4, + interfaces/C/ppl_interface_generator_c_cc_files.m4, + interfaces/C/ppl_interface_generator_c_h.m4, + interfaces/C/ppl_interface_generator_c_h_code.m4, + interfaces/C/ppl_interface_generator_c_hh_files.m4, + interfaces/C/ppl_interface_generator_c_procedure_generators.m4, + interfaces/C/tests/Makefile.am, + interfaces/C/tests/formatted_output.c, + interfaces/C/tests/pip_test.c, interfaces/C/tests/ppl_c_test.cc, + interfaces/C/tests/ppl_c_test.h, + interfaces/C/tests/print_to_buffer.c, + interfaces/C/tests/print_to_buffer.h, + interfaces/C/tests/watchdog1.c, interfaces/C/tests/weightwatch1.c, + interfaces/Java/Makefile.am, interfaces/Java/README.java, + interfaces/Java/jni/Makefile.am, + interfaces/Java/jni/ppl_interface_generator_java_classes_cc_code.m4 + , + interfaces/Java/jni/ppl_interface_generator_java_classes_cc_files.m + 4, interfaces/Java/jni/ppl_java_common.cc, + interfaces/Java/jni/ppl_java_common_defs.hh, + interfaces/Java/jni/ppl_java_common_inlines.hh, + interfaces/Java/jni/ppl_java_globals.cc, + interfaces/Java/parma_polyhedra_library/Artificial_Parameter.java, + interfaces/Java/parma_polyhedra_library/Artificial_Parameter_Sequen + ce.java, + interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Overfl + ow.java, + interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Repres + entation.java, + interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Width. + java, interfaces/Java/parma_polyhedra_library/By_Reference.java, + interfaces/Java/parma_polyhedra_library/Coefficient.java, + interfaces/Java/parma_polyhedra_library/Complexity_Class.java, + interfaces/Java/parma_polyhedra_library/Congruence.java, + interfaces/Java/parma_polyhedra_library/Congruence_System.java, + interfaces/Java/parma_polyhedra_library/Constraint.java, + interfaces/Java/parma_polyhedra_library/Constraint_System.java, + interfaces/Java/parma_polyhedra_library/Control_Parameter_Name.java + , + interfaces/Java/parma_polyhedra_library/Control_Parameter_Value.jav + a, interfaces/Java/parma_polyhedra_library/Degenerate_Element.java, + interfaces/Java/parma_polyhedra_library/Domain_Error_Exception.java + , + interfaces/Java/parma_polyhedra_library/Fake_Class_for_Doxygen.java + , interfaces/Java/parma_polyhedra_library/Generator.java, + interfaces/Java/parma_polyhedra_library/Generator_System.java, + interfaces/Java/parma_polyhedra_library/Generator_Type.java, + interfaces/Java/parma_polyhedra_library/Grid_Generator.java, + interfaces/Java/parma_polyhedra_library/Grid_Generator_System.java, + interfaces/Java/parma_polyhedra_library/Grid_Generator_Type.java, + interfaces/Java/parma_polyhedra_library/IO.java, + interfaces/Java/parma_polyhedra_library/Invalid_Argument_Exception. + java, + interfaces/Java/parma_polyhedra_library/Length_Error_Exception.java + , interfaces/Java/parma_polyhedra_library/Linear_Expression.java, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Coefficie + nt.java, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Differenc + e.java, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Sum.java, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Times.jav + a, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Unary_Min + us.java, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Variable. + java, + interfaces/Java/parma_polyhedra_library/Logic_Error_Exception.java, + interfaces/Java/parma_polyhedra_library/MIP_Problem.java, + interfaces/Java/parma_polyhedra_library/MIP_Problem_Status.java, + interfaces/Java/parma_polyhedra_library/Makefile.am, + interfaces/Java/parma_polyhedra_library/Optimization_Mode.java, + interfaces/Java/parma_polyhedra_library/Overflow_Error_Exception.ja + va, interfaces/Java/parma_polyhedra_library/PIP_Decision_Node.java, + interfaces/Java/parma_polyhedra_library/PIP_Problem.java, + interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Paramet + er_Name.java, + interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Paramet + er_Value.java, + interfaces/Java/parma_polyhedra_library/PIP_Problem_Status.java, + interfaces/Java/parma_polyhedra_library/PIP_Solution_Node.java, + interfaces/Java/parma_polyhedra_library/PIP_Tree_Node.java, + interfaces/Java/parma_polyhedra_library/PPL_Object.java, + interfaces/Java/parma_polyhedra_library/Pair.java, + interfaces/Java/parma_polyhedra_library/Parma_Polyhedra_Library.jav + a, interfaces/Java/parma_polyhedra_library/Partial_Function.java, + interfaces/Java/parma_polyhedra_library/Poly_Con_Relation.java, + interfaces/Java/parma_polyhedra_library/Poly_Gen_Relation.java, + interfaces/Java/parma_polyhedra_library/Relation_Symbol.java, + interfaces/Java/parma_polyhedra_library/Timeout_Exception.java, + interfaces/Java/parma_polyhedra_library/Variable.java, + interfaces/Java/parma_polyhedra_library/Variable_Stringifier.java, + interfaces/Java/parma_polyhedra_library/Variables_Set.java, + interfaces/Java/parma_polyhedra_library/ppl_interface_generator_jav + a_classes_java.m4, + interfaces/Java/parma_polyhedra_library/ppl_interface_generator_jav + a_classes_java_code.m4, + interfaces/Java/ppl_interface_generator_java_procedure_generators.m + 4, interfaces/Java/tests/C_Polyhedron_test1.java, + interfaces/Java/tests/Custom_Variable_Stringifier.java, + interfaces/Java/tests/MIP_Problem_test1.java, + interfaces/Java/tests/Makefile.am, + interfaces/Java/tests/NNC_Polyhedron_test1.java, + interfaces/Java/tests/PIP_Problem_test1.java, + interfaces/Java/tests/PPL_Test.java, + interfaces/Java/tests/Parma_Polyhedra_Library_test1.java, + interfaces/Java/tests/Parma_Polyhedra_Library_test2.java, + interfaces/Java/tests/Test_Executor.java, + interfaces/Java/tests/Variable_Output_test1.java, + interfaces/Java/tests/ppl_interface_generator_java_test_java.m4, + interfaces/Java/tests/ppl_interface_generator_java_test_java_code.m + 4, interfaces/Java/tests/ppl_java_tests_common, + interfaces/Makefile.am, interfaces/OCaml/Makefile.am, + interfaces/OCaml/OCaml_interface.dox, + interfaces/OCaml/README.ocaml, + interfaces/OCaml/ppl_interface_generator_ocaml_cc_code.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_cc_files.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_hh_code.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_hh_files.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_ml.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_ml_code.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_mli.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_mli_code.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_procedure_generators + .m4, interfaces/OCaml/ppl_ocaml_common.cc, + interfaces/OCaml/ppl_ocaml_common_defs.hh, + interfaces/OCaml/ppl_ocaml_common_inlines.hh, + interfaces/OCaml/ppl_ocaml_globals.ml, + interfaces/OCaml/ppl_ocaml_globals.mli, + interfaces/OCaml/tests/Makefile.am, + interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml.m4, + interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml_code.m + 4, interfaces/OCaml/tests/ppl_ocaml_tests_common, + interfaces/OCaml/tests/test1.ml, + interfaces/Prolog/Ciao/Makefile.am, + interfaces/Prolog/Ciao/README.ciao, + interfaces/Prolog/Ciao/ciao_cfli.hh, + interfaces/Prolog/Ciao/ciao_clpq.pl, + interfaces/Prolog/Ciao/ciao_clpq2.pl, + interfaces/Prolog/Ciao/ciao_efli.cc, + interfaces/Prolog/Ciao/ciao_efli.hh, + interfaces/Prolog/Ciao/ciao_pl_check.pl, + interfaces/Prolog/Ciao/ppl_interface_generator_ciao_pl.m4, + interfaces/Prolog/Ciao/ppl_interface_generator_ciao_prolog_generate + d_test_pl.m4, interfaces/Prolog/Ciao/ppl_prolog_sysdep.hh, + interfaces/Prolog/GNU/Makefile.am, + interfaces/Prolog/GNU/README.gprolog, + interfaces/Prolog/GNU/gnu_pl_check.pl, + interfaces/Prolog/GNU/gnu_prolog_generated_test.pl, + interfaces/Prolog/GNU/gp_clpq.pl, + interfaces/Prolog/GNU/gprolog_cfli.hh, + interfaces/Prolog/GNU/gprolog_efli.cc, + interfaces/Prolog/GNU/gprolog_efli.hh, + interfaces/Prolog/GNU/ppl_interface_generator_gprolog_pl.m4, + interfaces/Prolog/GNU/ppl_prolog_sysdep.hh, + interfaces/Prolog/Makefile.am, + interfaces/Prolog/Prolog_configured_interface.dox, + interfaces/Prolog/Prolog_interface.dox, + interfaces/Prolog/Prolog_interface_compilation.dox, + interfaces/Prolog/Prolog_interface_sysdep.dox, + interfaces/Prolog/Prolog_interface_sysindep.dox, + interfaces/Prolog/Prolog_interface_sysindep_domains.dox, + interfaces/Prolog/SICStus/Makefile.am, + interfaces/Prolog/SICStus/ppl_interface_generator_sicstus_sd_cc.m4, + interfaces/Prolog/SICStus/ppl_prolog_sysdep.hh, + interfaces/Prolog/SICStus/ppl_sicstus.pl, + interfaces/Prolog/SICStus/sicstus_cfli.cc, + interfaces/Prolog/SICStus/sicstus_cfli.h, + interfaces/Prolog/SICStus/sicstus_cfli.ic, + interfaces/Prolog/SICStus/sicstus_efli.cc, + interfaces/Prolog/SICStus/sicstus_efli.hh, + interfaces/Prolog/SICStus/sp_clpq.pl, + interfaces/Prolog/SICStus/sp_pl_check.pl, + interfaces/Prolog/SICStus/sp_prolog_generated_test.pl, + interfaces/Prolog/SWI/Makefile.am, + interfaces/Prolog/SWI/README.swiprolog, + interfaces/Prolog/SWI/pl_clpq.cc, interfaces/Prolog/SWI/pl_clpq.pl, + interfaces/Prolog/SWI/ppl_interface_generator_swiprolog_cc.m4, + interfaces/Prolog/SWI/ppl_pl.cc, + interfaces/Prolog/SWI/ppl_prolog_sysdep.hh, + interfaces/Prolog/SWI/ppl_swiprolog.hh, + interfaces/Prolog/SWI/ppl_swiprolog.pl, + interfaces/Prolog/SWI/swi_cfli.hh, + interfaces/Prolog/SWI/swi_efli.cc, + interfaces/Prolog/SWI/swi_efli.hh, + interfaces/Prolog/SWI/swi_pl_check.pl, + interfaces/Prolog/SWI/swi_prolog_generated_test.pl, + interfaces/Prolog/XSB/Makefile.am, + interfaces/Prolog/XSB/ppl_interface_generator_xsb_H.m4, + interfaces/Prolog/XSB/ppl_interface_generator_xsb_cc.m4, + interfaces/Prolog/XSB/ppl_interface_generator_xsb_hh.m4, + interfaces/Prolog/XSB/ppl_interface_generator_xsb_prolog_generated_ + test_P.m4, interfaces/Prolog/XSB/ppl_prolog_sysdep.hh, + interfaces/Prolog/XSB/xsb_cfli.hh, + interfaces/Prolog/XSB/xsb_clpq.P, + interfaces/Prolog/XSB/xsb_clpq2.P, + interfaces/Prolog/XSB/xsb_efli.cc, + interfaces/Prolog/XSB/xsb_efli.hh, + interfaces/Prolog/XSB/xsb_pl_check.P, + interfaces/Prolog/YAP/Makefile.am, + interfaces/Prolog/YAP/README.yap, + interfaces/Prolog/YAP/ppl_interface_generator_yap_cc.m4, + interfaces/Prolog/YAP/ppl_prolog_sysdep.hh, + interfaces/Prolog/YAP/ppl_yap.pl, + interfaces/Prolog/YAP/yap_cfli.hh, + interfaces/Prolog/YAP/yap_clpq.pl, + interfaces/Prolog/YAP/yap_clpq2.pl, + interfaces/Prolog/YAP/yap_efli.cc, + interfaces/Prolog/YAP/yap_efli.hh, + interfaces/Prolog/YAP/yap_pl_check.pl, + interfaces/Prolog/YAP/yap_prolog_generated_test.pl, + interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4, + interfaces/Prolog/ppl_interface_generator_prolog_cc_files.m4, + interfaces/Prolog/ppl_interface_generator_prolog_dox.m4, + interfaces/Prolog/ppl_interface_generator_prolog_dox_code.m4, + interfaces/Prolog/ppl_interface_generator_prolog_hh_code.m4, + interfaces/Prolog/ppl_interface_generator_prolog_hh_files.m4, + interfaces/Prolog/ppl_interface_generator_prolog_procedure_generato + rs.m4, interfaces/Prolog/ppl_interface_generator_prolog_systems.m4, + interfaces/Prolog/ppl_prolog_common.cc, + interfaces/Prolog/ppl_prolog_common_defs.hh, + interfaces/Prolog/ppl_prolog_common_inlines.hh, + interfaces/Prolog/tests/Makefile.am, + interfaces/Prolog/tests/clpq.pl, interfaces/Prolog/tests/clpq2.pl, + interfaces/Prolog/tests/expected_clpq2_int16, + interfaces/Prolog/tests/expected_clpq2_int16_a, + interfaces/Prolog/tests/expected_clpq2_int32, + interfaces/Prolog/tests/expected_clpq2_int32_a, + interfaces/Prolog/tests/expected_clpq2_int64, + interfaces/Prolog/tests/expected_clpq2_int64_a, + interfaces/Prolog/tests/expected_clpq2_int8, + interfaces/Prolog/tests/expected_clpq2_int8_a, + interfaces/Prolog/tests/expected_clpq2_mpz, + interfaces/Prolog/tests/expected_clpq2_mpz_a, + interfaces/Prolog/tests/expected_clpq_int16, + interfaces/Prolog/tests/expected_clpq_int16_a, + interfaces/Prolog/tests/expected_clpq_int32, + interfaces/Prolog/tests/expected_clpq_int32_a, + interfaces/Prolog/tests/expected_clpq_int64, + interfaces/Prolog/tests/expected_clpq_int64_a, + interfaces/Prolog/tests/expected_clpq_int8, + interfaces/Prolog/tests/expected_clpq_int8_a, + interfaces/Prolog/tests/expected_clpq_mpz, + interfaces/Prolog/tests/expected_clpq_mpz_a, + interfaces/Prolog/tests/pl_check.pl, + interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_te + st_pl.m4, + interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_te + st_pl_code.m4, + interfaces/Prolog/tests/ppl_prolog_generated_test_common.pl, + interfaces/Python/ppl_py.cc, interfaces/Python/ppl_py.py, + interfaces/interfaced_boxes.hh, interfaces/marked_pointers.hh, + interfaces/ppl_interface_generator_common.m4, + interfaces/ppl_interface_generator_common_dat.m4, + interfaces/ppl_interface_generator_common_procedure_generators.m4, + interfaces/ppl_interface_generator_copyright, m4/Makefile.am, + m4/ac_check_ciao.m4, m4/ac_check_cxx11.m4, + m4/ac_check_fpu_control.m4, m4/ac_check_gmp.m4, + m4/ac_check_sicstus_prolog.m4, m4/ac_check_swi_prolog.m4, + m4/ac_check_xsb_prolog.m4, m4/ac_check_yap.m4, + m4/ac_cxx_attribute_weak.m4, m4/ac_cxx_double_binary_format.m4, + m4/ac_cxx_float_binary_format.m4, m4/ac_cxx_ieee_inexact_flag.m4, + m4/ac_cxx_limit_memory.m4, m4/ac_cxx_long_double_binary_format.m4, + m4/ac_cxx_plain_char_is_signed.m4, m4/ac_cxx_proper_long_double.m4, + m4/ac_cxx_zero_length_arrays.m4, m4/ac_prog_jar.m4, + m4/ac_prog_java.m4, m4/ac_prog_javac.m4, m4/ac_prog_javah.m4, + m4/ac_text_md5sum.m4, m4/ppl.m4, m4/ppl_c.m4, src/Affine_Space.cc, + src/Affine_Space_defs.hh, src/Affine_Space_inlines.hh, + src/Affine_Space_types.hh, src/Any_Pointset_defs.hh, + src/Any_Pointset_inlines.hh, src/Any_Pointset_types.hh, + src/Ask_Tell_defs.hh, src/Ask_Tell_inlines.hh, + src/Ask_Tell_templates.hh, src/Ask_Tell_types.hh, + src/BDS_Status.cc, src/BDS_Status_idefs.hh, + src/BDS_Status_inlines.hh, src/BD_Shape.cc, src/BD_Shape_defs.hh, + src/BD_Shape_inlines.hh, src/BD_Shape_templates.hh, + src/BD_Shape_types.hh, src/BHRZ03_Certificate.cc, + src/BHRZ03_Certificate_defs.hh, src/BHRZ03_Certificate_inlines.hh, + src/BHRZ03_Certificate_types.hh, src/Bit_Matrix.cc, + src/Bit_Matrix_defs.hh, src/Bit_Matrix_inlines.hh, + src/Bit_Matrix_types.hh, src/Bit_Row.cc, src/Bit_Row_defs.hh, + src/Bit_Row_inlines.hh, src/Bit_Row_types.hh, src/Boundary_defs.hh, + src/Box.cc, src/Box_Status.cc, src/Box_Status_idefs.hh, + src/Box_Status_inlines.hh, src/Box_defs.hh, src/Box_inlines.hh, + src/Box_templates.hh, src/Box_types.hh, src/CO_Tree.cc, + src/CO_Tree_defs.hh, src/CO_Tree_inlines.hh, + src/CO_Tree_templates.hh, src/CO_Tree_types.hh, src/C_Integer.hh, + src/C_Polyhedron.cc, src/C_Polyhedron_defs.hh, + src/C_Polyhedron_inlines.hh, src/C_Polyhedron_types.hh, + src/Cast_Floating_Point_Expression_defs.hh, + src/Cast_Floating_Point_Expression_inlines.hh, + src/Cast_Floating_Point_Expression_templates.hh, + src/Cast_Floating_Point_Expression_types.hh, src/Checked_Number.cc, + src/Checked_Number_defs.hh, src/Checked_Number_inlines.hh, + src/Checked_Number_templates.hh, src/Checked_Number_types.hh, + src/Coefficient.cc, src/Coefficient_defs.hh, + src/Coefficient_inlines.hh, src/Coefficient_traits_template.hh, + src/Coefficient_types.hh, src/Concrete_Expression.cc, + src/Concrete_Expression_defs.hh, + src/Concrete_Expression_inlines.hh, + src/Concrete_Expression_types.hh, src/Congruence.cc, + src/Congruence_System.cc, src/Congruence_System_defs.hh, + src/Congruence_System_inlines.hh, src/Congruence_System_types.hh, + src/Congruence_defs.hh, src/Congruence_inlines.hh, + src/Congruence_types.hh, + src/Constant_Floating_Point_Expression_defs.hh, + src/Constant_Floating_Point_Expression_inlines.hh, + src/Constant_Floating_Point_Expression_types.hh, src/Constraint.cc, + src/Constraint_System.cc, src/Constraint_System_defs.hh, + src/Constraint_System_inlines.hh, src/Constraint_System_types.hh, + src/Constraint_defs.hh, src/Constraint_inlines.hh, + src/Constraint_types.hh, src/DB_Matrix_defs.hh, + src/DB_Matrix_inlines.hh, src/DB_Matrix_templates.hh, + src/DB_Matrix_types.hh, src/DB_Row_defs.hh, src/DB_Row_inlines.hh, + src/DB_Row_templates.hh, src/DB_Row_types.hh, src/Dense_Row.cc, + src/Dense_Row_defs.hh, src/Dense_Row_inlines.hh, + src/Dense_Row_templates.hh, src/Dense_Row_types.hh, + src/Determinate_defs.hh, src/Determinate_inlines.hh, + src/Determinate_types.hh, + src/Difference_Floating_Point_Expression_defs.hh, + src/Difference_Floating_Point_Expression_inlines.hh, + src/Difference_Floating_Point_Expression_templates.hh, + src/Difference_Floating_Point_Expression_types.hh, + src/Division_Floating_Point_Expression_defs.hh, + src/Division_Floating_Point_Expression_inlines.hh, + src/Division_Floating_Point_Expression_templates.hh, + src/Division_Floating_Point_Expression_types.hh, + src/Doubly_Linked_Object_defs.hh, + src/Doubly_Linked_Object_inlines.hh, + src/Doubly_Linked_Object_types.hh, src/EList_Iterator_defs.hh, + src/EList_Iterator_inlines.hh, src/EList_Iterator_types.hh, + src/EList_defs.hh, src/EList_inlines.hh, src/EList_types.hh, + src/Expression_Adapter_defs.hh, src/Expression_Adapter_inlines.hh, + src/Expression_Adapter_types.hh, + src/Expression_Hide_Inhomo_defs.hh, + src/Expression_Hide_Inhomo_inlines.hh, + src/Expression_Hide_Inhomo_types.hh, + src/Expression_Hide_Last_defs.hh, + src/Expression_Hide_Last_inlines.hh, + src/Expression_Hide_Last_types.hh, src/Float.cc, src/Float_defs.hh, + src/Float_inlines.hh, src/Float_templates.hh, + src/Floating_Point_Expression_defs.hh, + src/Floating_Point_Expression_inlines.hh, + src/Floating_Point_Expression_templates.hh, + src/Floating_Point_Expression_types.hh, src/GMP_Integer_defs.hh, + src/GMP_Integer_inlines.hh, src/GMP_Integer_types.hh, + src/Generator.cc, src/Generator_System.cc, + src/Generator_System_defs.hh, src/Generator_System_inlines.hh, + src/Generator_System_types.hh, src/Generator_defs.hh, + src/Generator_inlines.hh, src/Generator_types.hh, + src/Grid_Certificate.cc, src/Grid_Certificate_defs.hh, + src/Grid_Certificate_inlines.hh, src/Grid_Certificate_types.hh, + src/Grid_Generator.cc, src/Grid_Generator_System.cc, + src/Grid_Generator_System_defs.hh, + src/Grid_Generator_System_inlines.hh, + src/Grid_Generator_System_types.hh, src/Grid_Generator_defs.hh, + src/Grid_Generator_inlines.hh, src/Grid_Generator_types.hh, + src/Grid_Status.cc, src/Grid_Status_idefs.hh, + src/Grid_Status_inlines.hh, src/Grid_chdims.cc, + src/Grid_conversion.cc, src/Grid_defs.hh, src/Grid_inlines.hh, + src/Grid_nonpublic.cc, src/Grid_public.cc, src/Grid_simplify.cc, + src/Grid_templates.hh, src/Grid_types.hh, src/Grid_widenings.cc, + src/H79_Certificate.cc, src/H79_Certificate_defs.hh, + src/H79_Certificate_inlines.hh, src/H79_Certificate_types.hh, + src/Handler.cc, src/Handler_defs.hh, src/Handler_inlines.hh, + src/Handler_types.hh, src/Has_Assign_Or_Swap.hh, src/Init.cc, + src/Init_defs.hh, src/Init_inlines.hh, src/Init_types.hh, + src/Integer_Interval.hh, src/Interval_Info_defs.hh, + src/Interval_Info_inlines.hh, src/Interval_Info_types.hh, + src/Interval_defs.hh, src/Interval_inlines.hh, + src/Interval_templates.hh, src/Interval_types.hh, + src/Linear_Expression.cc, src/Linear_Expression_Impl.cc, + src/Linear_Expression_Impl_defs.hh, + src/Linear_Expression_Impl_inlines.hh, + src/Linear_Expression_Impl_templates.hh, + src/Linear_Expression_Impl_types.hh, + src/Linear_Expression_Interface.cc, + src/Linear_Expression_Interface_defs.hh, + src/Linear_Expression_Interface_types.hh, + src/Linear_Expression_defs.hh, src/Linear_Expression_inlines.hh, + src/Linear_Expression_types.hh, src/Linear_Form.cc, + src/Linear_Form_defs.hh, src/Linear_Form_inlines.hh, + src/Linear_Form_templates.hh, src/Linear_Form_types.hh, + src/Linear_System_defs.hh, src/Linear_System_inlines.hh, + src/Linear_System_templates.hh, src/Linear_System_types.hh, + src/MIP_Problem.cc, src/MIP_Problem_defs.hh, + src/MIP_Problem_inlines.hh, src/MIP_Problem_templates.hh, + src/MIP_Problem_types.hh, src/Makefile.am, src/Matrix_defs.hh, + src/Matrix_inlines.hh, src/Matrix_templates.hh, + src/Matrix_types.hh, + src/Multiplication_Floating_Point_Expression_defs.hh, + src/Multiplication_Floating_Point_Expression_inlines.hh, + src/Multiplication_Floating_Point_Expression_templates.hh, + src/Multiplication_Floating_Point_Expression_types.hh, + src/NNC_Polyhedron.cc, src/NNC_Polyhedron_defs.hh, + src/NNC_Polyhedron_inlines.hh, src/NNC_Polyhedron_types.hh, + src/Numeric_Format_defs.hh, src/OR_Matrix_defs.hh, + src/OR_Matrix_inlines.hh, src/OR_Matrix_templates.hh, + src/OR_Matrix_types.hh, src/Octagonal_Shape.cc, + src/Octagonal_Shape_defs.hh, src/Octagonal_Shape_inlines.hh, + src/Octagonal_Shape_templates.hh, src/Octagonal_Shape_types.hh, + src/Og_Status.cc, src/Og_Status_idefs.hh, src/Og_Status_inlines.hh, + src/Opposite_Floating_Point_Expression_defs.hh, + src/Opposite_Floating_Point_Expression_inlines.hh, + src/Opposite_Floating_Point_Expression_types.hh, + src/PIP_Problem.cc, src/PIP_Problem_defs.hh, + src/PIP_Problem_inlines.hh, src/PIP_Problem_templates.hh, + src/PIP_Problem_types.hh, src/PIP_Tree.cc, src/PIP_Tree_defs.hh, + src/PIP_Tree_inlines.hh, src/PIP_Tree_types.hh, + src/Partial_Function.cc, src/Partial_Function_defs.hh, + src/Partial_Function_inlines.hh, src/Partial_Function_types.hh, + src/Partially_Reduced_Product_defs.hh, + src/Partially_Reduced_Product_inlines.hh, + src/Partially_Reduced_Product_templates.hh, + src/Partially_Reduced_Product_types.hh, + src/Pending_Element_defs.hh, src/Pending_Element_inlines.hh, + src/Pending_Element_types.hh, src/Pending_List_defs.hh, + src/Pending_List_inlines.hh, src/Pending_List_templates.hh, + src/Pending_List_types.hh, src/Ph_Status.cc, + src/Ph_Status_idefs.hh, src/Ph_Status_inlines.hh, + src/Pointset_Ask_Tell.cc, src/Pointset_Ask_Tell_defs.hh, + src/Pointset_Ask_Tell_inlines.hh, + src/Pointset_Ask_Tell_templates.hh, src/Pointset_Ask_Tell_types.hh, + src/Pointset_Powerset.cc, src/Pointset_Powerset_defs.hh, + src/Pointset_Powerset_inlines.hh, + src/Pointset_Powerset_templates.hh, src/Pointset_Powerset_types.hh, + src/Poly_Con_Relation.cc, src/Poly_Con_Relation_defs.hh, + src/Poly_Con_Relation_inlines.hh, src/Poly_Con_Relation_types.hh, + src/Poly_Gen_Relation.cc, src/Poly_Gen_Relation_defs.hh, + src/Poly_Gen_Relation_inlines.hh, src/Poly_Gen_Relation_types.hh, + src/Polyhedron_chdims.cc, src/Polyhedron_chdims_templates.hh, + src/Polyhedron_conversion_templates.hh, src/Polyhedron_defs.hh, + src/Polyhedron_inlines.hh, src/Polyhedron_minimize_templates.hh, + src/Polyhedron_nonpublic.cc, src/Polyhedron_public.cc, + src/Polyhedron_simplify_templates.hh, src/Polyhedron_templates.hh, + src/Polyhedron_types.hh, src/Polyhedron_widenings.cc, + src/Powerset_defs.hh, src/Powerset_inlines.hh, + src/Powerset_templates.hh, src/Powerset_types.hh, + src/Ptr_Iterator_defs.hh, src/Ptr_Iterator_inlines.hh, + src/Ptr_Iterator_types.hh, src/Rational_Box.hh, + src/Rational_Interval.hh, src/Result_defs.hh, + src/Result_inlines.hh, src/Rounding_Dir_defs.hh, + src/Rounding_Dir_inlines.hh, src/Scalar_Products.cc, + src/Scalar_Products_defs.hh, src/Scalar_Products_inlines.hh, + src/Scalar_Products_types.hh, src/Slow_Copy.hh, src/Sparse_Row.cc, + src/Sparse_Row_defs.hh, src/Sparse_Row_inlines.hh, + src/Sparse_Row_templates.hh, src/Sparse_Row_types.hh, + src/Sum_Floating_Point_Expression_defs.hh, + src/Sum_Floating_Point_Expression_inlines.hh, + src/Sum_Floating_Point_Expression_templates.hh, + src/Sum_Floating_Point_Expression_types.hh, + src/Swapping_Vector_defs.hh, src/Swapping_Vector_inlines.hh, + src/Swapping_Vector_types.hh, src/Temp_defs.hh, + src/Temp_inlines.hh, src/Temp_templates.hh, + src/Threshold_Watcher.cc, src/Threshold_Watcher_defs.hh, + src/Threshold_Watcher_inlines.hh, + src/Threshold_Watcher_templates.hh, src/Threshold_Watcher_types.hh, + src/Time.cc, src/Time_defs.hh, src/Time_inlines.hh, + src/Time_types.hh, src/Topology_types.hh, src/Variable.cc, + src/Variable_Floating_Point_Expression_defs.hh, + src/Variable_Floating_Point_Expression_inlines.hh, + src/Variable_Floating_Point_Expression_types.hh, + src/Variable_defs.hh, src/Variable_inlines.hh, + src/Variable_types.hh, src/Variables_Set.cc, + src/Variables_Set_defs.hh, src/Variables_Set_inlines.hh, + src/Variables_Set_types.hh, src/WRD_coefficient_types_defs.hh, + src/WRD_coefficient_types_inlines.hh, src/Watchdog.cc, + src/Watchdog_defs.hh, src/Watchdog_inlines.hh, + src/Watchdog_types.hh, src/Weight_Profiler.cc, + src/Weight_Profiler_defs.hh, src/Widening_Function_defs.hh, + src/Widening_Function_inlines.hh, src/Widening_Function_types.hh, + src/algorithms.hh, src/assertions.cc, src/assertions.hh, + src/assign_or_swap.hh, src/c_streambuf.cc, src/c_streambuf_defs.hh, + src/c_streambuf_inlines.hh, src/c_streambuf_types.hh, + src/checked.cc, src/checked_defs.hh, src/checked_ext_defs.hh, + src/checked_ext_inlines.hh, src/checked_float_inlines.hh, + src/checked_inlines.hh, src/checked_int_inlines.hh, + src/checked_mpq_inlines.hh, src/checked_mpz_inlines.hh, + src/checked_numeric_limits.hh, src/compiler.hh, + src/distances_defs.hh, src/distances_inlines.hh, + src/distances_types.hh, src/fpu-c99_inlines.hh, src/fpu-ia32.cc, + src/fpu-ia32_inlines.hh, src/fpu-none_inlines.hh, + src/fpu-sparc_inlines.hh, src/fpu_defs.hh, src/fpu_types.hh, + src/globals.cc, src/globals_defs.hh, src/globals_inlines.hh, + src/globals_types.hh, src/initializer.hh, src/intervals_defs.hh, + src/iterator_to_const_defs.hh, src/iterator_to_const_inlines.hh, + src/iterator_to_const_types.hh, src/linearize.hh, + src/math_utilities_defs.hh, src/math_utilities_inlines.hh, + src/max_space_dimension.hh, src/meta_programming.hh, + src/mp_std_bits.cc, src/mp_std_bits_defs.hh, + src/mp_std_bits_inlines.hh, src/namespaces.hh, + src/ppl-config.cc.in, src/ppl_header.hh, + src/set_GMP_memory_alloc_funcs.cc, src/stdiobuf.cc, + src/stdiobuf_defs.hh, src/stdiobuf_inlines.hh, + src/stdiobuf_types.hh, src/swapping_sort_templates.hh, + src/termination.cc, src/termination_defs.hh, + src/termination_templates.hh, src/termination_types.hh, + src/version.cc, src/version.hh.in, src/wrap_assign.hh, + src/wrap_string.cc, src/wrap_string.hh, tests/Ask_Tell/Makefile.am, + tests/Ask_Tell/append1.cc, tests/BD_Shape/Makefile.am, + tests/BD_Shape/addconstraints1.cc, tests/BD_Shape/addspacedims1.cc, + tests/BD_Shape/affinedimension1.cc, tests/BD_Shape/affineimage1.cc, + tests/BD_Shape/affineimage2.cc, tests/BD_Shape/affinepreimage1.cc, + tests/BD_Shape/ascii_dump_load1.cc, + tests/BD_Shape/bgp99extrapolation1.cc, + tests/BD_Shape/bhmz05widening1.cc, + tests/BD_Shape/bhz03widening1.cc, tests/BD_Shape/bounded1.cc, + tests/BD_Shape/boundedaffineimage1.cc, + tests/BD_Shape/boundedaffinepreimage1.cc, + tests/BD_Shape/bounds1.cc, tests/BD_Shape/cc76extrapolation1.cc, + tests/BD_Shape/cc76narrowing1.cc, tests/BD_Shape/closure1.cc, + tests/BD_Shape/concatenate1.cc, tests/BD_Shape/congruences1.cc, + tests/BD_Shape/constrains1.cc, tests/BD_Shape/constraints1.cc, + tests/BD_Shape/contains1.cc, + tests/BD_Shape/containsintegerpoint1.cc, + tests/BD_Shape/difference1.cc, tests/BD_Shape/discrete1.cc, + tests/BD_Shape/disjoint1.cc, + tests/BD_Shape/dropsomenonintegerpoints1.cc, + tests/BD_Shape/empty1.cc, tests/BD_Shape/equality1.cc, + tests/BD_Shape/expandspacedim1.cc, + tests/BD_Shape/foldspacedims1.cc, tests/BD_Shape/frequency1.cc, + tests/BD_Shape/frombdshape1.cc, tests/BD_Shape/frombox1.cc, + tests/BD_Shape/fromgensys1.cc, tests/BD_Shape/fromgrid1.cc, + tests/BD_Shape/fromoctagonalshape1.cc, + tests/BD_Shape/frompolyhedron1.cc, tests/BD_Shape/fromspacedim1.cc, + tests/BD_Shape/generalizedaffineimage1.cc, + tests/BD_Shape/generalizedaffineimage2.cc, + tests/BD_Shape/generalizedaffinepreimage1.cc, + tests/BD_Shape/generalizedaffinepreimage2.cc, + tests/BD_Shape/generalizedaffinepreimage3.cc, + tests/BD_Shape/geomcovers1.cc, tests/BD_Shape/h79widening1.cc, + tests/BD_Shape/integerupperboundifexact1.cc, + tests/BD_Shape/intersection1.cc, + tests/BD_Shape/limitedbhmz05extrapolation1.cc, + tests/BD_Shape/limitedcc76extrapolation1.cc, + tests/BD_Shape/limitedh79extrapolation1.cc, + tests/BD_Shape/mapspacedims1.cc, tests/BD_Shape/max_min1.cc, + tests/BD_Shape/max_min2.cc, tests/BD_Shape/maxspacedim1.cc, + tests/BD_Shape/membytes1.cc, tests/BD_Shape/minconstraints1.cc, + tests/BD_Shape/relations1.cc, tests/BD_Shape/relations2.cc, + tests/BD_Shape/relations3.cc, tests/BD_Shape/relations4.cc, + tests/BD_Shape/removespacedims1.cc, tests/BD_Shape/run_tests, + tests/BD_Shape/simplifyusingcontext1.cc, + tests/BD_Shape/timeelapse1.cc, tests/BD_Shape/unconstrain1.cc, + tests/BD_Shape/universe1.cc, tests/BD_Shape/upperbound1.cc, + tests/BD_Shape/upperboundifexact1.cc, tests/BD_Shape/wrap1.cc, + tests/BD_Shape/writebdshape1.cc, tests/Box/Makefile.am, + tests/Box/addconstraints1.cc, tests/Box/addspacedims1.cc, + tests/Box/affinedimension1.cc, tests/Box/affineimage1.cc, + tests/Box/affinepreimage1.cc, tests/Box/ascii_dump_load1.cc, + tests/Box/bgp99extrapolation1.cc, tests/Box/bhz03widening1.cc, + tests/Box/bounded1.cc, tests/Box/boundedaffineimage1.cc, + tests/Box/boundedaffinepreimage1.cc, tests/Box/cc76narrowing1.cc, + tests/Box/cc76widening.cc, tests/Box/concatenate1.cc, + tests/Box/congruences1.cc, tests/Box/constrains1.cc, + tests/Box/constraints1.cc, tests/Box/contains1.cc, + tests/Box/containsintegerpoint1.cc, tests/Box/difference1.cc, + tests/Box/discrete1.cc, tests/Box/disjoint1.cc, + tests/Box/empty1.cc, tests/Box/equality1.cc, + tests/Box/expandspacedim1.cc, tests/Box/foldspacedims1.cc, + tests/Box/frequency1.cc, tests/Box/frombdshape1.cc, + tests/Box/frombox1.cc, tests/Box/fromgensys1.cc, + tests/Box/fromgrid1.cc, tests/Box/frompartiallyreducedproduct1.cc, + tests/Box/frompolyhedron1.cc, tests/Box/frompolyhedron2.cc, + tests/Box/fromspacedim1.cc, tests/Box/generalizedaffineimage1.cc, + tests/Box/generalizedaffineimage2.cc, + tests/Box/generalizedaffinepreimage1.cc, tests/Box/geomcovers1.cc, + tests/Box/intersection1.cc, tests/Box/interval1.cc, + tests/Box/limitedcc76extrapolation1.cc, tests/Box/mapspacedims1.cc, + tests/Box/max_min1.cc, tests/Box/maxspacedim1.cc, + tests/Box/membytes1.cc, tests/Box/minconstraints1.cc, + tests/Box/propagateconstraints1.cc, + tests/Box/propagateconstraints2.cc, + tests/Box/refinewithcongruence1.cc, + tests/Box/refinewithcongruences1.cc, + tests/Box/refinewithconstraint1.cc, + tests/Box/refinewithconstraint2.cc, + tests/Box/refinewithconstraints1.cc, + tests/Box/refinewithconstraints2.cc, tests/Box/relations1.cc, + tests/Box/relations2.cc, tests/Box/relations3.cc, + tests/Box/relations4.cc, tests/Box/removespacedims1.cc, + tests/Box/run_tests, tests/Box/simplifyusingcontext1.cc, + tests/Box/timeelapse1.cc, tests/Box/topclosed1.cc, + tests/Box/unconstrain1.cc, tests/Box/universe1.cc, + tests/Box/upperbound1.cc, tests/Box/upperboundifexact1.cc, + tests/Box/wrap1.cc, tests/Box/writebox1.cc, + tests/CO_Tree/Makefile.am, tests/CO_Tree/cotree1.cc, + tests/Concrete_Expression/C_Expr.cc, + tests/Concrete_Expression/C_Expr_defs.hh, + tests/Concrete_Expression/C_Expr_inlines.hh, + tests/Concrete_Expression/C_Expr_types.hh, + tests/Concrete_Expression/Makefile.am, + tests/Concrete_Expression/bdshape1.cc, + tests/Concrete_Expression/bdshape2.cc, + tests/Concrete_Expression/digitalfilters1.cc, + tests/Concrete_Expression/linearform1.cc, + tests/Concrete_Expression/linearize.cc, + tests/Concrete_Expression/octagonalshape1.cc, + tests/Concrete_Expression/octagonalshape2.cc, + tests/Concrete_Expression/polyhedron1.cc, + tests/Concrete_Expression/polyhedron2.cc, + tests/Concrete_Expression/run_tests, tests/Grid/Makefile.am, + tests/Grid/addcongruence1.cc, tests/Grid/addcongruences1.cc, + tests/Grid/addconstraint1.cc, tests/Grid/addconstraints1.cc, + tests/Grid/addgenerator1.cc, tests/Grid/addgenerators1.cc, + tests/Grid/addspacedims1.cc, tests/Grid/affinedim1.cc, + tests/Grid/affineimage1.cc, tests/Grid/affineimage2.cc, + tests/Grid/affinepreimage1.cc, tests/Grid/affinepreimage2.cc, + tests/Grid/approximatepartition1.cc, tests/Grid/asciidumpload1.cc, + tests/Grid/asciidumpload2.cc, tests/Grid/asciidumpload3.cc, + tests/Grid/asciidumpload4.cc, tests/Grid/asciidumpload5.cc, + tests/Grid/asciidumpload6.cc, tests/Grid/bhz03widening1.cc, + tests/Grid/bounded1.cc, tests/Grid/boundedaffineimage1.cc, + tests/Grid/boundedaffinepreimage1.cc, tests/Grid/boundingbox1.cc, + tests/Grid/bounds1.cc, tests/Grid/certificate1.cc, + tests/Grid/concatenate1.cc, tests/Grid/congruence1.cc, + tests/Grid/congruences1.cc, tests/Grid/congruences2.cc, + tests/Grid/constraints1.cc, tests/Grid/contains1.cc, + tests/Grid/containsintegerpoint1.cc, tests/Grid/discrete1.cc, + tests/Grid/disjoint1.cc, tests/Grid/dropnonintegerpoints1.cc, + tests/Grid/equals1.cc, tests/Grid/expandspacedim1.cc, + tests/Grid/foldspacedims1.cc, tests/Grid/frequency1.cc, + tests/Grid/frombdshape1.cc, tests/Grid/frombox1.cc, + tests/Grid/fromgrid1.cc, tests/Grid/fromoctagonalshape1.cc, + tests/Grid/frompolyhedron1.cc, + tests/Grid/generalizedaffineimage1.cc, + tests/Grid/generalizedaffineimage2.cc, + tests/Grid/generalizedaffineimage3.cc, + tests/Grid/generalizedaffinepreimage1.cc, + tests/Grid/generalizedaffinepreimage2.cc, + tests/Grid/generalizedaffinepreimage3.cc, tests/Grid/generator1.cc, + tests/Grid/generators1.cc, tests/Grid/generators2.cc, + tests/Grid/grid1.cc, tests/Grid/grid2.cc, tests/Grid/grid3.cc, + tests/Grid/griddifference1.cc, tests/Grid/intersection1.cc, + tests/Grid/isempty1.cc, tests/Grid/isuniverse1.cc, + tests/Grid/limitedextrapolation1.cc, + tests/Grid/limitedextrapolation2.cc, + tests/Grid/limitedextrapolation3.cc, tests/Grid/mapspacedims1.cc, + tests/Grid/maxmin1.cc, tests/Grid/membytes1.cc, + tests/Grid/mincongruences1.cc, tests/Grid/mingenerators1.cc, + tests/Grid/outputoperator1.cc, tests/Grid/outputoperator2.cc, + tests/Grid/outputoperator3.cc, tests/Grid/partition1.cc, + tests/Grid/powersetdifference1.cc, + tests/Grid/powersetgeometricallycovers1.cc, + tests/Grid/powersetgeometricallyequals1.cc, + tests/Grid/refinewithcongruences1.cc, + tests/Grid/refinewithconstraints1.cc, tests/Grid/relations1.cc, + tests/Grid/relations2.cc, tests/Grid/relations3.cc, + tests/Grid/removespacedims1.cc, tests/Grid/removespacedims2.cc, + tests/Grid/simplifyusingcontext1.cc, tests/Grid/timeelapse1.cc, + tests/Grid/topclosed1.cc, tests/Grid/topclosure1.cc, + tests/Grid/unconstrain1.cc, tests/Grid/upperbound1.cc, + tests/Grid/upperbound2.cc, tests/Grid/widening1.cc, + tests/Grid/widening2.cc, tests/Grid/widening3.cc, + tests/Grid/wrap1.cc, tests/Grid/writecongruencesystem.cc, + tests/MIP_Problem/Makefile.am, + tests/MIP_Problem/ascii_dump_load1.cc, + tests/MIP_Problem/exceptions1.cc, tests/MIP_Problem/mipproblem1.cc, + tests/MIP_Problem/mipproblem2.cc, tests/MIP_Problem/mipproblem3.cc, + tests/MIP_Problem/mipproblem4.cc, tests/Makefile.am, + tests/Octagonal_Shape/Makefile.am, + tests/Octagonal_Shape/addspacedims1.cc, + tests/Octagonal_Shape/affinedimension1.cc, + tests/Octagonal_Shape/affineimage1.cc, + tests/Octagonal_Shape/affineimage2.cc, + tests/Octagonal_Shape/affinepreimage1.cc, + tests/Octagonal_Shape/affinepreimage2.cc, + tests/Octagonal_Shape/ascii_dump_load1.cc, + tests/Octagonal_Shape/bhmz05widening1.cc, + tests/Octagonal_Shape/bhz03widening1.cc, + tests/Octagonal_Shape/bounded1.cc, + tests/Octagonal_Shape/boundedaffineimage1.cc, + tests/Octagonal_Shape/boundedaffinepreimage1.cc, + tests/Octagonal_Shape/bounds1.cc, + tests/Octagonal_Shape/cc76extrapolation1.cc, + tests/Octagonal_Shape/cc76narrowing1.cc, + tests/Octagonal_Shape/chinainit.cc, + tests/Octagonal_Shape/concatenate1.cc, + tests/Octagonal_Shape/congruences1.cc, + tests/Octagonal_Shape/constrains1.cc, + tests/Octagonal_Shape/constraints1.cc, + tests/Octagonal_Shape/contains1.cc, + tests/Octagonal_Shape/containsintegerpoint1.cc, + tests/Octagonal_Shape/difference1.cc, + tests/Octagonal_Shape/discrete1.cc, + tests/Octagonal_Shape/disjoint1.cc, + tests/Octagonal_Shape/dropsomenonintegerpoints1.cc, + tests/Octagonal_Shape/empty1.cc, + tests/Octagonal_Shape/expandspacedim1.cc, + tests/Octagonal_Shape/foldspacedims1.cc, + tests/Octagonal_Shape/frequency1.cc, + tests/Octagonal_Shape/frombdshape1.cc, + tests/Octagonal_Shape/frombox1.cc, + tests/Octagonal_Shape/fromgensys1.cc, + tests/Octagonal_Shape/fromgrid1.cc, + tests/Octagonal_Shape/fromoctagonalshape1.cc, + tests/Octagonal_Shape/frompolyhedron1.cc, + tests/Octagonal_Shape/fromspacedim1.cc, + tests/Octagonal_Shape/generalizedaffineimage1.cc, + tests/Octagonal_Shape/generalizedaffineimage2.cc, + tests/Octagonal_Shape/generalizedaffineimage3.cc, + tests/Octagonal_Shape/generalizedaffineimage4.cc, + tests/Octagonal_Shape/generalizedaffineimage5.cc, + tests/Octagonal_Shape/generalizedaffinepreimage1.cc, + tests/Octagonal_Shape/generalizedaffinepreimage2.cc, + tests/Octagonal_Shape/generalizedaffinepreimage3.cc, + tests/Octagonal_Shape/generalizedaffinepreimage4.cc, + tests/Octagonal_Shape/integerupperboundifexact1.cc, + tests/Octagonal_Shape/intersection1.cc, + tests/Octagonal_Shape/limitedbhmz05extrapolation1.cc, + tests/Octagonal_Shape/limitedcc76extrapolation1.cc, + tests/Octagonal_Shape/mapspacedims1.cc, + tests/Octagonal_Shape/max_min1.cc, + tests/Octagonal_Shape/max_min2.cc, + tests/Octagonal_Shape/maxspacedim1.cc, + tests/Octagonal_Shape/membytes1.cc, + tests/Octagonal_Shape/minconstraints1.cc, + tests/Octagonal_Shape/relatwithcons1.cc, + tests/Octagonal_Shape/relatwithcons2.cc, + tests/Octagonal_Shape/relatwithcons3.cc, + tests/Octagonal_Shape/relatwithgen1.cc, + tests/Octagonal_Shape/removespacedims1.cc, + tests/Octagonal_Shape/run_tests, + tests/Octagonal_Shape/simplifyusingcontext1.cc, + tests/Octagonal_Shape/timeelapse1.cc, + tests/Octagonal_Shape/unconstrain1.cc, + tests/Octagonal_Shape/universe1.cc, + tests/Octagonal_Shape/upperbound1.cc, + tests/Octagonal_Shape/upperboundifexact1.cc, + tests/Octagonal_Shape/wrap1.cc, + tests/Octagonal_Shape/writeoctagon1.cc, + tests/PIP_Problem/Makefile.am, + tests/PIP_Problem/ascii_dump_load1.cc, + tests/PIP_Problem/exceptions1.cc, tests/PIP_Problem/pipproblem1.cc, + tests/PIP_Problem/pipproblem2.cc, tests/PIP_Problem/pipproblem3.cc, + tests/PIP_Problem/weightwatch1.cc, + tests/Partially_Reduced_Product/Makefile.am, + tests/Partially_Reduced_Product/addcongruences1.cc, + tests/Partially_Reduced_Product/addconstraints1.cc, + tests/Partially_Reduced_Product/affineimage1.cc, + tests/Partially_Reduced_Product/asciidumpload1.cc, + tests/Partially_Reduced_Product/bounded1.cc, + tests/Partially_Reduced_Product/boundedaffineimage1.cc, + tests/Partially_Reduced_Product/bounds1.cc, + tests/Partially_Reduced_Product/concatenate1.cc, + tests/Partially_Reduced_Product/congruences1.cc, + tests/Partially_Reduced_Product/congruencesproduct1.cc, + tests/Partially_Reduced_Product/constraints1.cc, + tests/Partially_Reduced_Product/constraintsproduct1.cc, + tests/Partially_Reduced_Product/contains1.cc, + tests/Partially_Reduced_Product/difference1.cc, + tests/Partially_Reduced_Product/dimension1.cc, + tests/Partially_Reduced_Product/directproduct1.cc, + tests/Partially_Reduced_Product/directproduct2.cc, + tests/Partially_Reduced_Product/directproduct3.cc, + tests/Partially_Reduced_Product/directproduct4.cc, + tests/Partially_Reduced_Product/directproduct5.cc, + tests/Partially_Reduced_Product/directproduct6.cc, + tests/Partially_Reduced_Product/discrete1.cc, + tests/Partially_Reduced_Product/disjoint1.cc, + tests/Partially_Reduced_Product/dropsomenonintegerpoints1.cc, + tests/Partially_Reduced_Product/equals1.cc, + tests/Partially_Reduced_Product/frombdshape1.cc, + tests/Partially_Reduced_Product/frombox1.cc, + tests/Partially_Reduced_Product/fromgrid1.cc, + tests/Partially_Reduced_Product/fromoctagonalshape1.cc, + tests/Partially_Reduced_Product/frompolyhedron1.cc, + tests/Partially_Reduced_Product/fromproduct1.cc, + tests/Partially_Reduced_Product/generalizedaffineimage1.cc, + tests/Partially_Reduced_Product/intersection1.cc, + tests/Partially_Reduced_Product/isempty1.cc, + tests/Partially_Reduced_Product/isuniverse1.cc, + tests/Partially_Reduced_Product/maxmin1.cc, + tests/Partially_Reduced_Product/partially_reduced_product_test.hh, + tests/Partially_Reduced_Product/partiallyreducedproduct1.cc, + tests/Partially_Reduced_Product/partiallyreducedproduct2.cc, + tests/Partially_Reduced_Product/partiallyreducedproduct3.cc, + tests/Partially_Reduced_Product/partiallyreducedproduct4.cc, + tests/Partially_Reduced_Product/refinewithcongruences1.cc, + tests/Partially_Reduced_Product/refinewithconstraints1.cc, + tests/Partially_Reduced_Product/relations1.cc, + tests/Partially_Reduced_Product/shapepreservingproduct1.cc, + tests/Partially_Reduced_Product/smashproduct1.cc, + tests/Partially_Reduced_Product/spacedims1.cc, + tests/Partially_Reduced_Product/timeelapse1.cc, + tests/Partially_Reduced_Product/topclosed1.cc, + tests/Partially_Reduced_Product/topclosure1.cc, + tests/Partially_Reduced_Product/upperbound1.cc, + tests/Partially_Reduced_Product/widening1.cc, + tests/Polyhedron/Makefile.am, tests/Polyhedron/addcongruence1.cc, + tests/Polyhedron/addcongruences1.cc, + tests/Polyhedron/addconstraint1.cc, + tests/Polyhedron/addconstraints1.cc, + tests/Polyhedron/addconstraints2.cc, + tests/Polyhedron/addgenerator1.cc, + tests/Polyhedron/addgenerator2.cc, + tests/Polyhedron/addgenerators1.cc, + tests/Polyhedron/addgenerators2.cc, + tests/Polyhedron/addspacedims1.cc, + tests/Polyhedron/addspacedims2.cc, + tests/Polyhedron/affineimage1.cc, tests/Polyhedron/affineimage2.cc, + tests/Polyhedron/affinepreimage1.cc, + tests/Polyhedron/affinetrans.cc, tests/Polyhedron/append1.cc, + tests/Polyhedron/append2.cc, tests/Polyhedron/ascii_dump_load1.cc, + tests/Polyhedron/ascii_dump_load2.cc, + tests/Polyhedron/ascii_dump_load3.cc, + tests/Polyhedron/bgp99extrapolation1.cc, + tests/Polyhedron/bgp99extrapolation2.cc, + tests/Polyhedron/bhrz03widening1.cc, + tests/Polyhedron/bhrz03widening2.cc, + tests/Polyhedron/bhrz03widening3.cc, + tests/Polyhedron/bhz03widening1.cc, tests/Polyhedron/bounded1.cc, + tests/Polyhedron/boundedaffineimage1.cc, + tests/Polyhedron/boundedaffinepreimage1.cc, + tests/Polyhedron/boundedbhrz03extrapolation1.cc, + tests/Polyhedron/boundedh79extrapolation1.cc, + tests/Polyhedron/bounds1.cc, tests/Polyhedron/cnncconversion1.cc, + tests/Polyhedron/concatenate1.cc, tests/Polyhedron/congruences1.cc, + tests/Polyhedron/constrains1.cc, tests/Polyhedron/constraints1.cc, + tests/Polyhedron/contains1.cc, tests/Polyhedron/contains2.cc, + tests/Polyhedron/containsintegerpoint1.cc, + tests/Polyhedron/disjoint1.cc, tests/Polyhedron/disjoint2.cc, + tests/Polyhedron/dropsomenonintegerpoints1.cc, + tests/Polyhedron/dropsomenonintegerpoints2.cc, + tests/Polyhedron/dualhypercubes.cc, tests/Polyhedron/empty1.cc, + tests/Polyhedron/equals1.cc, tests/Polyhedron/exceptions1.cc, + tests/Polyhedron/exceptions2.cc, tests/Polyhedron/exceptions3.cc, + tests/Polyhedron/expandspacedim1.cc, + tests/Polyhedron/expandspacedim2.cc, + tests/Polyhedron/foldspacedims1.cc, + tests/Polyhedron/foldspacedims2.cc, tests/Polyhedron/frequency1.cc, + tests/Polyhedron/frombdshape1.cc, tests/Polyhedron/frombox1.cc, + tests/Polyhedron/frombox2.cc, tests/Polyhedron/fromgrid1.cc, + tests/Polyhedron/fromoctagonalshape1.cc, + tests/Polyhedron/generalizedaffineimage1.cc, + tests/Polyhedron/generalizedaffineimage2.cc, + tests/Polyhedron/generalizedaffinepreimage1.cc, + tests/Polyhedron/generalizedaffinepreimage2.cc, + tests/Polyhedron/generators1.cc, tests/Polyhedron/geomcovers1.cc, + tests/Polyhedron/h79widening1.cc, tests/Polyhedron/h79widening2.cc, + tests/Polyhedron/hybrid.cc, tests/Polyhedron/intersection1.cc, + tests/Polyhedron/limitedbhrz03extrapolation1.cc, + tests/Polyhedron/limitedh79extrapolation1.cc, + tests/Polyhedron/linearexpression1.cc, + tests/Polyhedron/linearpartition1.cc, + tests/Polyhedron/linearsystem1.cc, + tests/Polyhedron/mapspacedims1.cc, tests/Polyhedron/matrix1.cc, + tests/Polyhedron/max_min1.cc, tests/Polyhedron/maxspacedim1.cc, + tests/Polyhedron/mc91.cc, tests/Polyhedron/membytes1.cc, + tests/Polyhedron/memory1.cc, tests/Polyhedron/memory2.cc, + tests/Polyhedron/minconstraints1.cc, + tests/Polyhedron/minconstraints2.cc, + tests/Polyhedron/mingenerators1.cc, + tests/Polyhedron/mingenerators2.cc, + tests/Polyhedron/nncminimize1.cc, tests/Polyhedron/nncminimize2.cc, + tests/Polyhedron/nncpostimeelapse1.cc, + tests/Polyhedron/numberinput1.cc, tests/Polyhedron/onepoint.cc, + tests/Polyhedron/permute.cc, tests/Polyhedron/polydifference1.cc, + tests/Polyhedron/polydifference2.cc, tests/Polyhedron/polyhull1.cc, + tests/Polyhedron/polyhull2.cc, + tests/Polyhedron/polyhullifexact1.cc, + tests/Polyhedron/polyhullifexact2.cc, + tests/Polyhedron/randphull1.cc, + tests/Polyhedron/refinewithcongruence1.cc, + tests/Polyhedron/refinewithcongruences1.cc, + tests/Polyhedron/refinewithconstraint1.cc, + tests/Polyhedron/refinewithconstraints1.cc, + tests/Polyhedron/relations1.cc, tests/Polyhedron/relations2.cc, + tests/Polyhedron/relations3.cc, + tests/Polyhedron/removespacedims1.cc, + tests/Polyhedron/removespacedims2.cc, + tests/Polyhedron/simplifyusingcontext1.cc, + tests/Polyhedron/simplifyusingcontext2.cc, + tests/Polyhedron/smm1.cc, tests/Polyhedron/sparserow1.cc, + tests/Polyhedron/termination1.cc, tests/Polyhedron/termination2.cc, + tests/Polyhedron/timeelapse1.cc, tests/Polyhedron/timeelapse2.cc, + tests/Polyhedron/topclosed1.cc, tests/Polyhedron/topclosure1.cc, + tests/Polyhedron/unconstrain1.cc, tests/Polyhedron/universe1.cc, + tests/Polyhedron/universe2.cc, tests/Polyhedron/variablesset1.cc, + tests/Polyhedron/watchdog1.cc, tests/Polyhedron/weightwatch1.cc, + tests/Polyhedron/wrap1.cc, tests/Polyhedron/wrap2.cc, + tests/Polyhedron/writeconsys1.cc, tests/Polyhedron/writegensys1.cc, + tests/Polyhedron/writepolyhedron1.cc, + tests/Polyhedron/writepolyhedron2.cc, + tests/Polyhedron/writerelation1.cc, + tests/Polyhedron/writevariable1.cc, tests/Powerset/Makefile.am, + tests/Powerset/addcongruences1.cc, + tests/Powerset/addconstraints1.cc, + tests/Powerset/affinedimension1.cc, tests/Powerset/affineimage1.cc, + tests/Powerset/affinepreimage1.cc, tests/Powerset/bounded1.cc, + tests/Powerset/bounds1.cc, tests/Powerset/closed1.cc, + tests/Powerset/closure1.cc, tests/Powerset/collapse1.cc, + tests/Powerset/concatenate1.cc, tests/Powerset/contains1.cc, + tests/Powerset/containsintegerpoint1.cc, + tests/Powerset/difference1.cc, tests/Powerset/discrete1.cc, + tests/Powerset/disjoint1.cc, tests/Powerset/disjunct1.cc, + tests/Powerset/empty1.cc, tests/Powerset/entails1.cc, + tests/Powerset/equals1.cc, tests/Powerset/frombdshape1.cc, + tests/Powerset/frombox1.cc, tests/Powerset/fromcongruences1.cc, + tests/Powerset/fromconstraints1.cc, tests/Powerset/fromgrid1.cc, + tests/Powerset/fromoctagonalshape1.cc, + tests/Powerset/frompolyhedron1.cc, + tests/Powerset/fromspacedimension1.cc, + tests/Powerset/intersection1.cc, tests/Powerset/maxmin1.cc, + tests/Powerset/meet1.cc, tests/Powerset/membytes1.cc, + tests/Powerset/powerset1.cc, tests/Powerset/reduce1.cc, + tests/Powerset/refinewith1.cc, tests/Powerset/relationwith1.cc, + tests/Powerset/simplifyusingcontext1.cc, tests/Powerset/size1.cc, + tests/Powerset/spacedims1.cc, tests/Powerset/universe1.cc, + tests/Powerset/upperbound1.cc, tests/README, + tests/Random_Number_Generator_defs.hh, + tests/Random_Number_Generator_inlines.hh, + tests/Random_Number_Generator_types.hh, tests/Watchdog/Makefile.am, + tests/Watchdog/watchdog1.cc, tests/files.cc, tests/files.hh, + tests/ppl_test.cc, tests/ppl_test.hh, utils/Makefile.am, + utils/build_header.in, utils/cm_cleaner.sh, utils/cm_splitter.sh, + utils/text2cxxarray.in, utils/timings.cc, utils/timings.hh: Extended + copyright years. + +2014-12-24 Roberto Bagnara + + * demos/ppl_lpsol/dummy.cc, demos/ppl_lpsol/ppl_lpsol.c, + src/BDS_Status.cc, src/Box_Status.cc, + src/Floating_Point_Expression_defs.hh, src/Interval_defs.hh, + src/MIP_Problem.cc, src/NNC_Polyhedron_defs.hh, + src/OR_Matrix_defs.hh, src/Og_Status.cc: Corrected several header + inclusions. Fixes violations of rule UCGP1.F1 detected by ECLAIR. + +2014-12-23 Roberto Bagnara + + * src/Handler.cc, src/Handler_inlines.hh: Provided virtual method + anchor. Fixes a violation of rule UCGP1.L4 detected by ECLAIR. + +2014-12-23 Roberto Bagnara + + * src/Handler.cc: Spurious `inline' qualifier removed. + +2014-12-23 Roberto Bagnara + + * src/BHRZ03_Certificate_defs.hh, + src/BHRZ03_Certificate_inlines.hh, src/Bit_Matrix_inlines.hh, + src/Coefficient_defs.hh, src/Determinate_defs.hh, + src/Float_defs.hh, src/Float_inlines.hh, src/GMP_Integer_types.hh, + src/Grid_Certificate_defs.hh, src/Grid_Certificate_inlines.hh, + src/H79_Certificate_defs.hh, src/Interval_Info_defs.hh, + src/Interval_defs.hh, src/Linear_Expression_Impl_defs.hh, + src/Linear_System_templates.hh, src/PIP_Problem_defs.hh, + src/Partial_Function_inlines.hh, src/Powerset_inlines.hh, + src/Powerset_templates.hh, src/Ptr_Iterator_inlines.hh, + src/Swapping_Vector_defs.hh, src/Swapping_Vector_inlines.hh, + src/Threshold_Watcher_inlines.hh, src/algorithms.hh, + src/checked_defs.hh, src/intervals_defs.hh, + src/math_utilities_inlines.hh: Corrected several header inclusions. + Fixes violations of rule UCGP1.F1 detected by ECLAIR. + +2014-12-21 Roberto Bagnara + + * src/BDS_Status.cc, src/BDS_Status_inlines.hh, src/Box_Status.cc, + src/Box_Status_inlines.hh, src/Makefile.am, src/Og_Status.cc, + src/Og_Status_inlines.hh: The interface file shall contain + declarations only. Fixes violations of rule EP1.31 detected by + ECLAIR. + +2014-12-21 Roberto Bagnara + + * src/Handler.cc: Put under Git control. + +2014-12-21 Roberto Bagnara + + * src/Ask_Tell_inlines.hh, src/BD_Shape_inlines.hh, + src/BD_Shape_templates.hh, src/BHRZ03_Certificate.cc, + src/BHRZ03_Certificate_defs.hh, src/Bit_Matrix_inlines.hh, + src/Bit_Row.cc, src/Bit_Row_inlines.hh, + src/Checked_Number_templates.hh, src/Congruence.cc, + src/Congruence_System.cc, src/Constraint_System.cc, + src/DB_Matrix_inlines.hh, src/DB_Row_inlines.hh, src/Dense_Row.cc, + src/Dense_Row_inlines.hh, src/Determinate_defs.hh, + src/Determinate_inlines.hh, src/Float_defs.hh, + src/GMP_Integer_inlines.hh, src/Generator_System.cc, + src/Grid_Certificate.cc, src/Grid_Certificate_defs.hh, + src/Grid_Generator_System.cc, src/Grid_Status.cc, + src/Grid_chdims.cc, src/Grid_nonpublic.cc, src/Grid_public.cc, + src/Grid_simplify.cc, src/Grid_widenings.cc, + src/H79_Certificate.cc, src/H79_Certificate_defs.hh, + src/Linear_Expression_Impl.cc, src/Makefile.am, + src/OR_Matrix_inlines.hh, src/Octagonal_Shape_inlines.hh, + src/Octagonal_Shape_templates.hh, src/Partial_Function_inlines.hh, + src/Ph_Status.cc, src/Poly_Con_Relation.cc, + src/Poly_Gen_Relation.cc, src/Polyhedron_chdims.cc, + src/Polyhedron_nonpublic.cc, src/Polyhedron_public.cc, + src/Polyhedron_widenings.cc, src/Powerset_inlines.hh, + src/Powerset_templates.hh, src/Ptr_Iterator_inlines.hh, + src/Result_inlines.hh, src/Rounding_Dir_inlines.hh, + src/Swapping_Vector_defs.hh, src/Widening_Function_inlines.hh, + src/algorithms.hh, src/{assert.cc => assertions.cc}, src/{assert.hh + => assertions.hh}, src/c_streambuf.cc, src/checked_inlines.hh, + src/intervals_defs.hh, src/math_utilities_inlines.hh, + src/ppl_header.hh, src/stdiobuf.cc, src/wrap_assign.hh, + src/wrap_string.cc: Guarantee that header file names are unique. + Fixes violations of rule CP1.PRE08 detected by ECLAIR. + +2014-12-21 Roberto Bagnara + + * src/Handler_inlines.hh, src/Makefile.am, src/PIP_Tree.cc, + src/PIP_Tree_inlines.hh, src/c_streambuf.cc, + src/c_streambuf_inlines.hh, src/globals.cc, src/globals_inlines.hh: + Provided virtual method anchors. Fixes violations of rule UCGP1.L4 + detected by ECLAIR. + +2014-12-21 Roberto Bagnara + + * demos/ppl_pips/ppl_pips.cc, utils/timings.cc: Do not use `using + namespace std'. Fixes violations of rule UCGP1.L3 detected by + ECLAIR. + +2014-12-15 Roberto Bagnara + + * src/CO_Tree.cc, src/CO_Tree_inlines.hh, src/CO_Tree_templates.hh, + src/DB_Row_inlines.hh, src/DB_Row_templates.hh, src/Dense_Row.cc, + src/Dense_Row_inlines.hh, src/MIP_Problem.cc, + src/checked_inlines.hh, src/checked_mpq_inlines.hh, + src/checked_mpz_inlines.hh: Parenthesis spacing corrected. Fixes + violations of rule UCGP1.M1 detected by ECLAIR. + +2014-12-15 Roberto Bagnara + + * src/Octagonal_Shape_templates.hh: Post-decrement avoided. Fixes a + violation of rule UCGP1.M2 detected by ECLAIR. + +2014-12-14 Roberto Bagnara + + * demos/ppl_lcdd/ppl_lcdd.cc, demos/ppl_pips/ppl_pips.cc: Avoid + commenting out code. Fixes violations of rule EP1.17 detected by + ECLAIR. + +2014-12-14 Roberto Bagnara + + * src/checked.cc: Avoid the `expected' identifier. The C++ + standard, ISO/IEC 14882:2003(E), reserves it for header . + Fixes a violation of rule MP1.17-0-3 detected by ECLAIR. + +2014-12-14 Roberto Bagnara + + * src/Interval_templates.hh, src/checked.cc: Avoid the `unexpected' + identifier. The C++ standard, ISO/IEC 14882:2003(E), reserves it + for header . + +2014-12-14 Roberto Bagnara + + * demos/ppl_lcdd/ppl_lcdd.cc: Redundant anonymous namespace removed. + +2014-12-14 Roberto Bagnara + + * demos/ppl_lcdd/ppl_lcdd.cc: Scope of declaration reduced. Fixes a + violation of rule CP1.DCL07 detected by ECLAIR. + +2014-12-14 Roberto Bagnara + + * src/BD_Shape_defs.hh, src/Box_defs.hh, + src/Octagonal_Shape_defs.hh, src/Pointset_Powerset_inlines.hh, + src/Polyhedron_templates.hh: Parenthesis spacing corrected. Fixes + violations of rule UCGP1.M1 detected by ECLAIR. + +2014-12-14 Roberto Bagnara + + * src/Checked_Number_inlines.hh, src/Float_templates.hh, + src/Grid_public.cc, src/Linear_Expression_defs.hh, + src/Linear_Expression_inlines.hh, + src/Polyhedron_conversion_templates.hh, src/compiler.hh, + src/intervals_defs.hh: Parenthesis spacing corrected. Fixes + violations of rule UCGP1.M1 detected by ECLAIR. + +2014-12-09 Roberto Bagnara + + * src/Polyhedron_nonpublic.cc: Post-decrement avoided. Fixes a + violation of rule UCGP1.M2 detected by ECLAIR. + +2014-11-30 Roberto Bagnara + + * src/Handler_defs.hh: Capitalization and punctuation fixed. + +2014-11-29 Roberto Bagnara + + * src/Dense_Row_defs.hh, src/Dense_Row_inlines.hh, + src/Expression_Adapter_defs.hh, src/Expression_Adapter_inlines.hh, + src/Expression_Hide_Inhomo_defs.hh, + src/Expression_Hide_Inhomo_inlines.hh, + src/Expression_Hide_Last_defs.hh, + src/Expression_Hide_Last_inlines.hh, + src/Linear_Expression_Impl_defs.hh, + src/Linear_Expression_Impl_templates.hh, + src/Linear_Expression_Interface_defs.hh, + src/Linear_Expression_defs.hh, src/Sparse_Row.cc: Shadowing avoided. + Naming improved. + +2014-11-29 Roberto Bagnara + + * configure.ac: Disable some warnings. + +2014-11-29 Roberto Bagnara + + * src/Linear_Expression_defs.hh, src/Linear_Expression_inlines.hh, + src/MIP_Problem_defs.hh, src/MIP_Problem_inlines.hh: Shadowing + avoided. Comments improved. + +2014-11-29 Roberto Bagnara + + * src/Boundary_defs.hh: Spurious comma removed. + +2014-11-29 Roberto Bagnara + + * interfaces/Prolog/SWI/Makefile.am, + interfaces/Prolog/SWI/pl_clpq.cc, + interfaces/Prolog/SWI/ppl_interface_generator_swiprolog_cc.m4, + interfaces/Prolog/SWI/ppl_pl.cc, + interfaces/Prolog/SWI/ppl_swiprolog.hh: Added missing header file + and inclusions. + +2014-11-29 Roberto Bagnara + + * interfaces/Prolog/SWI/ppl_interface_generator_swiprolog_cc.m4: + C-style casts avoided. + +2014-11-29 Roberto Bagnara + + * interfaces/Prolog/ppl_interface_generator_prolog_cc_files.m4, + interfaces/Prolog/ppl_interface_generator_prolog_hh_files.m4: Added + missing inclusions. + +2014-11-29 Roberto Bagnara + + * src/Makefile.am: Added missing inclusions. + +2014-11-04 Roberto Bagnara + + * NEWS, configure.ac, src/Dense_Row.cc, + tests/Polyhedron/sparserow1.cc: Fixed a bug in the implementation of + dense rows. (Thanks to Enea Zaffanella.) + +2014-10-19 Roberto Bagnara + + * config.sub: Updated. + +2014-10-01 Roberto Bagnara + + * demos/ppl_lcdd/ppl_lcdd.cc, demos/ppl_lpsol/ppl_lpsol.c, + demos/ppl_pips/ppl_pips.cc, src/Init.cc, + src/set_GMP_memory_alloc_funcs.cc, tests/Polyhedron/memory1.cc: No + need to depend on PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK for auto + initialization. (Thanks to Keith Clifford.) + +2014-09-28 Roberto Bagnara + + * doc/ppl_citations.bib: Added AssarfGHJLPR14TR. + +2014-09-27 Roberto Bagnara + + * src/BD_Shape_templates.hh, src/Bit_Matrix.cc, + src/Box_templates.hh, + src/Difference_Floating_Point_Expression_inlines.hh, + src/Generator_System.cc, src/Grid_public.cc, + src/Polyhedron_nonpublic.cc, src/Polyhedron_public.cc, + src/checked_ext_inlines.hh, src/checked_float_inlines.hh: Code + layout corrected. + +2014-09-27 Roberto Bagnara + + * configure.ac: Version number bumped. + +2014-09-27 Roberto Bagnara + + * src/Init.cc, src/Makefile.am, src/set_GMP_memory_alloc_funcs.cc: + Default definition of ppl_set_GMP_memory_allocation_functions() + moved. Having it in its own file solves all problems with the MinGW + compiler. (Thanks to Keith Clifford.) + +2014-09-27 Roberto Bagnara + + * configure.ac: Version number bumped. + +2014-09-27 Roberto Bagnara + + * configure.ac: Version number bumped. + +2014-09-27 Roberto Bagnara + + * doc/Makefile.am: Fixed. + +2014-09-27 Roberto Bagnara + + * src/Polyhedron_public.cc, tests/Polyhedron/Makefile.am, + tests/Polyhedron/simplifyusingcontext2.cc: Fixed a bug in + Polyhedron::simplify_using_context_assign(). (Thanks to Didier Lime + for the bug report.) + +2014-07-28 Roberto Bagnara + + * src/Pending_List_templates.hh, + src/Polyhedron_minimize_templates.hh, + src/Polyhedron_simplify_templates.hh: Use a monotonic indentation + style. Fixes violations detected by ECLAIR checker B.MONOINDENT. + +2014-07-27 Roberto Bagnara + + * src/Bit_Row.cc, src/CO_Tree_inlines.hh, src/PIP_Tree.cc, + src/Polyhedron_nonpublic.cc, src/iterator_to_const_defs.hh: Comments + should never be used for "commenting out" code. Fixes violations of + rule EP1.17 detected by ECLAIR. + +2014-07-02 Roberto Bagnara + + * src/Checked_Number_defs.hh, src/Checked_Number_inlines.hh, + src/Linear_Expression_defs.hh, src/Linear_Expression_inlines.hh, + src/checked_int_inlines.hh, src/fpu-ia32.cc: Keep source lines to a + length of 120 characters or less. Fixes violations of rule LP1.41 + detected by ECLAIR. + +2014-06-30 Roberto Bagnara + + * src/Polyhedron_nonpublic.cc: Avoid tabs. Fixes violations of rule + UCRP1.RS1 detected by ECLAIR. + +2014-06-30 Roberto Bagnara + + * demos/ppl_lcdd/ppl_lcdd.cc, src/BD_Shape_templates.hh, + src/Constraint_System.cc, src/Generator_System.cc, + src/Linear_System_templates.hh, src/MIP_Problem.cc, + src/Matrix_templates.hh, src/OR_Matrix_templates.hh, + src/Octagonal_Shape_templates.hh, src/PIP_Tree.cc, + src/Polyhedron_public.cc, src/globals_defs.hh, + src/intervals_defs.hh: Added missing braces. Fixes violations of + rule MP1.6-4-1 detected by ECLAIR. + +2014-06-30 Patrik Pomelli + + * demos/ppl_lcdd/ppl_lcdd.cc, demos/ppl_pips/ppl_pips.cc, + src/BD_Shape_inlines.hh, src/BD_Shape_templates.hh, src/Bit_Row.cc, + src/Box_templates.hh, src/CO_Tree.cc, src/CO_Tree_inlines.hh, + src/Checked_Number_inlines.hh, src/Congruence_System.cc, + src/Constraint_System.cc, src/DB_Matrix_inlines.hh, + src/DB_Matrix_templates.hh, src/Generator.cc, + src/Generator_System.cc, src/Generator_System_inlines.hh, + src/Generator_inlines.hh, src/Grid_Generator.cc, + src/Grid_Generator_inlines.hh, src/Grid_chdims.cc, + src/Grid_conversion.cc, src/Grid_nonpublic.cc, src/Grid_public.cc, + src/Grid_widenings.cc, src/Interval_inlines.hh, + src/Interval_templates.hh, src/Linear_Expression_Impl_inlines.hh, + src/Linear_Expression_Impl_templates.hh, + src/Linear_System_templates.hh, src/MIP_Problem.cc, + src/Octagonal_Shape_templates.hh, src/PIP_Problem.cc, + src/PIP_Tree.cc, src/Pointset_Powerset.cc, + src/Pointset_Powerset_templates.hh, src/Polyhedron_chdims.cc, + src/Polyhedron_conversion_templates.hh, + src/Polyhedron_minimize_templates.hh, src/Polyhedron_nonpublic.cc, + src/Polyhedron_public.cc, src/Polyhedron_simplify_templates.hh, + src/Polyhedron_widenings.cc, src/Powerset_templates.hh, + src/Sparse_Row.cc, src/WRD_coefficient_types_inlines.hh, + src/checked.cc, src/checked_ext_inlines.hh, + src/checked_float_inlines.hh, src/checked_inlines.hh, + src/checked_int_inlines.hh, src/globals_inlines.hh, + src/termination.cc, src/wrap_assign.hh, src/wrap_string.cc, + utils/timings.cc: Added missing braces. Fixes violations of rule + MP1.6-4-1 detected by ECLAIR. Signed-off-by: Roberto Bagnara + +2014-06-30 Patrik Pomelli + + * src/Generator_System_inlines.hh, src/Linear_System_templates.hh, + src/MIP_Problem.cc, src/Polyhedron_conversion_templates.hh, + src/Polyhedron_minimize_templates.hh: Added missing braces. Fixes + violations of rule MP1.6-3-1 detected by ECLAIR. Signed-off-by: Roberto Bagnara + +2014-06-25 Roberto Bagnara + + * src/Grid_Generator.cc, src/H79_Certificate.cc, src/Init.cc, + src/Integer_Interval.hh, src/Interval_Info_defs.hh, + src/Interval_Info_inlines.hh, src/Interval_Info_types.hh, + src/Interval_defs.hh, src/Interval_inlines.hh, + src/Interval_templates.hh, src/Interval_types.hh, + src/Linear_Expression.cc, src/Linear_Expression_Impl.cc, + src/Linear_Expression_Impl_defs.hh, + src/Linear_Expression_Impl_inlines.hh, + src/Linear_Expression_Impl_templates.hh, + src/Linear_Expression_Impl_types.hh, + src/Linear_Expression_Interface.cc, + src/Linear_Expression_Interface_defs.hh, + src/Linear_Expression_Interface_types.hh, + src/Linear_Expression_defs.hh, src/Linear_Expression_inlines.hh, + src/Linear_Expression_types.hh, src/Linear_Form.cc, + src/Linear_Form_defs.hh, src/Linear_Form_inlines.hh, + src/Linear_Form_templates.hh, src/Linear_Form_types.hh, + src/Linear_System_defs.hh, src/Linear_System_inlines.hh, + src/Linear_System_templates.hh, src/Linear_System_types.hh, + src/MIP_Problem.cc, src/MIP_Problem_defs.hh, + src/MIP_Problem_inlines.hh, src/MIP_Problem_templates.hh, + src/MIP_Problem_types.hh, src/Matrix_defs.hh, + src/Matrix_inlines.hh, src/Matrix_templates.hh, + src/Matrix_types.hh, + src/Multiplication_Floating_Point_Expression_defs.hh, + src/Multiplication_Floating_Point_Expression_inlines.hh, + src/Multiplication_Floating_Point_Expression_templates.hh, + src/Multiplication_Floating_Point_Expression_types.hh, + src/NNC_Polyhedron.cc, src/NNC_Polyhedron_defs.hh, + src/NNC_Polyhedron_inlines.hh, src/NNC_Polyhedron_types.hh, + src/Numeric_Format_defs.hh, src/OR_Matrix_defs.hh, + src/OR_Matrix_inlines.hh, src/OR_Matrix_templates.hh, + src/OR_Matrix_types.hh, src/Octagonal_Shape.cc, + src/Octagonal_Shape_defs.hh, src/Octagonal_Shape_inlines.hh, + src/Octagonal_Shape_templates.hh, src/Octagonal_Shape_types.hh, + src/Og_Status_idefs.hh, src/Og_Status_inlines.hh, + src/Opposite_Floating_Point_Expression_defs.hh, + src/Opposite_Floating_Point_Expression_inlines.hh, + src/Opposite_Floating_Point_Expression_types.hh, + src/PIP_Problem.cc, src/PIP_Problem_defs.hh, + src/PIP_Problem_inlines.hh, src/PIP_Problem_templates.hh, + src/PIP_Problem_types.hh, src/PIP_Tree.cc, src/PIP_Tree_defs.hh, + src/PIP_Tree_inlines.hh, src/PIP_Tree_types.hh, + src/Partial_Function.cc, src/Partial_Function_defs.hh, + src/Partial_Function_inlines.hh, src/Partial_Function_types.hh, + src/Partially_Reduced_Product_defs.hh, + src/Partially_Reduced_Product_inlines.hh, + src/Partially_Reduced_Product_templates.hh, + src/Partially_Reduced_Product_types.hh, + src/Pending_Element_defs.hh, src/Pending_Element_inlines.hh, + src/Pending_Element_types.hh, src/Pending_List_defs.hh, + src/Pending_List_inlines.hh, src/Pending_List_templates.hh, + src/Pending_List_types.hh, src/Ph_Status.cc, + src/Ph_Status_inlines.hh, src/Pointset_Ask_Tell.cc, + src/Pointset_Ask_Tell_defs.hh, src/Pointset_Ask_Tell_inlines.hh, + src/Pointset_Ask_Tell_templates.hh, src/Pointset_Ask_Tell_types.hh, + src/Pointset_Powerset.cc, src/Pointset_Powerset_defs.hh, + src/Pointset_Powerset_inlines.hh, + src/Pointset_Powerset_templates.hh, src/Pointset_Powerset_types.hh, + src/Poly_Con_Relation.cc, src/Poly_Con_Relation_defs.hh, + src/Poly_Con_Relation_inlines.hh, src/Poly_Con_Relation_types.hh, + src/Poly_Gen_Relation.cc, src/Poly_Gen_Relation_defs.hh, + src/Poly_Gen_Relation_inlines.hh, src/Poly_Gen_Relation_types.hh, + src/Polyhedron_chdims.cc, src/Polyhedron_chdims_templates.hh, + src/Polyhedron_conversion_templates.hh, src/Polyhedron_defs.hh, + src/Polyhedron_inlines.hh, src/Polyhedron_minimize_templates.hh, + src/Polyhedron_nonpublic.cc, src/Polyhedron_public.cc, + src/Polyhedron_simplify_templates.hh, src/Polyhedron_templates.hh, + src/Polyhedron_types.hh, src/Polyhedron_widenings.cc, + src/Powerset_defs.hh, src/Powerset_inlines.hh, + src/Powerset_templates.hh, src/Powerset_types.hh, + src/Sparse_Row.cc, src/Sparse_Row_inlines.hh, + src/Sparse_Row_templates.hh, + src/Sum_Floating_Point_Expression_templates.hh, + src/Temp_inlines.hh, src/Threshold_Watcher_inlines.hh, + src/Threshold_Watcher_templates.hh, src/Variable.cc, + src/Variable_Floating_Point_Expression_inlines.hh, + src/Variables_Set.cc, src/Watchdog.cc, src/Watchdog_inlines.hh, + src/Weight_Profiler.cc, src/Weight_Profiler_defs.hh, + src/initializer.hh, src/intervals_defs.hh, + src/iterator_to_const_defs.hh, src/iterator_to_const_inlines.hh, + src/iterator_to_const_types.hh, src/linearize.hh, + src/math_utilities_defs.hh, src/math_utilities_inlines.hh, + src/max_space_dimension.hh, src/meta_programming.hh, + src/mp_std_bits.cc, src/mp_std_bits_defs.hh, + src/mp_std_bits_inlines.hh, src/namespaces.hh, src/ppl_header.hh, + src/stdiobuf.cc, src/swapping_sort_templates.hh, + src/termination.cc, src/termination_templates.hh: Fixed permissions. + +2014-06-21 Patrik Pomelli + + * src/wrap_assign.hh: Fixed brace position. Signed-off-by: Roberto Bagnara + +2014-06-24 Roberto Bagnara + + * src/Box_templates.hh, src/H79_Certificate.cc, src/Init.cc, + src/Interval_templates.hh, src/Linear_Expression_Impl.cc, + src/Linear_Expression_Impl_inlines.hh, + src/Linear_Expression_Impl_templates.hh, + src/Linear_Form_inlines.hh, src/Linear_System_inlines.hh, + src/Linear_System_templates.hh, src/MIP_Problem.cc, + src/Matrix_templates.hh, src/Octagonal_Shape.cc, + src/Octagonal_Shape_inlines.hh, src/Octagonal_Shape_templates.hh, + src/Og_Status_inlines.hh, + src/Opposite_Floating_Point_Expression_inlines.hh, + src/PIP_Problem.cc, src/PIP_Tree.cc, + src/Partial_Function_inlines.hh, + src/Partially_Reduced_Product_templates.hh, + src/Pending_List_templates.hh, src/Ph_Status.cc, + src/Pointset_Ask_Tell_templates.hh, + src/Pointset_Powerset_templates.hh, src/Polyhedron_chdims.cc, + src/Polyhedron_inlines.hh, src/Polyhedron_nonpublic.cc, + src/Polyhedron_public.cc, src/Polyhedron_templates.hh, + src/Polyhedron_widenings.cc, src/Sparse_Row.cc, + src/Sparse_Row_inlines.hh, src/Variables_Set.cc, src/linearize.hh, + src/swapping_sort_templates.hh, src/termination.cc: Deleted trailing + whitespace. + +2014-06-24 Patrik Pomelli + + * src/Grid_Generator.cc, src/Grid_Status.cc, src/Grid_nonpublic.cc, + src/Grid_public.cc, src/Grid_templates.hh, src/H79_Certificate.cc, + src/Handler_inlines.hh, src/Init.cc, src/Integer_Interval.hh, + src/Interval_Info_defs.hh, src/Interval_Info_inlines.hh, + src/Interval_Info_types.hh, src/Interval_defs.hh, + src/Interval_inlines.hh, src/Interval_templates.hh, + src/Interval_types.hh, src/Linear_Expression.cc, + src/Linear_Expression_Impl.cc, src/Linear_Expression_Impl_defs.hh, + src/Linear_Expression_Impl_inlines.hh, + src/Linear_Expression_Impl_templates.hh, + src/Linear_Expression_Impl_types.hh, + src/Linear_Expression_Interface.cc, + src/Linear_Expression_Interface_defs.hh, + src/Linear_Expression_Interface_types.hh, + src/Linear_Expression_defs.hh, src/Linear_Expression_inlines.hh, + src/Linear_Expression_types.hh, src/Linear_Form.cc, + src/Linear_Form_defs.hh, src/Linear_Form_inlines.hh, + src/Linear_Form_templates.hh, src/Linear_Form_types.hh, + src/Linear_System_defs.hh, src/Linear_System_inlines.hh, + src/Linear_System_templates.hh, src/Linear_System_types.hh, + src/MIP_Problem.cc, src/MIP_Problem_defs.hh, + src/MIP_Problem_inlines.hh, src/MIP_Problem_templates.hh, + src/MIP_Problem_types.hh, src/Matrix_defs.hh, + src/Matrix_inlines.hh, src/Matrix_templates.hh, + src/Matrix_types.hh, + src/Multiplication_Floating_Point_Expression_defs.hh, + src/Multiplication_Floating_Point_Expression_inlines.hh, + src/Multiplication_Floating_Point_Expression_templates.hh, + src/Multiplication_Floating_Point_Expression_types.hh, + src/NNC_Polyhedron.cc, src/NNC_Polyhedron_defs.hh, + src/NNC_Polyhedron_inlines.hh, src/NNC_Polyhedron_types.hh, + src/Numeric_Format_defs.hh, src/OR_Matrix_defs.hh, + src/OR_Matrix_inlines.hh, src/OR_Matrix_templates.hh, + src/OR_Matrix_types.hh, src/Octagonal_Shape.cc, + src/Octagonal_Shape_defs.hh, src/Octagonal_Shape_inlines.hh, + src/Octagonal_Shape_templates.hh, src/Octagonal_Shape_types.hh, + src/Og_Status_idefs.hh, src/Og_Status_inlines.hh, + src/Opposite_Floating_Point_Expression_defs.hh, + src/Opposite_Floating_Point_Expression_inlines.hh, + src/Opposite_Floating_Point_Expression_types.hh, + src/PIP_Problem.cc, src/PIP_Problem_defs.hh, + src/PIP_Problem_inlines.hh, src/PIP_Problem_templates.hh, + src/PIP_Problem_types.hh, src/PIP_Tree.cc, src/PIP_Tree_defs.hh, + src/PIP_Tree_inlines.hh, src/PIP_Tree_types.hh, + src/Partial_Function.cc, src/Partial_Function_defs.hh, + src/Partial_Function_inlines.hh, src/Partial_Function_types.hh, + src/Partially_Reduced_Product_defs.hh, + src/Partially_Reduced_Product_inlines.hh, + src/Partially_Reduced_Product_templates.hh, + src/Partially_Reduced_Product_types.hh, + src/Pending_Element_defs.hh, src/Pending_Element_inlines.hh, + src/Pending_Element_types.hh, src/Pending_List_defs.hh, + src/Pending_List_inlines.hh, src/Pending_List_templates.hh, + src/Pending_List_types.hh, src/Ph_Status.cc, + src/Ph_Status_inlines.hh, src/Pointset_Ask_Tell.cc, + src/Pointset_Ask_Tell_defs.hh, src/Pointset_Ask_Tell_inlines.hh, + src/Pointset_Ask_Tell_templates.hh, src/Pointset_Ask_Tell_types.hh, + src/Pointset_Powerset.cc, src/Pointset_Powerset_defs.hh, + src/Pointset_Powerset_inlines.hh, + src/Pointset_Powerset_templates.hh, src/Pointset_Powerset_types.hh, + src/Poly_Con_Relation.cc, src/Poly_Con_Relation_defs.hh, + src/Poly_Con_Relation_inlines.hh, src/Poly_Con_Relation_types.hh, + src/Poly_Gen_Relation.cc, src/Poly_Gen_Relation_defs.hh, + src/Poly_Gen_Relation_inlines.hh, src/Poly_Gen_Relation_types.hh, + src/Polyhedron_chdims.cc, src/Polyhedron_chdims_templates.hh, + src/Polyhedron_conversion_templates.hh, src/Polyhedron_defs.hh, + src/Polyhedron_inlines.hh, src/Polyhedron_minimize_templates.hh, + src/Polyhedron_nonpublic.cc, src/Polyhedron_public.cc, + src/Polyhedron_simplify_templates.hh, src/Polyhedron_templates.hh, + src/Polyhedron_types.hh, src/Polyhedron_widenings.cc, + src/Powerset_defs.hh, src/Powerset_inlines.hh, + src/Powerset_templates.hh, src/Powerset_types.hh, + src/Sparse_Row.cc, src/Sparse_Row_inlines.hh, + src/Sparse_Row_templates.hh, + src/Sum_Floating_Point_Expression_templates.hh, + src/Temp_inlines.hh, src/Threshold_Watcher_inlines.hh, + src/Threshold_Watcher_templates.hh, src/Variable.cc, + src/Variable_Floating_Point_Expression_inlines.hh, + src/Variables_Set.cc, src/Watchdog.cc, src/Watchdog_inlines.hh, + src/Weight_Profiler.cc, src/Weight_Profiler_defs.hh, + src/initializer.hh, src/intervals_defs.hh, + src/iterator_to_const_defs.hh, src/iterator_to_const_inlines.hh, + src/iterator_to_const_types.hh, src/linearize.hh, + src/math_utilities_defs.hh, src/math_utilities_inlines.hh, + src/max_space_dimension.hh, src/meta_programming.hh, + src/mp_std_bits.cc, src/mp_std_bits_defs.hh, + src/mp_std_bits_inlines.hh, src/namespaces.hh, src/ppl_header.hh, + src/stdiobuf.cc, src/swapping_sort_templates.hh, + src/termination.cc, src/termination_templates.hh: Added missing + braces. Fixes violations of rule MP1.6-4-1 detected by ECLAIR. Signed-off-by: Roberto Bagnara + +2014-06-21 Patrik Pomelli + + * src/Matrix_templates.hh: Brace position fixed. Signed-off-by: Roberto Bagnara + +2014-06-20 Roberto Bagnara + + * src/Constraint.cc: Typo fixed. + +2014-06-20 Roberto Bagnara + + * src/BHRZ03_Certificate.cc, src/Bit_Matrix.cc: Permissions fixed. + +2014-06-20 Roberto Bagnara + + * src/Box_templates.hh: Added missing braces. Fixes violations of + rule MP1.6-4-1 detected by ECLAIR. + +2014-06-20 Roberto Bagnara + + * src/Affine_Space.cc, src/Ask_Tell_inlines.hh, + src/BDS_Status_inlines.hh, src/BD_Shape.cc, + src/BD_Shape_inlines.hh, src/BD_Shape_templates.hh, src/Bit_Row.cc, + src/Box.cc, src/Box_Status_inlines.hh, src/Box_inlines.hh, + src/CO_Tree.cc, src/CO_Tree_inlines.hh, src/CO_Tree_templates.hh, + src/Congruence.cc, src/Congruence_System.cc, src/Constraint.cc, + src/Constraint_System.cc, src/Dense_Row.cc, + src/Division_Floating_Point_Expression_templates.hh, + src/Float_templates.hh, src/Floating_Point_Expression_inlines.hh, + src/Generator.cc, src/Generator_System.cc, + src/Generator_System_inlines.hh, src/Generator_inlines.hh, + src/Grid_Generator_System.cc, src/Grid_Status.cc, + src/Grid_chdims.cc, src/Grid_conversion.cc, src/Grid_inlines.hh, + src/Grid_nonpublic.cc, src/Grid_public.cc, src/Grid_simplify.cc, + src/Grid_templates.hh, src/Grid_widenings.cc, src/checked.cc, + src/checked_inlines.hh, src/globals_inlines.hh, src/wrap_assign.hh: + Deleted trailing whitespace. + +2014-06-19 Patrik Pomelli + + * src/Affine_Space.cc, src/Ask_Tell_inlines.hh, + src/Ask_Tell_templates.hh, src/BDS_Status_inlines.hh, + src/BD_Shape.cc, src/BD_Shape_inlines.hh, + src/BD_Shape_templates.hh, src/Bit_Matrix.cc, + src/Bit_Matrix_inlines.hh, src/Bit_Row.cc, src/Boundary_defs.hh, + src/Box.cc, src/Box_Status_inlines.hh, src/Box_inlines.hh, + src/CO_Tree.cc, src/CO_Tree_inlines.hh, src/CO_Tree_templates.hh, + src/C_Polyhedron.cc, + src/Cast_Floating_Point_Expression_templates.hh, + src/Checked_Number_templates.hh, src/Coefficient_inlines.hh, + src/Congruence.cc, src/Congruence_System.cc, + src/Congruence_System_inlines.hh, src/Congruence_inlines.hh, + src/Constraint.cc, src/Constraint_System.cc, + src/Constraint_System_inlines.hh, src/Constraint_inlines.hh, + src/DB_Matrix_inlines.hh, src/DB_Matrix_templates.hh, + src/DB_Row_inlines.hh, src/DB_Row_templates.hh, src/Dense_Row.cc, + src/Dense_Row_inlines.hh, src/Determinate_inlines.hh, + src/Difference_Floating_Point_Expression_templates.hh, + src/Division_Floating_Point_Expression_templates.hh, + src/EList_inlines.hh, src/Expression_Hide_Inhomo_inlines.hh, + src/Expression_Hide_Last_inlines.hh, src/Float_inlines.hh, + src/Float_templates.hh, src/Floating_Point_Expression_inlines.hh, + src/Generator.cc, src/Generator_System.cc, + src/Generator_System_inlines.hh, src/Generator_inlines.hh, + src/Grid_Certificate.cc, src/Grid_Generator_System.cc, + src/Grid_Generator_inlines.hh, src/Grid_Status.cc, + src/Grid_Status_inlines.hh, src/Grid_chdims.cc, + src/Grid_conversion.cc, src/Grid_inlines.hh, src/Grid_nonpublic.cc, + src/Grid_public.cc, src/Grid_simplify.cc, src/Grid_templates.hh, + src/Grid_widenings.cc, src/algorithms.hh, src/c_streambuf.cc, + src/checked.cc, src/checked_ext_inlines.hh, + src/checked_float_inlines.hh, src/checked_inlines.hh, + src/checked_int_inlines.hh, src/checked_mpq_inlines.hh, + src/checked_mpz_inlines.hh, src/compiler.hh, + src/distances_inlines.hh, src/fpu-c99_inlines.hh, + src/fpu-ia32_inlines.hh, src/globals_inlines.hh, + src/wrap_assign.hh, src/wrap_string.cc: Added missing braces. Fixes + violations of rule MP1.6-4-1 detected by ECLAIR. Signed-off-by: Roberto Bagnara + +2014-06-18 Roberto Bagnara + + * src/Box_templates.hh, src/Generator_inlines.hh, + src/Linear_System_inlines.hh, src/MIP_Problem.cc, + src/Polyhedron_nonpublic.cc, src/Polyhedron_public.cc: Deleted + trailing whitespace. + +2014-06-16 Patrik Pomelli + + * src/MIP_Problem.cc, src/Polyhedron_nonpublic.cc, + src/Polyhedron_public.cc: Readded newlines erased by mistake. Signed-off-by: Roberto Bagnara + +2014-06-14 Roberto Bagnara + + * src/BD_Shape.cc, src/Bit_Row.cc, src/Congruence.cc, + src/Constraint.cc, src/Generator_System.cc, src/Grid_Generator.cc, + src/Init.cc, src/Octagonal_Shape.cc, src/Polyhedron_nonpublic.cc, + src/Polyhedron_public.cc, + tests/Concrete_Expression/digitalfilters1.cc, + tests/Polyhedron/linearsystem1.cc: Removed trailing whitespace. + +2014-06-14 Patrik Pomelli + + * src/Box_templates.hh, src/Congruence_System_inlines.hh, + src/DB_Matrix_templates.hh, src/Grid_public.cc, + src/Linear_Expression_Impl_templates.hh, + src/Linear_System_inlines.hh, src/MIP_Problem.cc, + src/Partially_Reduced_Product_templates.hh, + src/Pointset_Powerset_templates.hh, + src/Polyhedron_conversion_templates.hh, + src/Polyhedron_nonpublic.cc, src/Polyhedron_public.cc: Added missing + braces. Fixes violations of rule MP1.6-3-1 detected by ECLAIR. Signed-off-by: Roberto Bagnara + +2014-06-14 Roberto Bagnara + + * : commit fe759bb940ffa3083ec6eca0c8221d388bd2bb64 Author: Roberto + Bagnara Date: Thu Jun 12 21:43:12 + 2014 +0200 + +2014-06-12 Roberto Bagnara + + * src/Bit_Matrix.cc: Missing brace added. + +2014-06-12 Patrik Pomelli + + * demos/ppl_pips/ppl_pips.cc, src/BD_Shape.cc, + src/BD_Shape_inlines.hh, src/BD_Shape_templates.hh, + src/BHRZ03_Certificate.cc, src/Box_templates.hh, src/CO_Tree.cc, + src/CO_Tree_inlines.hh, src/Congruence_System.cc, + src/Constraint_System.cc, src/DB_Matrix_templates.hh, + src/DB_Row_templates.hh, src/Dense_Row.cc, + src/Dense_Row_inlines.hh, src/Dense_Row_templates.hh, + src/EList_inlines.hh, src/Generator_System.cc, + src/Grid_Generator_System.cc, src/Grid_conversion.cc, + src/Grid_nonpublic.cc, src/Grid_public.cc, src/Grid_simplify.cc, + src/Grid_templates.hh, src/Linear_Expression_Impl.cc, + src/Linear_Expression_Impl_templates.hh, + src/Linear_Expression_inlines.hh, src/Linear_System_inlines.hh, + src/Linear_System_templates.hh, src/MIP_Problem.cc, + src/MIP_Problem_inlines.hh, src/MIP_Problem_templates.hh, + src/Matrix_templates.hh, src/OR_Matrix_inlines.hh, + src/OR_Matrix_templates.hh, src/Octagonal_Shape_inlines.hh, + src/Octagonal_Shape_templates.hh, src/PIP_Problem.cc, + src/PIP_Problem_inlines.hh, src/PIP_Tree.cc, + src/Partial_Function.cc, + src/Partially_Reduced_Product_templates.hh, + src/Pending_List_templates.hh, src/Pointset_Powerset.cc, + src/Pointset_Powerset_templates.hh, src/Polyhedron_chdims.cc, + src/Polyhedron_chdims_templates.hh, + src/Polyhedron_conversion_templates.hh, + src/Polyhedron_minimize_templates.hh, src/Polyhedron_nonpublic.cc, + src/Polyhedron_simplify_templates.hh, src/Polyhedron_widenings.cc, + src/Powerset_templates.hh, src/Sparse_Row.cc, + src/Sparse_Row_templates.hh, src/Swapping_Vector_inlines.hh, + src/Variables_Set.cc, src/algorithms.hh, + src/swapping_sort_templates.hh, src/termination.cc, + src/termination_templates.hh, src/wrap_assign.hh, + src/wrap_string.cc: Added missing braces. Fixes violations of rules + MP1.6-3-1 and MP1.6-4-1 detected by ECLAIR. Signed-off-by: Roberto Bagnara + +2014-06-09 Patrik Pomelli + + * demos/ppl_lcdd/ppl_lcdd.cc: Do not declare more than one variable + per declaration. Fixes violations of rule CP1.DCL04 detected by + ECLAIR. Signed-off-by: Roberto Bagnara + +2014-06-09 Patrik Pomelli + + * src/Bit_Matrix.cc: Previous commit fixed. Signed-off-by: Roberto Bagnara + +2014-06-09 Patrik Pomelli + + * demos/ppl_lcdd/ppl_lcdd.cc, src/BD_Shape_templates.hh, + src/BHRZ03_Certificate.cc, src/Bit_Matrix.cc, src/Box_templates.hh: + Added missing braces. Fixes violations of rules MP1.6-3-1 and + MP1.6-4-1 detected by ECLAIR Signed-off-by: Roberto Bagnara + +2014-06-08 Roberto Bagnara + + * src/Polyhedron_nonpublic.cc: Long lines avoided. Fixes violations + of rule LP1.41 detected by ECLAIR. + +2014-06-08 Roberto Bagnara + + * src/Polyhedron_nonpublic.cc: Tabs avoided. Fixes violations of + rule UCRP1.RS1 detected by ECLAIR. + +2014-05-09 Roberto Bagnara + + * config.guess, config.sub, missing: Updated. + +2014-05-09 Roberto Bagnara + + * test-driver: Put under Git control. + +2014-05-08 Roberto Bagnara + + * configure.ac: Typo fixed. Set warnings for compilation with + clang. + +2014-05-08 Abramo Bagnara + + * src/checked_mpz_inlines.hh: Adapted to g++ -std=c++11. + +2014-04-29 Roberto Bagnara + + * interfaces/Prolog/GNU/gprolog_efli.hh: Adapted to recent versions + of GNU Prolog so as to work on 64-bit machines. + +2014-04-29 Roberto Bagnara + + * src/CO_Tree.cc, src/CO_Tree_defs.hh, src/CO_Tree_inlines.hh, + src/Congruence_System_defs.hh, src/Constraint_System_defs.hh, + src/Dense_Row_defs.hh, src/Generator_System_defs.hh, + src/Grid_Generator_System_defs.hh, + src/Linear_Expression_Interface_defs.hh, + src/Linear_Expression_defs.hh: Added missing inclusions. Use + std::ptrdiff_t. (Thanks to Paulo Cesar Pereira de Andrade.) + +2014-04-17 Abramo Bagnara + + * interfaces/Prolog/SWI/ppl_interface_generator_swiprolog_cc.m4: + Fixed compilation with SWI Prolog 7.1.13. + +2014-04-15 Abramo Bagnara + + * interfaces/Java/jni/Makefile.am, + interfaces/Prolog/Ciao/Makefile.am, + interfaces/Prolog/GNU/Makefile.am, + interfaces/Prolog/SICStus/Makefile.am, + interfaces/Prolog/SWI/Makefile.am, + interfaces/Prolog/XSB/Makefile.am, + interfaces/Prolog/YAP/Makefile.am: Revert "Create ordinary dynamic + library for interfaces, not modules. This means that the extension + in darwin is changed from .so to .dylib (just like for PPL + library)." This reverts commit faceaf05b260f5d214ae8777499a24fb69cf5c75. + +2014-04-15 Abramo Bagnara + + * interfaces/Java/jni/Makefile.am, + interfaces/Prolog/Ciao/Makefile.am, + interfaces/Prolog/GNU/Makefile.am, + interfaces/Prolog/SICStus/Makefile.am, + interfaces/Prolog/SWI/Makefile.am, + interfaces/Prolog/XSB/Makefile.am, + interfaces/Prolog/YAP/Makefile.am: Create ordinary dynamic library + for interfaces, not modules. This means that the extension in darwin + is changed from .so to .dylib (just like for PPL library). + +2014-03-30 Roberto Bagnara + + * src/Octagonal_Shape_templates.hh: Useless local variables removed. + +2014-03-29 Roberto Bagnara + + * interfaces/Prolog/GNU/gprolog_cfli.hh: Added Prolog_get_nil() and + Prolog_put_nil(). + +2014-03-29 Roberto Bagnara + + * interfaces/Prolog/YAP/yap_cfli.hh: Added Prolog_get_nil() and + Prolog_put_nil(). + +2014-03-29 Roberto Bagnara + + * interfaces/Prolog/XSB/xsb_cfli.hh: Added Prolog_get_nil() and + Prolog_put_nil(). + +2014-03-29 Roberto Bagnara + + * demos/ppl_lcdd/ppl_lcdd.cc, demos/ppl_pips/ppl_pips.cc: Bugs + fixed. + +2014-03-28 Roberto Bagnara + + * src/checked_mpz_inlines.hh, src/version.cc: Solve some compilation + issues with clang++ -std=c++11. (Thanks to Stefan Schupp.) + +2014-03-28 Roberto Bagnara + + * configure.ac, m4/ac_check_cxx11.m4, ppl-config.sed: Check whether + the C++ compiler supports some basic C++11 features. + +2014-02-26 Abramo Bagnara + + * interfaces/Prolog/ppl_prolog_common.cc, + interfaces/Prolog/ppl_prolog_common_defs.hh: Get rid of a_nil. + +2014-01-10 Roberto Bagnara + + * doc/ppl_citations.bib: Consistency improved. + +2014-01-09 Patricia Hill + + * doc/ppl_citations.bib: Reference added. + +2014-01-05 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed HenryMM12b. + +2014-01-04 Patricia Hill + + * doc/ppl_citations.bib: Reference added. + +2014-01-01 Roberto Bagnara + + * Makefile.am, NEWS, README, README.alpha, README.arm, + README.configure, README.solaris, STANDARDS, configure.ac, + debian/libppl-pwl.copyright.in, debian/libppl.copyright.in, + demos/Makefile.am, demos/ppl_lcdd/Makefile.am, + demos/ppl_lcdd/examples/Makefile.am, demos/ppl_lcdd/ppl_lcdd.1, + demos/ppl_lcdd/ppl_lcdd.cc, demos/ppl_lcdd/ppl_lcdd_extra_man_text, + demos/ppl_lpsol/Makefile.am, demos/ppl_lpsol/dummy.cc, + demos/ppl_lpsol/examples/Makefile.am, demos/ppl_lpsol/ppl_lpsol.1, + demos/ppl_lpsol/ppl_lpsol.c, + demos/ppl_lpsol/ppl_lpsol_extra_man_text, + demos/ppl_pips/Makefile.am, demos/ppl_pips/examples/Makefile.am, + demos/ppl_pips/ppl_pips.1, demos/ppl_pips/ppl_pips.cc, + demos/ppl_pips/ppl_pips_extra_man_text, + devtools/bump_copyright_years, devtools/generate_dox_biblio, + devtools/generate_man_pages, devtools/print_nonascii_lines, + devtools/update_ChangeLog, doc/Makefile.am, doc/README.doc, + doc/definitions.dox, doc/devref-language-interface.tex, + doc/devref.tex, doc/libppl.3, doc/libppl_c.3, doc/ppl-config.1, + doc/ppl-config_extra_man_text, doc/ppl.bib, doc/ppl.sty, + doc/ppl_citations.bib, doc/user-language-interface.tex, + doc/user.tex, fedora/ppl.hh, fedora/ppl_c.h, fedora/pwl.hh, + instchk.hh, interfaces/C/C_interface.dox, interfaces/C/Makefile.am, + interfaces/C/ppl_c_header.h, + interfaces/C/ppl_c_implementation_common.cc, + interfaces/C/ppl_c_implementation_common_defs.hh, + interfaces/C/ppl_c_implementation_common_inlines.hh, + interfaces/C/ppl_c_version.h.in, + interfaces/C/ppl_interface_generator_c_cc_code.m4, + interfaces/C/ppl_interface_generator_c_cc_files.m4, + interfaces/C/ppl_interface_generator_c_h.m4, + interfaces/C/ppl_interface_generator_c_h_code.m4, + interfaces/C/ppl_interface_generator_c_hh_files.m4, + interfaces/C/ppl_interface_generator_c_procedure_generators.m4, + interfaces/C/tests/Makefile.am, + interfaces/C/tests/formatted_output.c, + interfaces/C/tests/pip_test.c, interfaces/C/tests/ppl_c_test.cc, + interfaces/C/tests/ppl_c_test.h, + interfaces/C/tests/print_to_buffer.c, + interfaces/C/tests/print_to_buffer.h, + interfaces/C/tests/watchdog1.c, interfaces/C/tests/weightwatch1.c, + interfaces/Java/Makefile.am, interfaces/Java/README.java, + interfaces/Java/jni/Makefile.am, + interfaces/Java/jni/ppl_interface_generator_java_classes_cc_code.m4 + , + interfaces/Java/jni/ppl_interface_generator_java_classes_cc_files.m + 4, interfaces/Java/jni/ppl_java_common.cc, + interfaces/Java/jni/ppl_java_common_defs.hh, + interfaces/Java/jni/ppl_java_common_inlines.hh, + interfaces/Java/jni/ppl_java_globals.cc, + interfaces/Java/parma_polyhedra_library/Artificial_Parameter.java, + interfaces/Java/parma_polyhedra_library/Artificial_Parameter_Sequen + ce.java, + interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Overfl + ow.java, + interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Repres + entation.java, + interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Width. + java, interfaces/Java/parma_polyhedra_library/By_Reference.java, + interfaces/Java/parma_polyhedra_library/Coefficient.java, + interfaces/Java/parma_polyhedra_library/Complexity_Class.java, + interfaces/Java/parma_polyhedra_library/Congruence.java, + interfaces/Java/parma_polyhedra_library/Congruence_System.java, + interfaces/Java/parma_polyhedra_library/Constraint.java, + interfaces/Java/parma_polyhedra_library/Constraint_System.java, + interfaces/Java/parma_polyhedra_library/Control_Parameter_Name.java + , + interfaces/Java/parma_polyhedra_library/Control_Parameter_Value.jav + a, interfaces/Java/parma_polyhedra_library/Degenerate_Element.java, + interfaces/Java/parma_polyhedra_library/Domain_Error_Exception.java + , + interfaces/Java/parma_polyhedra_library/Fake_Class_for_Doxygen.java + , interfaces/Java/parma_polyhedra_library/Generator.java, + interfaces/Java/parma_polyhedra_library/Generator_System.java, + interfaces/Java/parma_polyhedra_library/Generator_Type.java, + interfaces/Java/parma_polyhedra_library/Grid_Generator.java, + interfaces/Java/parma_polyhedra_library/Grid_Generator_System.java, + interfaces/Java/parma_polyhedra_library/Grid_Generator_Type.java, + interfaces/Java/parma_polyhedra_library/IO.java, + interfaces/Java/parma_polyhedra_library/Invalid_Argument_Exception. + java, + interfaces/Java/parma_polyhedra_library/Length_Error_Exception.java + , interfaces/Java/parma_polyhedra_library/Linear_Expression.java, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Coefficie + nt.java, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Differenc + e.java, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Sum.java, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Times.jav + a, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Unary_Min + us.java, + interfaces/Java/parma_polyhedra_library/Linear_Expression_Variable. + java, + interfaces/Java/parma_polyhedra_library/Logic_Error_Exception.java, + interfaces/Java/parma_polyhedra_library/MIP_Problem.java, + interfaces/Java/parma_polyhedra_library/MIP_Problem_Status.java, + interfaces/Java/parma_polyhedra_library/Makefile.am, + interfaces/Java/parma_polyhedra_library/Optimization_Mode.java, + interfaces/Java/parma_polyhedra_library/Overflow_Error_Exception.ja + va, interfaces/Java/parma_polyhedra_library/PIP_Decision_Node.java, + interfaces/Java/parma_polyhedra_library/PIP_Problem.java, + interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Paramet + er_Name.java, + interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Paramet + er_Value.java, + interfaces/Java/parma_polyhedra_library/PIP_Problem_Status.java, + interfaces/Java/parma_polyhedra_library/PIP_Solution_Node.java, + interfaces/Java/parma_polyhedra_library/PIP_Tree_Node.java, + interfaces/Java/parma_polyhedra_library/PPL_Object.java, + interfaces/Java/parma_polyhedra_library/Pair.java, + interfaces/Java/parma_polyhedra_library/Parma_Polyhedra_Library.jav + a, interfaces/Java/parma_polyhedra_library/Partial_Function.java, + interfaces/Java/parma_polyhedra_library/Poly_Con_Relation.java, + interfaces/Java/parma_polyhedra_library/Poly_Gen_Relation.java, + interfaces/Java/parma_polyhedra_library/Relation_Symbol.java, + interfaces/Java/parma_polyhedra_library/Timeout_Exception.java, + interfaces/Java/parma_polyhedra_library/Variable.java, + interfaces/Java/parma_polyhedra_library/Variable_Stringifier.java, + interfaces/Java/parma_polyhedra_library/Variables_Set.java, + interfaces/Java/parma_polyhedra_library/ppl_interface_generator_jav + a_classes_java.m4, + interfaces/Java/parma_polyhedra_library/ppl_interface_generator_jav + a_classes_java_code.m4, + interfaces/Java/ppl_interface_generator_java_procedure_generators.m + 4, interfaces/Java/tests/C_Polyhedron_test1.java, + interfaces/Java/tests/Custom_Variable_Stringifier.java, + interfaces/Java/tests/MIP_Problem_test1.java, + interfaces/Java/tests/Makefile.am, + interfaces/Java/tests/NNC_Polyhedron_test1.java, + interfaces/Java/tests/PIP_Problem_test1.java, + interfaces/Java/tests/PPL_Test.java, + interfaces/Java/tests/Parma_Polyhedra_Library_test1.java, + interfaces/Java/tests/Parma_Polyhedra_Library_test2.java, + interfaces/Java/tests/Test_Executor.java, + interfaces/Java/tests/Variable_Output_test1.java, + interfaces/Java/tests/ppl_interface_generator_java_test_java.m4, + interfaces/Java/tests/ppl_interface_generator_java_test_java_code.m + 4, interfaces/Java/tests/ppl_java_tests_common, + interfaces/Makefile.am, interfaces/OCaml/Makefile.am, + interfaces/OCaml/OCaml_interface.dox, + interfaces/OCaml/README.ocaml, + interfaces/OCaml/ppl_interface_generator_ocaml_cc_code.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_cc_files.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_hh_code.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_hh_files.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_ml.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_ml_code.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_mli.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_mli_code.m4, + interfaces/OCaml/ppl_interface_generator_ocaml_procedure_generators + .m4, interfaces/OCaml/ppl_ocaml_common.cc, + interfaces/OCaml/ppl_ocaml_common_defs.hh, + interfaces/OCaml/ppl_ocaml_common_inlines.hh, + interfaces/OCaml/ppl_ocaml_globals.ml, + interfaces/OCaml/ppl_ocaml_globals.mli, + interfaces/OCaml/tests/Makefile.am, + interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml.m4, + interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml_code.m + 4, interfaces/OCaml/tests/ppl_ocaml_tests_common, + interfaces/OCaml/tests/test1.ml, + interfaces/Prolog/Ciao/Makefile.am, + interfaces/Prolog/Ciao/README.ciao, + interfaces/Prolog/Ciao/ciao_cfli.hh, + interfaces/Prolog/Ciao/ciao_clpq.pl, + interfaces/Prolog/Ciao/ciao_clpq2.pl, + interfaces/Prolog/Ciao/ciao_efli.cc, + interfaces/Prolog/Ciao/ciao_efli.hh, + interfaces/Prolog/Ciao/ciao_pl_check.pl, + interfaces/Prolog/Ciao/ppl_interface_generator_ciao_pl.m4, + interfaces/Prolog/Ciao/ppl_interface_generator_ciao_prolog_generate + d_test_pl.m4, interfaces/Prolog/Ciao/ppl_prolog_sysdep.hh, + interfaces/Prolog/GNU/Makefile.am, + interfaces/Prolog/GNU/README.gprolog, + interfaces/Prolog/GNU/gnu_pl_check.pl, + interfaces/Prolog/GNU/gnu_prolog_generated_test.pl, + interfaces/Prolog/GNU/gp_clpq.pl, + interfaces/Prolog/GNU/gprolog_cfli.hh, + interfaces/Prolog/GNU/gprolog_efli.cc, + interfaces/Prolog/GNU/gprolog_efli.hh, + interfaces/Prolog/GNU/ppl_interface_generator_gprolog_pl.m4, + interfaces/Prolog/GNU/ppl_prolog_sysdep.hh, + interfaces/Prolog/Makefile.am, + interfaces/Prolog/Prolog_configured_interface.dox, + interfaces/Prolog/Prolog_interface.dox, + interfaces/Prolog/Prolog_interface_compilation.dox, + interfaces/Prolog/Prolog_interface_sysdep.dox, + interfaces/Prolog/Prolog_interface_sysindep.dox, + interfaces/Prolog/Prolog_interface_sysindep_domains.dox, + interfaces/Prolog/SICStus/Makefile.am, + interfaces/Prolog/SICStus/ppl_interface_generator_sicstus_sd_cc.m4, + interfaces/Prolog/SICStus/ppl_prolog_sysdep.hh, + interfaces/Prolog/SICStus/ppl_sicstus.pl, + interfaces/Prolog/SICStus/sicstus_cfli.cc, + interfaces/Prolog/SICStus/sicstus_cfli.h, + interfaces/Prolog/SICStus/sicstus_cfli.ic, + interfaces/Prolog/SICStus/sicstus_efli.cc, + interfaces/Prolog/SICStus/sicstus_efli.hh, + interfaces/Prolog/SICStus/sp_clpq.pl, + interfaces/Prolog/SICStus/sp_pl_check.pl, + interfaces/Prolog/SICStus/sp_prolog_generated_test.pl, + interfaces/Prolog/SWI/Makefile.am, + interfaces/Prolog/SWI/README.swiprolog, + interfaces/Prolog/SWI/pl_clpq.cc, interfaces/Prolog/SWI/pl_clpq.pl, + interfaces/Prolog/SWI/ppl_interface_generator_swiprolog_cc.m4, + interfaces/Prolog/SWI/ppl_pl.cc, + interfaces/Prolog/SWI/ppl_prolog_sysdep.hh, + interfaces/Prolog/SWI/ppl_swiprolog.pl, + interfaces/Prolog/SWI/swi_cfli.hh, + interfaces/Prolog/SWI/swi_efli.cc, + interfaces/Prolog/SWI/swi_efli.hh, + interfaces/Prolog/SWI/swi_pl_check.pl, + interfaces/Prolog/SWI/swi_prolog_generated_test.pl, + interfaces/Prolog/XSB/Makefile.am, + interfaces/Prolog/XSB/ppl_interface_generator_xsb_H.m4, + interfaces/Prolog/XSB/ppl_interface_generator_xsb_cc.m4, + interfaces/Prolog/XSB/ppl_interface_generator_xsb_hh.m4, + interfaces/Prolog/XSB/ppl_interface_generator_xsb_prolog_generated_ + test_P.m4, interfaces/Prolog/XSB/ppl_prolog_sysdep.hh, + interfaces/Prolog/XSB/xsb_cfli.hh, + interfaces/Prolog/XSB/xsb_clpq.P, + interfaces/Prolog/XSB/xsb_clpq2.P, + interfaces/Prolog/XSB/xsb_efli.cc, + interfaces/Prolog/XSB/xsb_efli.hh, + interfaces/Prolog/XSB/xsb_pl_check.P, + interfaces/Prolog/YAP/Makefile.am, + interfaces/Prolog/YAP/README.yap, + interfaces/Prolog/YAP/ppl_interface_generator_yap_cc.m4, + interfaces/Prolog/YAP/ppl_prolog_sysdep.hh, + interfaces/Prolog/YAP/ppl_yap.pl, + interfaces/Prolog/YAP/yap_cfli.hh, + interfaces/Prolog/YAP/yap_clpq.pl, + interfaces/Prolog/YAP/yap_clpq2.pl, + interfaces/Prolog/YAP/yap_efli.cc, + interfaces/Prolog/YAP/yap_efli.hh, + interfaces/Prolog/YAP/yap_pl_check.pl, + interfaces/Prolog/YAP/yap_prolog_generated_test.pl, + interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4, + interfaces/Prolog/ppl_interface_generator_prolog_cc_files.m4, + interfaces/Prolog/ppl_interface_generator_prolog_dox.m4, + interfaces/Prolog/ppl_interface_generator_prolog_dox_code.m4, + interfaces/Prolog/ppl_interface_generator_prolog_hh_code.m4, + interfaces/Prolog/ppl_interface_generator_prolog_hh_files.m4, + interfaces/Prolog/ppl_interface_generator_prolog_procedure_generato + rs.m4, interfaces/Prolog/ppl_interface_generator_prolog_systems.m4, + interfaces/Prolog/ppl_prolog_common.cc, + interfaces/Prolog/ppl_prolog_common_defs.hh, + interfaces/Prolog/ppl_prolog_common_inlines.hh, + interfaces/Prolog/tests/Makefile.am, + interfaces/Prolog/tests/clpq.pl, interfaces/Prolog/tests/clpq2.pl, + interfaces/Prolog/tests/expected_clpq2_int16, + interfaces/Prolog/tests/expected_clpq2_int16_a, + interfaces/Prolog/tests/expected_clpq2_int32, + interfaces/Prolog/tests/expected_clpq2_int32_a, + interfaces/Prolog/tests/expected_clpq2_int64, + interfaces/Prolog/tests/expected_clpq2_int64_a, + interfaces/Prolog/tests/expected_clpq2_int8, + interfaces/Prolog/tests/expected_clpq2_int8_a, + interfaces/Prolog/tests/expected_clpq2_mpz, + interfaces/Prolog/tests/expected_clpq2_mpz_a, + interfaces/Prolog/tests/expected_clpq_int16, + interfaces/Prolog/tests/expected_clpq_int16_a, + interfaces/Prolog/tests/expected_clpq_int32, + interfaces/Prolog/tests/expected_clpq_int32_a, + interfaces/Prolog/tests/expected_clpq_int64, + interfaces/Prolog/tests/expected_clpq_int64_a, + interfaces/Prolog/tests/expected_clpq_int8, + interfaces/Prolog/tests/expected_clpq_int8_a, + interfaces/Prolog/tests/expected_clpq_mpz, + interfaces/Prolog/tests/expected_clpq_mpz_a, + interfaces/Prolog/tests/pl_check.pl, + interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_te + st_pl.m4, + interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_te + st_pl_code.m4, + interfaces/Prolog/tests/ppl_prolog_generated_test_common.pl, + interfaces/Python/ppl_py.cc, interfaces/Python/ppl_py.py, + interfaces/interfaced_boxes.hh, interfaces/marked_pointers.hh, + interfaces/ppl_interface_generator_common.m4, + interfaces/ppl_interface_generator_common_dat.m4, + interfaces/ppl_interface_generator_common_procedure_generators.m4, + interfaces/ppl_interface_generator_copyright, m4/Makefile.am, + m4/ac_check_ciao.m4, m4/ac_check_fpu_control.m4, + m4/ac_check_gmp.m4, m4/ac_check_sicstus_prolog.m4, + m4/ac_check_swi_prolog.m4, m4/ac_check_xsb_prolog.m4, + m4/ac_check_yap.m4, m4/ac_cxx_attribute_weak.m4, + m4/ac_cxx_double_binary_format.m4, + m4/ac_cxx_float_binary_format.m4, m4/ac_cxx_ieee_inexact_flag.m4, + m4/ac_cxx_limit_memory.m4, m4/ac_cxx_long_double_binary_format.m4, + m4/ac_cxx_plain_char_is_signed.m4, m4/ac_cxx_proper_long_double.m4, + m4/ac_cxx_zero_length_arrays.m4, m4/ac_prog_jar.m4, + m4/ac_prog_java.m4, m4/ac_prog_javac.m4, m4/ac_prog_javah.m4, + m4/ac_text_md5sum.m4, m4/ppl.m4, m4/ppl_c.m4, src/Affine_Space.cc, + src/Affine_Space_defs.hh, src/Affine_Space_inlines.hh, + src/Affine_Space_types.hh, src/Any_Pointset_defs.hh, + src/Any_Pointset_inlines.hh, src/Any_Pointset_types.hh, + src/Ask_Tell_defs.hh, src/Ask_Tell_inlines.hh, + src/Ask_Tell_templates.hh, src/Ask_Tell_types.hh, + src/BDS_Status_idefs.hh, src/BDS_Status_inlines.hh, + src/BD_Shape.cc, src/BD_Shape_defs.hh, src/BD_Shape_inlines.hh, + src/BD_Shape_templates.hh, src/BD_Shape_types.hh, + src/BHRZ03_Certificate.cc, src/BHRZ03_Certificate_defs.hh, + src/BHRZ03_Certificate_inlines.hh, src/BHRZ03_Certificate_types.hh, + src/Bit_Matrix.cc, src/Bit_Matrix_defs.hh, + src/Bit_Matrix_inlines.hh, src/Bit_Matrix_types.hh, src/Bit_Row.cc, + src/Bit_Row_defs.hh, src/Bit_Row_inlines.hh, src/Bit_Row_types.hh, + src/Boundary_defs.hh, src/Box.cc, src/Box_Status_idefs.hh, + src/Box_Status_inlines.hh, src/Box_defs.hh, src/Box_inlines.hh, + src/Box_templates.hh, src/Box_types.hh, src/CO_Tree.cc, + src/CO_Tree_defs.hh, src/CO_Tree_inlines.hh, + src/CO_Tree_templates.hh, src/CO_Tree_types.hh, src/C_Integer.hh, + src/C_Polyhedron.cc, src/C_Polyhedron_defs.hh, + src/C_Polyhedron_inlines.hh, src/C_Polyhedron_types.hh, + src/Cast_Floating_Point_Expression_defs.hh, + src/Cast_Floating_Point_Expression_inlines.hh, + src/Cast_Floating_Point_Expression_templates.hh, + src/Cast_Floating_Point_Expression_types.hh, src/Checked_Number.cc, + src/Checked_Number_defs.hh, src/Checked_Number_inlines.hh, + src/Checked_Number_templates.hh, src/Checked_Number_types.hh, + src/Coefficient.cc, src/Coefficient_defs.hh, + src/Coefficient_inlines.hh, src/Coefficient_traits_template.hh, + src/Coefficient_types.hh, src/Concrete_Expression.cc, + src/Concrete_Expression_defs.hh, + src/Concrete_Expression_inlines.hh, + src/Concrete_Expression_types.hh, src/Congruence.cc, + src/Congruence_System.cc, src/Congruence_System_defs.hh, + src/Congruence_System_inlines.hh, src/Congruence_System_types.hh, + src/Congruence_defs.hh, src/Congruence_inlines.hh, + src/Congruence_types.hh, + src/Constant_Floating_Point_Expression_defs.hh, + src/Constant_Floating_Point_Expression_inlines.hh, + src/Constant_Floating_Point_Expression_types.hh, src/Constraint.cc, + src/Constraint_System.cc, src/Constraint_System_defs.hh, + src/Constraint_System_inlines.hh, src/Constraint_System_types.hh, + src/Constraint_defs.hh, src/Constraint_inlines.hh, + src/Constraint_types.hh, src/DB_Matrix_defs.hh, + src/DB_Matrix_inlines.hh, src/DB_Matrix_templates.hh, + src/DB_Matrix_types.hh, src/DB_Row_defs.hh, src/DB_Row_inlines.hh, + src/DB_Row_templates.hh, src/DB_Row_types.hh, src/Dense_Row.cc, + src/Dense_Row_defs.hh, src/Dense_Row_inlines.hh, + src/Dense_Row_templates.hh, src/Dense_Row_types.hh, + src/Determinate_defs.hh, src/Determinate_inlines.hh, + src/Determinate_types.hh, + src/Difference_Floating_Point_Expression_defs.hh, + src/Difference_Floating_Point_Expression_inlines.hh, + src/Difference_Floating_Point_Expression_templates.hh, + src/Difference_Floating_Point_Expression_types.hh, + src/Division_Floating_Point_Expression_defs.hh, + src/Division_Floating_Point_Expression_inlines.hh, + src/Division_Floating_Point_Expression_templates.hh, + src/Division_Floating_Point_Expression_types.hh, + src/Doubly_Linked_Object_defs.hh, + src/Doubly_Linked_Object_inlines.hh, + src/Doubly_Linked_Object_types.hh, src/EList_Iterator_defs.hh, + src/EList_Iterator_inlines.hh, src/EList_Iterator_types.hh, + src/EList_defs.hh, src/EList_inlines.hh, src/EList_types.hh, + src/Expression_Adapter_defs.hh, src/Expression_Adapter_inlines.hh, + src/Expression_Adapter_types.hh, + src/Expression_Hide_Inhomo_defs.hh, + src/Expression_Hide_Inhomo_inlines.hh, + src/Expression_Hide_Inhomo_types.hh, + src/Expression_Hide_Last_defs.hh, + src/Expression_Hide_Last_inlines.hh, + src/Expression_Hide_Last_types.hh, src/Float.cc, src/Float_defs.hh, + src/Float_inlines.hh, src/Float_templates.hh, + src/Floating_Point_Expression_defs.hh, + src/Floating_Point_Expression_inlines.hh, + src/Floating_Point_Expression_templates.hh, + src/Floating_Point_Expression_types.hh, src/GMP_Integer_defs.hh, + src/GMP_Integer_inlines.hh, src/GMP_Integer_types.hh, + src/Generator.cc, src/Generator_System.cc, + src/Generator_System_defs.hh, src/Generator_System_inlines.hh, + src/Generator_System_types.hh, src/Generator_defs.hh, + src/Generator_inlines.hh, src/Generator_types.hh, + src/Grid_Certificate.cc, src/Grid_Certificate_defs.hh, + src/Grid_Certificate_inlines.hh, src/Grid_Certificate_types.hh, + src/Grid_Generator.cc, src/Grid_Generator_System.cc, + src/Grid_Generator_System_defs.hh, + src/Grid_Generator_System_inlines.hh, + src/Grid_Generator_System_types.hh, src/Grid_Generator_defs.hh, + src/Grid_Generator_inlines.hh, src/Grid_Generator_types.hh, + src/Grid_Status.cc, src/Grid_Status_idefs.hh, + src/Grid_Status_inlines.hh, src/Grid_chdims.cc, + src/Grid_conversion.cc, src/Grid_defs.hh, src/Grid_inlines.hh, + src/Grid_nonpublic.cc, src/Grid_public.cc, src/Grid_simplify.cc, + src/Grid_templates.hh, src/Grid_types.hh, src/Grid_widenings.cc, + src/H79_Certificate.cc, src/H79_Certificate_defs.hh, + src/H79_Certificate_inlines.hh, src/H79_Certificate_types.hh, + src/Handler_defs.hh, src/Handler_inlines.hh, src/Handler_types.hh, + src/Has_Assign_Or_Swap.hh, src/Init.cc, src/Init_defs.hh, + src/Init_inlines.hh, src/Init_types.hh, src/Integer_Interval.hh, + src/Interval_Info_defs.hh, src/Interval_Info_inlines.hh, + src/Interval_Info_types.hh, src/Interval_defs.hh, + src/Interval_inlines.hh, src/Interval_templates.hh, + src/Interval_types.hh, src/Linear_Expression.cc, + src/Linear_Expression_Impl.cc, src/Linear_Expression_Impl_defs.hh, + src/Linear_Expression_Impl_inlines.hh, + src/Linear_Expression_Impl_templates.hh, + src/Linear_Expression_Impl_types.hh, + src/Linear_Expression_Interface.cc, + src/Linear_Expression_Interface_defs.hh, + src/Linear_Expression_Interface_types.hh, + src/Linear_Expression_defs.hh, src/Linear_Expression_inlines.hh, + src/Linear_Expression_types.hh, src/Linear_Form.cc, + src/Linear_Form_defs.hh, src/Linear_Form_inlines.hh, + src/Linear_Form_templates.hh, src/Linear_Form_types.hh, + src/Linear_System_defs.hh, src/Linear_System_inlines.hh, + src/Linear_System_templates.hh, src/Linear_System_types.hh, + src/MIP_Problem.cc, src/MIP_Problem_defs.hh, + src/MIP_Problem_inlines.hh, src/MIP_Problem_templates.hh, + src/MIP_Problem_types.hh, src/Makefile.am, src/Matrix_defs.hh, + src/Matrix_inlines.hh, src/Matrix_templates.hh, + src/Matrix_types.hh, + src/Multiplication_Floating_Point_Expression_defs.hh, + src/Multiplication_Floating_Point_Expression_inlines.hh, + src/Multiplication_Floating_Point_Expression_templates.hh, + src/Multiplication_Floating_Point_Expression_types.hh, + src/NNC_Polyhedron.cc, src/NNC_Polyhedron_defs.hh, + src/NNC_Polyhedron_inlines.hh, src/NNC_Polyhedron_types.hh, + src/Numeric_Format_defs.hh, src/OR_Matrix_defs.hh, + src/OR_Matrix_inlines.hh, src/OR_Matrix_templates.hh, + src/OR_Matrix_types.hh, src/Octagonal_Shape.cc, + src/Octagonal_Shape_defs.hh, src/Octagonal_Shape_inlines.hh, + src/Octagonal_Shape_templates.hh, src/Octagonal_Shape_types.hh, + src/Og_Status_idefs.hh, src/Og_Status_inlines.hh, + src/Opposite_Floating_Point_Expression_defs.hh, + src/Opposite_Floating_Point_Expression_inlines.hh, + src/Opposite_Floating_Point_Expression_types.hh, + src/PIP_Problem.cc, src/PIP_Problem_defs.hh, + src/PIP_Problem_inlines.hh, src/PIP_Problem_templates.hh, + src/PIP_Problem_types.hh, src/PIP_Tree.cc, src/PIP_Tree_defs.hh, + src/PIP_Tree_inlines.hh, src/PIP_Tree_types.hh, + src/Partial_Function.cc, src/Partial_Function_defs.hh, + src/Partial_Function_inlines.hh, src/Partial_Function_types.hh, + src/Partially_Reduced_Product_defs.hh, + src/Partially_Reduced_Product_inlines.hh, + src/Partially_Reduced_Product_templates.hh, + src/Partially_Reduced_Product_types.hh, + src/Pending_Element_defs.hh, src/Pending_Element_inlines.hh, + src/Pending_Element_types.hh, src/Pending_List_defs.hh, + src/Pending_List_inlines.hh, src/Pending_List_templates.hh, + src/Pending_List_types.hh, src/Ph_Status.cc, + src/Ph_Status_idefs.hh, src/Ph_Status_inlines.hh, + src/Pointset_Ask_Tell.cc, src/Pointset_Ask_Tell_defs.hh, + src/Pointset_Ask_Tell_inlines.hh, + src/Pointset_Ask_Tell_templates.hh, src/Pointset_Ask_Tell_types.hh, + src/Pointset_Powerset.cc, src/Pointset_Powerset_defs.hh, + src/Pointset_Powerset_inlines.hh, + src/Pointset_Powerset_templates.hh, src/Pointset_Powerset_types.hh, + src/Poly_Con_Relation.cc, src/Poly_Con_Relation_defs.hh, + src/Poly_Con_Relation_inlines.hh, src/Poly_Con_Relation_types.hh, + src/Poly_Gen_Relation.cc, src/Poly_Gen_Relation_defs.hh, + src/Poly_Gen_Relation_inlines.hh, src/Poly_Gen_Relation_types.hh, + src/Polyhedron_chdims.cc, src/Polyhedron_chdims_templates.hh, + src/Polyhedron_conversion_templates.hh, src/Polyhedron_defs.hh, + src/Polyhedron_inlines.hh, src/Polyhedron_minimize_templates.hh, + src/Polyhedron_nonpublic.cc, src/Polyhedron_public.cc, + src/Polyhedron_simplify_templates.hh, src/Polyhedron_templates.hh, + src/Polyhedron_types.hh, src/Polyhedron_widenings.cc, + src/Powerset_defs.hh, src/Powerset_inlines.hh, + src/Powerset_templates.hh, src/Powerset_types.hh, + src/Ptr_Iterator_defs.hh, src/Ptr_Iterator_inlines.hh, + src/Ptr_Iterator_types.hh, src/Rational_Box.hh, + src/Rational_Interval.hh, src/Result_defs.hh, + src/Result_inlines.hh, src/Rounding_Dir_defs.hh, + src/Rounding_Dir_inlines.hh, src/Scalar_Products.cc, + src/Scalar_Products_defs.hh, src/Scalar_Products_inlines.hh, + src/Scalar_Products_types.hh, src/Slow_Copy.hh, src/Sparse_Row.cc, + src/Sparse_Row_defs.hh, src/Sparse_Row_inlines.hh, + src/Sparse_Row_templates.hh, src/Sparse_Row_types.hh, + src/Sum_Floating_Point_Expression_defs.hh, + src/Sum_Floating_Point_Expression_inlines.hh, + src/Sum_Floating_Point_Expression_templates.hh, + src/Sum_Floating_Point_Expression_types.hh, + src/Swapping_Vector_defs.hh, src/Swapping_Vector_inlines.hh, + src/Swapping_Vector_types.hh, src/Temp_defs.hh, + src/Temp_inlines.hh, src/Temp_templates.hh, + src/Threshold_Watcher.cc, src/Threshold_Watcher_defs.hh, + src/Threshold_Watcher_inlines.hh, + src/Threshold_Watcher_templates.hh, src/Threshold_Watcher_types.hh, + src/Time.cc, src/Time_defs.hh, src/Time_inlines.hh, + src/Time_types.hh, src/Topology_types.hh, src/Variable.cc, + src/Variable_Floating_Point_Expression_defs.hh, + src/Variable_Floating_Point_Expression_inlines.hh, + src/Variable_Floating_Point_Expression_types.hh, + src/Variable_defs.hh, src/Variable_inlines.hh, + src/Variable_types.hh, src/Variables_Set.cc, + src/Variables_Set_defs.hh, src/Variables_Set_inlines.hh, + src/Variables_Set_types.hh, src/WRD_coefficient_types_defs.hh, + src/WRD_coefficient_types_inlines.hh, src/Watchdog.cc, + src/Watchdog_defs.hh, src/Watchdog_inlines.hh, + src/Watchdog_types.hh, src/Weight_Profiler.cc, + src/Weight_Profiler_defs.hh, src/Widening_Function_defs.hh, + src/Widening_Function_inlines.hh, src/Widening_Function_types.hh, + src/algorithms.hh, src/assert.cc, src/assert.hh, + src/assign_or_swap.hh, src/c_streambuf.cc, src/c_streambuf_defs.hh, + src/c_streambuf_inlines.hh, src/c_streambuf_types.hh, + src/checked.cc, src/checked_defs.hh, src/checked_ext_defs.hh, + src/checked_ext_inlines.hh, src/checked_float_inlines.hh, + src/checked_inlines.hh, src/checked_int_inlines.hh, + src/checked_mpq_inlines.hh, src/checked_mpz_inlines.hh, + src/checked_numeric_limits.hh, src/compiler.hh, + src/distances_defs.hh, src/distances_inlines.hh, + src/distances_types.hh, src/fpu-c99_inlines.hh, src/fpu-ia32.cc, + src/fpu-ia32_inlines.hh, src/fpu-none_inlines.hh, + src/fpu-sparc_inlines.hh, src/fpu_defs.hh, src/fpu_types.hh, + src/globals.cc, src/globals_defs.hh, src/globals_inlines.hh, + src/globals_types.hh, src/initializer.hh, src/intervals_defs.hh, + src/iterator_to_const_defs.hh, src/iterator_to_const_inlines.hh, + src/iterator_to_const_types.hh, src/linearize.hh, + src/math_utilities_defs.hh, src/math_utilities_inlines.hh, + src/max_space_dimension.hh, src/meta_programming.hh, + src/mp_std_bits.cc, src/mp_std_bits_defs.hh, + src/mp_std_bits_inlines.hh, src/namespaces.hh, + src/ppl-config.cc.in, src/ppl_header.hh, src/stdiobuf.cc, + src/stdiobuf_defs.hh, src/stdiobuf_inlines.hh, + src/stdiobuf_types.hh, src/swapping_sort_templates.hh, + src/termination.cc, src/termination_defs.hh, + src/termination_templates.hh, src/termination_types.hh, + src/version.cc, src/version.hh.in, src/wrap_assign.hh, + src/wrap_string.cc, src/wrap_string.hh, tests/Ask_Tell/Makefile.am, + tests/Ask_Tell/append1.cc, tests/BD_Shape/Makefile.am, + tests/BD_Shape/addconstraints1.cc, tests/BD_Shape/addspacedims1.cc, + tests/BD_Shape/affinedimension1.cc, tests/BD_Shape/affineimage1.cc, + tests/BD_Shape/affineimage2.cc, tests/BD_Shape/affinepreimage1.cc, + tests/BD_Shape/ascii_dump_load1.cc, + tests/BD_Shape/bgp99extrapolation1.cc, + tests/BD_Shape/bhmz05widening1.cc, + tests/BD_Shape/bhz03widening1.cc, tests/BD_Shape/bounded1.cc, + tests/BD_Shape/boundedaffineimage1.cc, + tests/BD_Shape/boundedaffinepreimage1.cc, + tests/BD_Shape/bounds1.cc, tests/BD_Shape/cc76extrapolation1.cc, + tests/BD_Shape/cc76narrowing1.cc, tests/BD_Shape/closure1.cc, + tests/BD_Shape/concatenate1.cc, tests/BD_Shape/congruences1.cc, + tests/BD_Shape/constrains1.cc, tests/BD_Shape/constraints1.cc, + tests/BD_Shape/contains1.cc, + tests/BD_Shape/containsintegerpoint1.cc, + tests/BD_Shape/difference1.cc, tests/BD_Shape/discrete1.cc, + tests/BD_Shape/disjoint1.cc, + tests/BD_Shape/dropsomenonintegerpoints1.cc, + tests/BD_Shape/empty1.cc, tests/BD_Shape/equality1.cc, + tests/BD_Shape/expandspacedim1.cc, + tests/BD_Shape/foldspacedims1.cc, tests/BD_Shape/frequency1.cc, + tests/BD_Shape/frombdshape1.cc, tests/BD_Shape/frombox1.cc, + tests/BD_Shape/fromgensys1.cc, tests/BD_Shape/fromgrid1.cc, + tests/BD_Shape/fromoctagonalshape1.cc, + tests/BD_Shape/frompolyhedron1.cc, tests/BD_Shape/fromspacedim1.cc, + tests/BD_Shape/generalizedaffineimage1.cc, + tests/BD_Shape/generalizedaffineimage2.cc, + tests/BD_Shape/generalizedaffinepreimage1.cc, + tests/BD_Shape/generalizedaffinepreimage2.cc, + tests/BD_Shape/generalizedaffinepreimage3.cc, + tests/BD_Shape/geomcovers1.cc, tests/BD_Shape/h79widening1.cc, + tests/BD_Shape/integerupperboundifexact1.cc, + tests/BD_Shape/intersection1.cc, + tests/BD_Shape/limitedbhmz05extrapolation1.cc, + tests/BD_Shape/limitedcc76extrapolation1.cc, + tests/BD_Shape/limitedh79extrapolation1.cc, + tests/BD_Shape/mapspacedims1.cc, tests/BD_Shape/max_min1.cc, + tests/BD_Shape/max_min2.cc, tests/BD_Shape/maxspacedim1.cc, + tests/BD_Shape/membytes1.cc, tests/BD_Shape/minconstraints1.cc, + tests/BD_Shape/relations1.cc, tests/BD_Shape/relations2.cc, + tests/BD_Shape/relations3.cc, tests/BD_Shape/relations4.cc, + tests/BD_Shape/removespacedims1.cc, tests/BD_Shape/run_tests, + tests/BD_Shape/simplifyusingcontext1.cc, + tests/BD_Shape/timeelapse1.cc, tests/BD_Shape/unconstrain1.cc, + tests/BD_Shape/universe1.cc, tests/BD_Shape/upperbound1.cc, + tests/BD_Shape/upperboundifexact1.cc, tests/BD_Shape/wrap1.cc, + tests/BD_Shape/writebdshape1.cc, tests/Box/Makefile.am, + tests/Box/addconstraints1.cc, tests/Box/addspacedims1.cc, + tests/Box/affinedimension1.cc, tests/Box/affineimage1.cc, + tests/Box/affinepreimage1.cc, tests/Box/ascii_dump_load1.cc, + tests/Box/bgp99extrapolation1.cc, tests/Box/bhz03widening1.cc, + tests/Box/bounded1.cc, tests/Box/boundedaffineimage1.cc, + tests/Box/boundedaffinepreimage1.cc, tests/Box/cc76narrowing1.cc, + tests/Box/cc76widening.cc, tests/Box/concatenate1.cc, + tests/Box/congruences1.cc, tests/Box/constrains1.cc, + tests/Box/constraints1.cc, tests/Box/contains1.cc, + tests/Box/containsintegerpoint1.cc, tests/Box/difference1.cc, + tests/Box/discrete1.cc, tests/Box/disjoint1.cc, + tests/Box/empty1.cc, tests/Box/equality1.cc, + tests/Box/expandspacedim1.cc, tests/Box/foldspacedims1.cc, + tests/Box/frequency1.cc, tests/Box/frombdshape1.cc, + tests/Box/frombox1.cc, tests/Box/fromgensys1.cc, + tests/Box/fromgrid1.cc, tests/Box/frompartiallyreducedproduct1.cc, + tests/Box/frompolyhedron1.cc, tests/Box/frompolyhedron2.cc, + tests/Box/fromspacedim1.cc, tests/Box/generalizedaffineimage1.cc, + tests/Box/generalizedaffineimage2.cc, + tests/Box/generalizedaffinepreimage1.cc, tests/Box/geomcovers1.cc, + tests/Box/intersection1.cc, tests/Box/interval1.cc, + tests/Box/limitedcc76extrapolation1.cc, tests/Box/mapspacedims1.cc, + tests/Box/max_min1.cc, tests/Box/maxspacedim1.cc, + tests/Box/membytes1.cc, tests/Box/minconstraints1.cc, + tests/Box/propagateconstraints1.cc, + tests/Box/propagateconstraints2.cc, + tests/Box/refinewithcongruence1.cc, + tests/Box/refinewithcongruences1.cc, + tests/Box/refinewithconstraint1.cc, + tests/Box/refinewithconstraint2.cc, + tests/Box/refinewithconstraints1.cc, + tests/Box/refinewithconstraints2.cc, tests/Box/relations1.cc, + tests/Box/relations2.cc, tests/Box/relations3.cc, + tests/Box/relations4.cc, tests/Box/removespacedims1.cc, + tests/Box/run_tests, tests/Box/simplifyusingcontext1.cc, + tests/Box/timeelapse1.cc, tests/Box/topclosed1.cc, + tests/Box/unconstrain1.cc, tests/Box/universe1.cc, + tests/Box/upperbound1.cc, tests/Box/upperboundifexact1.cc, + tests/Box/wrap1.cc, tests/Box/writebox1.cc, + tests/CO_Tree/Makefile.am, tests/CO_Tree/cotree1.cc, + tests/Concrete_Expression/C_Expr.cc, + tests/Concrete_Expression/C_Expr_defs.hh, + tests/Concrete_Expression/C_Expr_inlines.hh, + tests/Concrete_Expression/C_Expr_types.hh, + tests/Concrete_Expression/Makefile.am, + tests/Concrete_Expression/bdshape1.cc, + tests/Concrete_Expression/bdshape2.cc, + tests/Concrete_Expression/digitalfilters1.cc, + tests/Concrete_Expression/linearform1.cc, + tests/Concrete_Expression/linearize.cc, + tests/Concrete_Expression/octagonalshape1.cc, + tests/Concrete_Expression/octagonalshape2.cc, + tests/Concrete_Expression/polyhedron1.cc, + tests/Concrete_Expression/polyhedron2.cc, + tests/Concrete_Expression/run_tests, tests/Grid/Makefile.am, + tests/Grid/addcongruence1.cc, tests/Grid/addcongruences1.cc, + tests/Grid/addconstraint1.cc, tests/Grid/addconstraints1.cc, + tests/Grid/addgenerator1.cc, tests/Grid/addgenerators1.cc, + tests/Grid/addspacedims1.cc, tests/Grid/affinedim1.cc, + tests/Grid/affineimage1.cc, tests/Grid/affineimage2.cc, + tests/Grid/affinepreimage1.cc, tests/Grid/affinepreimage2.cc, + tests/Grid/approximatepartition1.cc, tests/Grid/asciidumpload1.cc, + tests/Grid/asciidumpload2.cc, tests/Grid/asciidumpload3.cc, + tests/Grid/asciidumpload4.cc, tests/Grid/asciidumpload5.cc, + tests/Grid/asciidumpload6.cc, tests/Grid/bhz03widening1.cc, + tests/Grid/bounded1.cc, tests/Grid/boundedaffineimage1.cc, + tests/Grid/boundedaffinepreimage1.cc, tests/Grid/boundingbox1.cc, + tests/Grid/bounds1.cc, tests/Grid/certificate1.cc, + tests/Grid/concatenate1.cc, tests/Grid/congruence1.cc, + tests/Grid/congruences1.cc, tests/Grid/congruences2.cc, + tests/Grid/constraints1.cc, tests/Grid/contains1.cc, + tests/Grid/containsintegerpoint1.cc, tests/Grid/discrete1.cc, + tests/Grid/disjoint1.cc, tests/Grid/dropnonintegerpoints1.cc, + tests/Grid/equals1.cc, tests/Grid/expandspacedim1.cc, + tests/Grid/foldspacedims1.cc, tests/Grid/frequency1.cc, + tests/Grid/frombdshape1.cc, tests/Grid/frombox1.cc, + tests/Grid/fromgrid1.cc, tests/Grid/fromoctagonalshape1.cc, + tests/Grid/frompolyhedron1.cc, + tests/Grid/generalizedaffineimage1.cc, + tests/Grid/generalizedaffineimage2.cc, + tests/Grid/generalizedaffineimage3.cc, + tests/Grid/generalizedaffinepreimage1.cc, + tests/Grid/generalizedaffinepreimage2.cc, + tests/Grid/generalizedaffinepreimage3.cc, tests/Grid/generator1.cc, + tests/Grid/generators1.cc, tests/Grid/generators2.cc, + tests/Grid/grid1.cc, tests/Grid/grid2.cc, tests/Grid/grid3.cc, + tests/Grid/griddifference1.cc, tests/Grid/intersection1.cc, + tests/Grid/isempty1.cc, tests/Grid/isuniverse1.cc, + tests/Grid/limitedextrapolation1.cc, + tests/Grid/limitedextrapolation2.cc, + tests/Grid/limitedextrapolation3.cc, tests/Grid/mapspacedims1.cc, + tests/Grid/maxmin1.cc, tests/Grid/membytes1.cc, + tests/Grid/mincongruences1.cc, tests/Grid/mingenerators1.cc, + tests/Grid/outputoperator1.cc, tests/Grid/outputoperator2.cc, + tests/Grid/outputoperator3.cc, tests/Grid/partition1.cc, + tests/Grid/powersetdifference1.cc, + tests/Grid/powersetgeometricallycovers1.cc, + tests/Grid/powersetgeometricallyequals1.cc, + tests/Grid/refinewithcongruences1.cc, + tests/Grid/refinewithconstraints1.cc, tests/Grid/relations1.cc, + tests/Grid/relations2.cc, tests/Grid/relations3.cc, + tests/Grid/removespacedims1.cc, tests/Grid/removespacedims2.cc, + tests/Grid/simplifyusingcontext1.cc, tests/Grid/timeelapse1.cc, + tests/Grid/topclosed1.cc, tests/Grid/topclosure1.cc, + tests/Grid/unconstrain1.cc, tests/Grid/upperbound1.cc, + tests/Grid/upperbound2.cc, tests/Grid/widening1.cc, + tests/Grid/widening2.cc, tests/Grid/widening3.cc, + tests/Grid/wrap1.cc, tests/Grid/writecongruencesystem.cc, + tests/MIP_Problem/Makefile.am, + tests/MIP_Problem/ascii_dump_load1.cc, + tests/MIP_Problem/exceptions1.cc, tests/MIP_Problem/mipproblem1.cc, + tests/MIP_Problem/mipproblem2.cc, tests/MIP_Problem/mipproblem3.cc, + tests/MIP_Problem/mipproblem4.cc, tests/Makefile.am, + tests/Octagonal_Shape/Makefile.am, + tests/Octagonal_Shape/addspacedims1.cc, + tests/Octagonal_Shape/affinedimension1.cc, + tests/Octagonal_Shape/affineimage1.cc, + tests/Octagonal_Shape/affineimage2.cc, + tests/Octagonal_Shape/affinepreimage1.cc, + tests/Octagonal_Shape/affinepreimage2.cc, + tests/Octagonal_Shape/ascii_dump_load1.cc, + tests/Octagonal_Shape/bhmz05widening1.cc, + tests/Octagonal_Shape/bhz03widening1.cc, + tests/Octagonal_Shape/bounded1.cc, + tests/Octagonal_Shape/boundedaffineimage1.cc, + tests/Octagonal_Shape/boundedaffinepreimage1.cc, + tests/Octagonal_Shape/bounds1.cc, + tests/Octagonal_Shape/cc76extrapolation1.cc, + tests/Octagonal_Shape/cc76narrowing1.cc, + tests/Octagonal_Shape/chinainit.cc, + tests/Octagonal_Shape/concatenate1.cc, + tests/Octagonal_Shape/congruences1.cc, + tests/Octagonal_Shape/constrains1.cc, + tests/Octagonal_Shape/constraints1.cc, + tests/Octagonal_Shape/contains1.cc, + tests/Octagonal_Shape/containsintegerpoint1.cc, + tests/Octagonal_Shape/difference1.cc, + tests/Octagonal_Shape/discrete1.cc, + tests/Octagonal_Shape/disjoint1.cc, + tests/Octagonal_Shape/dropsomenonintegerpoints1.cc, + tests/Octagonal_Shape/empty1.cc, + tests/Octagonal_Shape/expandspacedim1.cc, + tests/Octagonal_Shape/foldspacedims1.cc, + tests/Octagonal_Shape/frequency1.cc, + tests/Octagonal_Shape/frombdshape1.cc, + tests/Octagonal_Shape/frombox1.cc, + tests/Octagonal_Shape/fromgensys1.cc, + tests/Octagonal_Shape/fromgrid1.cc, + tests/Octagonal_Shape/fromoctagonalshape1.cc, + tests/Octagonal_Shape/frompolyhedron1.cc, + tests/Octagonal_Shape/fromspacedim1.cc, + tests/Octagonal_Shape/generalizedaffineimage1.cc, + tests/Octagonal_Shape/generalizedaffineimage2.cc, + tests/Octagonal_Shape/generalizedaffineimage3.cc, + tests/Octagonal_Shape/generalizedaffineimage4.cc, + tests/Octagonal_Shape/generalizedaffineimage5.cc, + tests/Octagonal_Shape/generalizedaffinepreimage1.cc, + tests/Octagonal_Shape/generalizedaffinepreimage2.cc, + tests/Octagonal_Shape/generalizedaffinepreimage3.cc, + tests/Octagonal_Shape/generalizedaffinepreimage4.cc, + tests/Octagonal_Shape/integerupperboundifexact1.cc, + tests/Octagonal_Shape/intersection1.cc, + tests/Octagonal_Shape/limitedbhmz05extrapolation1.cc, + tests/Octagonal_Shape/limitedcc76extrapolation1.cc, + tests/Octagonal_Shape/mapspacedims1.cc, + tests/Octagonal_Shape/max_min1.cc, + tests/Octagonal_Shape/max_min2.cc, + tests/Octagonal_Shape/maxspacedim1.cc, + tests/Octagonal_Shape/membytes1.cc, + tests/Octagonal_Shape/minconstraints1.cc, + tests/Octagonal_Shape/relatwithcons1.cc, + tests/Octagonal_Shape/relatwithcons2.cc, + tests/Octagonal_Shape/relatwithcons3.cc, + tests/Octagonal_Shape/relatwithgen1.cc, + tests/Octagonal_Shape/removespacedims1.cc, + tests/Octagonal_Shape/run_tests, + tests/Octagonal_Shape/simplifyusingcontext1.cc, + tests/Octagonal_Shape/timeelapse1.cc, + tests/Octagonal_Shape/unconstrain1.cc, + tests/Octagonal_Shape/universe1.cc, + tests/Octagonal_Shape/upperbound1.cc, + tests/Octagonal_Shape/upperboundifexact1.cc, + tests/Octagonal_Shape/wrap1.cc, + tests/Octagonal_Shape/writeoctagon1.cc, + tests/PIP_Problem/Makefile.am, + tests/PIP_Problem/ascii_dump_load1.cc, + tests/PIP_Problem/exceptions1.cc, tests/PIP_Problem/pipproblem1.cc, + tests/PIP_Problem/pipproblem2.cc, tests/PIP_Problem/pipproblem3.cc, + tests/PIP_Problem/weightwatch1.cc, + tests/Partially_Reduced_Product/Makefile.am, + tests/Partially_Reduced_Product/addcongruences1.cc, + tests/Partially_Reduced_Product/addconstraints1.cc, + tests/Partially_Reduced_Product/affineimage1.cc, + tests/Partially_Reduced_Product/asciidumpload1.cc, + tests/Partially_Reduced_Product/bounded1.cc, + tests/Partially_Reduced_Product/boundedaffineimage1.cc, + tests/Partially_Reduced_Product/bounds1.cc, + tests/Partially_Reduced_Product/concatenate1.cc, + tests/Partially_Reduced_Product/congruences1.cc, + tests/Partially_Reduced_Product/congruencesproduct1.cc, + tests/Partially_Reduced_Product/constraints1.cc, + tests/Partially_Reduced_Product/constraintsproduct1.cc, + tests/Partially_Reduced_Product/contains1.cc, + tests/Partially_Reduced_Product/difference1.cc, + tests/Partially_Reduced_Product/dimension1.cc, + tests/Partially_Reduced_Product/directproduct1.cc, + tests/Partially_Reduced_Product/directproduct2.cc, + tests/Partially_Reduced_Product/directproduct3.cc, + tests/Partially_Reduced_Product/directproduct4.cc, + tests/Partially_Reduced_Product/directproduct5.cc, + tests/Partially_Reduced_Product/directproduct6.cc, + tests/Partially_Reduced_Product/discrete1.cc, + tests/Partially_Reduced_Product/disjoint1.cc, + tests/Partially_Reduced_Product/dropsomenonintegerpoints1.cc, + tests/Partially_Reduced_Product/equals1.cc, + tests/Partially_Reduced_Product/frombdshape1.cc, + tests/Partially_Reduced_Product/frombox1.cc, + tests/Partially_Reduced_Product/fromgrid1.cc, + tests/Partially_Reduced_Product/fromoctagonalshape1.cc, + tests/Partially_Reduced_Product/frompolyhedron1.cc, + tests/Partially_Reduced_Product/fromproduct1.cc, + tests/Partially_Reduced_Product/generalizedaffineimage1.cc, + tests/Partially_Reduced_Product/intersection1.cc, + tests/Partially_Reduced_Product/isempty1.cc, + tests/Partially_Reduced_Product/isuniverse1.cc, + tests/Partially_Reduced_Product/maxmin1.cc, + tests/Partially_Reduced_Product/partially_reduced_product_test.hh, + tests/Partially_Reduced_Product/partiallyreducedproduct1.cc, + tests/Partially_Reduced_Product/partiallyreducedproduct2.cc, + tests/Partially_Reduced_Product/partiallyreducedproduct3.cc, + tests/Partially_Reduced_Product/partiallyreducedproduct4.cc, + tests/Partially_Reduced_Product/refinewithcongruences1.cc, + tests/Partially_Reduced_Product/refinewithconstraints1.cc, + tests/Partially_Reduced_Product/relations1.cc, + tests/Partially_Reduced_Product/shapepreservingproduct1.cc, + tests/Partially_Reduced_Product/smashproduct1.cc, + tests/Partially_Reduced_Product/spacedims1.cc, + tests/Partially_Reduced_Product/timeelapse1.cc, + tests/Partially_Reduced_Product/topclosed1.cc, + tests/Partially_Reduced_Product/topclosure1.cc, + tests/Partially_Reduced_Product/upperbound1.cc, + tests/Partially_Reduced_Product/widening1.cc, + tests/Polyhedron/Makefile.am, tests/Polyhedron/addcongruence1.cc, + tests/Polyhedron/addcongruences1.cc, + tests/Polyhedron/addconstraint1.cc, + tests/Polyhedron/addconstraints1.cc, + tests/Polyhedron/addconstraints2.cc, + tests/Polyhedron/addgenerator1.cc, + tests/Polyhedron/addgenerator2.cc, + tests/Polyhedron/addgenerators1.cc, + tests/Polyhedron/addgenerators2.cc, + tests/Polyhedron/addspacedims1.cc, + tests/Polyhedron/addspacedims2.cc, + tests/Polyhedron/affineimage1.cc, tests/Polyhedron/affineimage2.cc, + tests/Polyhedron/affinepreimage1.cc, + tests/Polyhedron/affinetrans.cc, tests/Polyhedron/append1.cc, + tests/Polyhedron/append2.cc, tests/Polyhedron/ascii_dump_load1.cc, + tests/Polyhedron/ascii_dump_load2.cc, + tests/Polyhedron/ascii_dump_load3.cc, + tests/Polyhedron/bgp99extrapolation1.cc, + tests/Polyhedron/bgp99extrapolation2.cc, + tests/Polyhedron/bhrz03widening1.cc, + tests/Polyhedron/bhrz03widening2.cc, + tests/Polyhedron/bhrz03widening3.cc, + tests/Polyhedron/bhz03widening1.cc, tests/Polyhedron/bounded1.cc, + tests/Polyhedron/boundedaffineimage1.cc, + tests/Polyhedron/boundedaffinepreimage1.cc, + tests/Polyhedron/boundedbhrz03extrapolation1.cc, + tests/Polyhedron/boundedh79extrapolation1.cc, + tests/Polyhedron/bounds1.cc, tests/Polyhedron/cnncconversion1.cc, + tests/Polyhedron/concatenate1.cc, tests/Polyhedron/congruences1.cc, + tests/Polyhedron/constrains1.cc, tests/Polyhedron/constraints1.cc, + tests/Polyhedron/contains1.cc, tests/Polyhedron/contains2.cc, + tests/Polyhedron/containsintegerpoint1.cc, + tests/Polyhedron/disjoint1.cc, tests/Polyhedron/disjoint2.cc, + tests/Polyhedron/dropsomenonintegerpoints1.cc, + tests/Polyhedron/dropsomenonintegerpoints2.cc, + tests/Polyhedron/dualhypercubes.cc, tests/Polyhedron/empty1.cc, + tests/Polyhedron/equals1.cc, tests/Polyhedron/exceptions1.cc, + tests/Polyhedron/exceptions2.cc, tests/Polyhedron/exceptions3.cc, + tests/Polyhedron/expandspacedim1.cc, + tests/Polyhedron/expandspacedim2.cc, + tests/Polyhedron/foldspacedims1.cc, + tests/Polyhedron/foldspacedims2.cc, tests/Polyhedron/frequency1.cc, + tests/Polyhedron/frombdshape1.cc, tests/Polyhedron/frombox1.cc, + tests/Polyhedron/frombox2.cc, tests/Polyhedron/fromgrid1.cc, + tests/Polyhedron/fromoctagonalshape1.cc, + tests/Polyhedron/generalizedaffineimage1.cc, + tests/Polyhedron/generalizedaffineimage2.cc, + tests/Polyhedron/generalizedaffinepreimage1.cc, + tests/Polyhedron/generalizedaffinepreimage2.cc, + tests/Polyhedron/generators1.cc, tests/Polyhedron/geomcovers1.cc, + tests/Polyhedron/h79widening1.cc, tests/Polyhedron/h79widening2.cc, + tests/Polyhedron/hybrid.cc, tests/Polyhedron/intersection1.cc, + tests/Polyhedron/limitedbhrz03extrapolation1.cc, + tests/Polyhedron/limitedh79extrapolation1.cc, + tests/Polyhedron/linearexpression1.cc, + tests/Polyhedron/linearpartition1.cc, + tests/Polyhedron/linearsystem1.cc, + tests/Polyhedron/mapspacedims1.cc, tests/Polyhedron/matrix1.cc, + tests/Polyhedron/max_min1.cc, tests/Polyhedron/maxspacedim1.cc, + tests/Polyhedron/mc91.cc, tests/Polyhedron/membytes1.cc, + tests/Polyhedron/memory1.cc, tests/Polyhedron/memory2.cc, + tests/Polyhedron/minconstraints1.cc, + tests/Polyhedron/minconstraints2.cc, + tests/Polyhedron/mingenerators1.cc, + tests/Polyhedron/mingenerators2.cc, + tests/Polyhedron/nncminimize1.cc, tests/Polyhedron/nncminimize2.cc, + tests/Polyhedron/nncpostimeelapse1.cc, + tests/Polyhedron/numberinput1.cc, tests/Polyhedron/onepoint.cc, + tests/Polyhedron/permute.cc, tests/Polyhedron/polydifference1.cc, + tests/Polyhedron/polydifference2.cc, tests/Polyhedron/polyhull1.cc, + tests/Polyhedron/polyhull2.cc, + tests/Polyhedron/polyhullifexact1.cc, + tests/Polyhedron/polyhullifexact2.cc, + tests/Polyhedron/randphull1.cc, + tests/Polyhedron/refinewithcongruence1.cc, + tests/Polyhedron/refinewithcongruences1.cc, + tests/Polyhedron/refinewithconstraint1.cc, + tests/Polyhedron/refinewithconstraints1.cc, + tests/Polyhedron/relations1.cc, tests/Polyhedron/relations2.cc, + tests/Polyhedron/relations3.cc, + tests/Polyhedron/removespacedims1.cc, + tests/Polyhedron/removespacedims2.cc, + tests/Polyhedron/simplifyusingcontext1.cc, + tests/Polyhedron/smm1.cc, tests/Polyhedron/sparserow1.cc, + tests/Polyhedron/termination1.cc, tests/Polyhedron/termination2.cc, + tests/Polyhedron/timeelapse1.cc, tests/Polyhedron/timeelapse2.cc, + tests/Polyhedron/topclosed1.cc, tests/Polyhedron/topclosure1.cc, + tests/Polyhedron/unconstrain1.cc, tests/Polyhedron/universe1.cc, + tests/Polyhedron/universe2.cc, tests/Polyhedron/variablesset1.cc, + tests/Polyhedron/watchdog1.cc, tests/Polyhedron/weightwatch1.cc, + tests/Polyhedron/wrap1.cc, tests/Polyhedron/wrap2.cc, + tests/Polyhedron/writeconsys1.cc, tests/Polyhedron/writegensys1.cc, + tests/Polyhedron/writepolyhedron1.cc, + tests/Polyhedron/writepolyhedron2.cc, + tests/Polyhedron/writerelation1.cc, + tests/Polyhedron/writevariable1.cc, tests/Powerset/Makefile.am, + tests/Powerset/addcongruences1.cc, + tests/Powerset/addconstraints1.cc, + tests/Powerset/affinedimension1.cc, tests/Powerset/affineimage1.cc, + tests/Powerset/affinepreimage1.cc, tests/Powerset/bounded1.cc, + tests/Powerset/bounds1.cc, tests/Powerset/closed1.cc, + tests/Powerset/closure1.cc, tests/Powerset/collapse1.cc, + tests/Powerset/concatenate1.cc, tests/Powerset/contains1.cc, + tests/Powerset/containsintegerpoint1.cc, + tests/Powerset/difference1.cc, tests/Powerset/discrete1.cc, + tests/Powerset/disjoint1.cc, tests/Powerset/disjunct1.cc, + tests/Powerset/empty1.cc, tests/Powerset/entails1.cc, + tests/Powerset/equals1.cc, tests/Powerset/frombdshape1.cc, + tests/Powerset/frombox1.cc, tests/Powerset/fromcongruences1.cc, + tests/Powerset/fromconstraints1.cc, tests/Powerset/fromgrid1.cc, + tests/Powerset/fromoctagonalshape1.cc, + tests/Powerset/frompolyhedron1.cc, + tests/Powerset/fromspacedimension1.cc, + tests/Powerset/intersection1.cc, tests/Powerset/maxmin1.cc, + tests/Powerset/meet1.cc, tests/Powerset/membytes1.cc, + tests/Powerset/powerset1.cc, tests/Powerset/reduce1.cc, + tests/Powerset/refinewith1.cc, tests/Powerset/relationwith1.cc, + tests/Powerset/simplifyusingcontext1.cc, tests/Powerset/size1.cc, + tests/Powerset/spacedims1.cc, tests/Powerset/universe1.cc, + tests/Powerset/upperbound1.cc, tests/README, + tests/Random_Number_Generator_defs.hh, + tests/Random_Number_Generator_inlines.hh, + tests/Random_Number_Generator_types.hh, tests/Watchdog/Makefile.am, + tests/Watchdog/watchdog1.cc, tests/files.cc, tests/files.hh, + tests/ppl_test.cc, tests/ppl_test.hh, utils/Makefile.am, + utils/build_header.in, utils/cm_cleaner.sh, utils/cm_splitter.sh, + utils/text2cxxarray.in, utils/timings.cc, utils/timings.hh: Extended + copyright years. + +2013-12-30 Roberto Bagnara + + * doc/ppl_citations.bib: Several corrections. + +2013-12-30 Roberto Bagnara + + * doc/ppl_citations.bib: Capitalization fixes. + +2013-12-29 Patricia Hill + + * doc/ppl_citations.bib: Reference added. + +2013-12-29 Patricia Hill + + * doc/ppl_citations.bib: References added. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: Several corrections to the abstract of + Fu13th. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: Added abstract of Fu13th. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: Added Zu14th. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: Added Fu14b. + +2013-12-29 Roberto Bagnara + + * doc/ppl.bib, doc/ppl_citations.bib: Several improvements. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: Abstracts fixed. Avoided non-ASCII + characters. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed bogus label. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: Several corrections. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: More corrections. + +2013-12-29 Roberto Bagnara + + * doc/ppl.bib, doc/ppl_citations.bib: Several corrections. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed CostantiniFM13. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed BrauerKK13. + +2013-12-29 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed KapurZHZLN13. + +2013-12-28 Patricia Hill + + * doc/ppl_citations.bib: More references added. + +2013-12-28 Patricia Hill + + * doc/ppl.bib, doc/ppl_citations.bib: More references added. + +2013-12-28 Patricia Hill + + * doc/ppl.bib, doc/ppl_citations.bib: More references added. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Accented letters fixed. + +2013-12-28 Patricia Hill + + * doc/ppl_citations.bib: More references added. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Author field fixed. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Book title fixed. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Added missing acronym. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Duplicate key avoided. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Added missing acronym. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Added missing quote. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Braces restored. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Book title corrected. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed book title and capitalization. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed capitalization. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Book title fixed. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Book titles corrected. + +2013-12-28 Patricia Hill + + * doc/ppl_citations.bib: More references added. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed title capitalization. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Book title corrected. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed more book titles. + +2013-12-28 Patricia Hill + + * doc/ppl_citations.bib: Typo fixed. + +2013-12-28 Patricia Hill + + * doc/ppl_citations.bib: More references added. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Removed duplicate entry. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Book title fixed. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Title fixed and abstract added. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed more book titles. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Book title fixed. + +2013-12-28 Roberto Bagnara + + * doc/ppl_citations.bib: Fixed several typos. + +2013-12-27 Patricia Hill + + * doc/ppl_citations.bib: Typo fixed. + +2013-12-27 Patricia Hill + + * doc/ppl_citations.bib: Typo fixed. + +2013-12-27 Patricia Hill + + * doc/ppl_citations.bib: Added recently published papers citing the + PPL. Added papers are books, journal articles or conference proceedings + published in 2012-2013 that cite "The Parma Polyhedra Library: + Toward a complete set of numerical abstractions for the analysis and + verification of hardware and software systems." Theses, workshop papers and technical reports have not been added in + this commit. + +2013-12-11 Roberto Bagnara + + * interfaces/Prolog/ppl_prolog_common.cc: Fixed + check_nil_terminating(). + +2013-12-11 Roberto Bagnara + + * interfaces/Prolog/SWI/swi_cfli.hh: Some corrections. + +2013-12-11 Roberto Bagnara + + * interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4, + interfaces/Prolog/ppl_prolog_common.cc: Use Prolog_put_nil() and + Prolog_get_nil(). + +2013-12-11 Roberto Bagnara + + * interfaces/Prolog/SWI/swi_cfli.hh: Added Prolog_put_nil() and + Prolog_get_nil(). + +2013-12-01 Roberto Bagnara + + * src/Octagonal_Shape_templates.hh, + src/Polyhedron_chdims_templates.hh, + src/Polyhedron_simplify_templates.hh, src/linearize.hh: Useless + typedefs avoided. Formatting improved on passing. + +2013-11-08 Roberto Bagnara + + * configure.ac, src/Makefile.am: Version number bumped. + +2013-10-28 Roberto Bagnara + + * ChangeLog: Updated. 2013-10-28 Roberto Bagnara diff -Nru ppl-1.1/config.guess ppl-1.2/config.guess --- ppl-1.1/config.guess 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/config.guess 2016-02-11 12:31:26.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2013-06-10' +timestamp='2016-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -168,20 +168,27 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -197,6 +204,13 @@ os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -207,13 +221,13 @@ release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -223,6 +237,10 @@ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/LibertyBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -235,6 +253,9 @@ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -579,8 +600,9 @@ else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -826,7 +848,7 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -932,6 +954,9 @@ crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -944,6 +969,9 @@ ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -969,10 +997,10 @@ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1020,7 +1048,7 @@ echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1099,7 +1127,7 @@ # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1260,16 +1288,26 @@ if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; @@ -1359,155 +1397,10 @@ x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; -esac - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi +esac cat >&2 <. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,8 +53,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +116,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,16 +254,18 @@ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -282,8 +283,10 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -295,14 +298,14 @@ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -310,6 +313,7 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -324,7 +328,10 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -369,18 +376,20 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -400,8 +409,10 @@ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -413,16 +424,18 @@ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -430,6 +443,7 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -506,6 +520,9 @@ basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -767,6 +784,9 @@ basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -794,7 +814,7 @@ os=-mingw64 ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -822,6 +842,10 @@ basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -830,7 +854,7 @@ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1354,11 +1378,11 @@ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ @@ -1367,14 +1391,15 @@ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1546,6 +1571,9 @@ c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1589,9 +1617,6 @@ mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; diff -Nru ppl-1.1/configure ppl-1.2/configure --- ppl-1.1/configure 2013-10-28 12:44:50.000000000 +0000 +++ ppl-1.2/configure 2016-02-11 12:31:40.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for the Parma Polyhedra Library 1.1. +# Generated by GNU Autoconf 2.69 for the Parma Polyhedra Library 1.2. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='the Parma Polyhedra Library' PACKAGE_TARNAME='ppl' -PACKAGE_VERSION='1.1' -PACKAGE_STRING='the Parma Polyhedra Library 1.1' +PACKAGE_VERSION='1.2' +PACKAGE_STRING='the Parma Polyhedra Library 1.2' PACKAGE_BUGREPORT='ppl-devel@cs.unipr.it' PACKAGE_URL='' @@ -667,27 +667,6 @@ HAVE_MD5SUM_FALSE HAVE_MD5SUM_TRUE MD5SUM -ENABLE_STATIC_FALSE -ENABLE_STATIC_TRUE -ENABLE_SHARED_FALSE -ENABLE_SHARED_TRUE -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -RANLIB -ac_ct_AR -AR -DLLTOOL -OBJDUMP -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -LIBTOOL THOROUGH_MAKE_CHECK_FALSE THOROUGH_MAKE_CHECK_TRUE VALGRIND_TESTS_ENABLED_FALSE @@ -765,6 +744,27 @@ BUILD_PPL_LPSOL_TRUE BUILD_PPL_LCDD_FALSE BUILD_PPL_LCDD_TRUE +ENABLE_STATIC_FALSE +ENABLE_STATIC_TRUE +ENABLE_SHARED_FALSE +ENABLE_SHARED_TRUE +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +DLLTOOL +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +LIBTOOL SUPPORTED_SOME_FLOATING_POINT_TYPE_FALSE SUPPORTED_SOME_FLOATING_POINT_TYPE_TRUE SUPPORTED_LONG_DOUBLE_FALSE @@ -943,6 +943,13 @@ enable_coefficients with_cflags with_cxxflags +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock with_gmp with_gmp_include with_gmp_lib @@ -957,13 +964,6 @@ enable_instantiations enable_valgrind_tests enable_check -enable_shared -enable_static -with_pic -enable_fast_install -with_gnu_ld -with_sysroot -enable_libtool_lock ' ac_precious_vars='build_alias host_alias @@ -1519,7 +1519,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures the Parma Polyhedra Library 1.1 to adapt to many kinds of systems. +\`configure' configures the Parma Polyhedra Library 1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1589,7 +1589,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of the Parma Polyhedra Library 1.1:";; + short | recursive ) echo "Configuration of the Parma Polyhedra Library 1.2:";; esac cat <<\_ACEOF @@ -1617,6 +1617,11 @@ --enable-pch use precompiled headers, if available --enable-coefficients=TYPE select the type of the coefficients + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) --enable-ppl_lcdd build the ppl_lcdd program --enable-ppl_lpsol build the ppl_lpsol program --enable-ppl_pips build the ppl_pips program @@ -1627,11 +1632,6 @@ enable instantiations for the non-C++ interfaces --enable-valgrind-tests run library tests under Valgrind --enable-check=KIND select thorough or quick `make check' - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1640,6 +1640,11 @@ --with-cxx=XXX use XXX as the C++ compiler --with-cflags=XXX add XXX to the options for the C compiler --with-cxxflags=XXX add XXX to the options for the C++ compiler + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). --with-gmp=DIR search for libgmp/libgmpxx in DIR/include and DIR/lib --with-gmp-include=DIR search for libgmp/libgmpxx headers in DIR @@ -1647,11 +1652,6 @@ --with-gmp-build=DIR use a non-installed build of GMP in DIR --with-java=DIR use the Java SDK installed in DIR --with-mlgmp=DIR use the ML GMP package installed in DIR - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). Some influential environment variables: CC C compiler command @@ -1734,7 +1734,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -the Parma Polyhedra Library configure 1.1 +the Parma Polyhedra Library configure 1.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2433,6 +2433,119 @@ } # ac_fn_cxx_check_type +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + # ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES # ---------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes @@ -2673,141 +2786,28 @@ } # ac_fn_cxx_check_member -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -2926,7 +2926,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by the Parma Polyhedra Library $as_me 1.1, which was +It was created by the Parma Polyhedra Library $as_me 1.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3874,7 +3874,7 @@ # Define the identity of the package. PACKAGE='ppl' - VERSION='1.1' + VERSION='1.2' # Some tools Automake needs. @@ -4076,6 +4076,7 @@ + # Version number machinery. if test -n "`expr $VERSION : '\([0-9]*\)\.[0-9]*\.[0-9]*'`" then @@ -5819,7 +5820,6 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : @@ -6584,7 +6584,7 @@ OPT_FLAGS="$OPT_FLAGS -fp-model strict -fp-speculation off" else # -frounding-math is not yet supported in clang++ or llvm-g++. - if test x"$CLANGXX" = xyes || x"$LLVM_GXX" = xyes + if test x"$CLANGXX" = xyes || test x"$LLVM_GXX" = xyes then if test x"$use_fpmath" = xyes then @@ -9710,660 +9710,385 @@ -# Checks on the GMP library. +# Libtool. +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac -# Check whether --with-gmp was given. -if test "${with_gmp+set}" = set; then : - withval=$with_gmp; -fi +macro_version='2.4.2' +macro_revision='1.3337' -# Check whether --with-gmp-include was given. -if test "${with_gmp_include+set}" = set; then : - withval=$with_gmp_include; -fi -# Check whether --with-gmp-lib was given. -if test "${with_gmp_lib+set}" = set; then : - withval=$with_gmp_lib; -fi -if test -n "$with_gmp" -then - gmp_include_options="-I$with_gmp/include" - gmp_library_paths="$with_gmp/lib" - gmp_library_options="-L$gmp_library_paths" -fi -if test -n "$with_gmp_include" -then - gmp_include_options="-I$with_gmp_include" -fi -if test -n "$with_gmp_lib" -then - gmp_library_paths="$with_gmp_lib" - gmp_library_options="-L$gmp_library_paths" -fi -gmp_libs="-lgmpxx -lgmp" -# Check whether --with-gmp-build was given. -if test "${with_gmp_build+set}" = set; then : - withval=$with_gmp_build; gmp_build_dir=$with_gmp_build - if test -n "$with_gmp" \ - || test -n "$with_gmp_include" || test -n "$with_gmp_lib" - then - as_fn_error $? "cannot use --with-gmp-build and other --with-gmp* options together" "$LINENO" 5 - else - gmp_srcdir=`echo @abs_srcdir@ | $gmp_build_dir/config.status --file=-` - gmp_include_options="-I$gmp_build_dir -I$gmp_build_dir/tune -I$gmp_srcdir" - gmp_libs="$gmp_build_dir/libgmp.la $gmp_build_dir/libgmpxx.la" - fi -fi +ltmain="$ac_aux_dir/ltmain.sh" -gmp_library_options="$gmp_library_options $gmp_libs" +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' -if test -n "$with_gmp_build" -then - ac_save_CXX="$CXX" - CXX="libtool --mode=link --tag=CXX $CXX" +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi -ac_save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $gmp_include_options" -ac_save_LIBS="$LIBS" -LIBS="$LIBS $gmp_library_options" -eval ac_save_shared_library_path="\$$shared_library_path_env_var" -eval $shared_library_path_env_var=\"$gmp_library_paths:$ac_save_shared_library_path\" -export $shared_library_path_env_var +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the GMP library version 4.1.3 or above" >&5 -$as_echo_n "checking for the GMP library version 4.1.3 or above... " >&6; } -if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR == 1 && __GNU_MP_VERSION_PATCHLEVEL < 3) -#GMP version 4.1.3 or higher is required -#endif -int -main() { - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_have_gmp=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_have_gmp=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -#include -#if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR == 1 && __GNU_MP_VERSION_PATCHLEVEL < 3) -#GMP version 4.1.3 or higher is required -#endif -#ifndef BITS_PER_MP_LIMB -#define BITS_PER_MP_LIMB GMP_LIMB_BITS -#endif -int -main() { - std::string header_version; - { - std::ostringstream s(header_version); - s << __GNU_MP_VERSION << "." << __GNU_MP_VERSION_MINOR; - // Starting from GMP version 4.3.0, the gmp_version variable - // always contains three parts. In previous versions the - // patchlevel was omitted if it was 0. - if (__GNU_MP_VERSION_PATCHLEVEL != 0 - || __GNU_MP_VERSION > 4 - || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR >= 3)) - s << "." << __GNU_MP_VERSION_PATCHLEVEL; - header_version = s.str(); - } - std::string library_version = gmp_version; - if (header_version != library_version) { - std::cerr - << "GMP header (gmpxx.h) and library (ligmpxx.*) version mismatch:\n" - << "header gives " << header_version << ";\n" - << "library gives " << library_version << "." << std::endl; - return 1; - } - if (sizeof(mp_limb_t)*CHAR_BIT != BITS_PER_MP_LIMB - || BITS_PER_MP_LIMB != mp_bits_per_limb) { - std::cerr - << "GMP header (gmpxx.h) and library (ligmpxx.*) bits-per-limb mismatch:\n" - << "header gives " << BITS_PER_MP_LIMB << ";\n" - << "library gives " << mp_bits_per_limb << ".\n" - << "This probably means you are on a bi-arch system and\n" - << "you are compiling with the wrong header or linking with\n" - << "the wrong library." << std::endl; - return 1; - } - - mpz_class n("3141592653589793238462643383279502884"); - return 0; -} - -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_have_gmp=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_have_gmp=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - -have_gmp=${ac_cv_have_gmp} - -if test x"$ac_cv_have_gmp" = xyes -then -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of mp_limb_t" >&5 -$as_echo_n "checking size of mp_limb_t... " >&6; } -if ${ac_cv_sizeof_mp_limb_t+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (mp_limb_t))" "ac_cv_sizeof_mp_limb_t" "#include -"; then : + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi else - if test "$ac_cv_type_mp_limb_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (mp_limb_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_mp_limb_t=0 - fi + ac_cv_path_SED=$SED fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_mp_limb_t" >&5 -$as_echo "$ac_cv_sizeof_mp_limb_t" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" -cat >>confdefs.h <<_ACEOF -#define SIZEOF_MP_LIMB_T $ac_cv_sizeof_mp_limb_t -_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GMP has been compiled with support for exceptions" >&5 -$as_echo_n "checking whether GMP has been compiled with support for exceptions... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming yes" >&5 -$as_echo "assuming yes" >&6; } - ac_cv_gmp_supports_exceptions=yes -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -static void* -x_malloc(size_t) { - throw std::bad_alloc(); -} -static void* -x_realloc(void*, size_t, size_t) { - throw std::bad_alloc(); -} -static void -x_free(void*, size_t) { -} -int main() { - mp_set_memory_functions(x_malloc, x_realloc, x_free); - try { - mpz_class n("3141592653589793238462643383279502884"); - } - catch (std::bad_alloc&) { - return 0; - } - return 1; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_gmp_supports_exceptions=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_gmp_supports_exceptions=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +test -z "$GREP" && GREP=grep -gmp_supports_exceptions=${ac_cv_gmp_supports_exceptions} -if test x"$gmp_supports_exceptions" = xyes -then - value=1 -else - value=0 -fi -cat >>confdefs.h <<_ACEOF -#define PPL_GMP_SUPPORTS_EXCEPTIONS $value -_ACEOF -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -eval $shared_library_path_env_var=\"$ac_save_shared_library_path\" -LIBS="$ac_save_LIBS" -CPPFLAGS="$ac_save_CPPFLAGS" -if test -n "$with_gmp_build" -then - CXX="$ac_save_CXX" -fi -if test x"$have_gmp" = xno -then - as_fn_error $? "Cannot find GMP version 4.1.3 or higher. -GMP is the GNU Multi-Precision library: -see http://www.swox.com/gmp/ for more information. -When compiling the GMP library, do not forget to enable the C++ interface: -add --enable-cxx to the configuration options." "$LINENO" 5 -else - if test x"$have_gmpxx" = xno - then - as_fn_error $? "GMP compiled without enabling the C++ interface. -GMP is the GNU Multi-Precision library: -see http://www.swox.com/gmp/ for more information. -When compiling the GMP library, do not forget to enable the C++ interface: -add --enable-cxx to the configuration options." "$LINENO" 5 - fi -fi -ac_fn_cxx_check_member "$LINENO" "__mpz_struct" "_mp_alloc" "ac_cv_member___mpz_struct__mp_alloc" "#include -" -if test "x$ac_cv_member___mpz_struct__mp_alloc" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE___MPZ_STRUCT__MP_ALLOC 1 -_ACEOF -else - gmp_has_changes=yes -fi -ac_fn_cxx_check_member "$LINENO" "__mpz_struct" "_mp_size" "ac_cv_member___mpz_struct__mp_size" "#include -" -if test "x$ac_cv_member___mpz_struct__mp_size" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE___MPZ_STRUCT__MP_SIZE 1 -_ACEOF -else - gmp_has_changes=yes -fi -ac_fn_cxx_check_member "$LINENO" "__mpz_struct" "_mp_d" "ac_cv_member___mpz_struct__mp_d" "#include -" -if test "x$ac_cv_member___mpz_struct__mp_d" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE___MPZ_STRUCT__MP_D 1 -_ACEOF +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else - gmp_has_changes=yes -fi - - -if test x"$gmp_has_changed" = xyes -then - as_fn_error $? "GMP HAS CHANGED: -*** The PPL exploits some implementation details of GMP that were current -*** until (at least) version 4.1.4 of GMP. You seem to be using a version -*** where these details have changed. -*** Please report this to ppl-devel@cs.unipr.it." "$LINENO" 5 -fi - -extra_includes="${extra_includes}${extra_includes:+ }${gmp_include_options}" -extra_libraries="${extra_libraries}${extra_libraries:+ }${gmp_library_options}" - -enableval=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the ppl_lcdd program" >&5 -$as_echo_n "checking whether to build the ppl_lcdd program... " >&6; } -# Check whether --enable-ppl_lcdd was given. -if test "${enable_ppl_lcdd+set}" = set; then : - enableval=$enable_ppl_lcdd; + with_gnu_ld=no fi -case "${enableval}" in -yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; -no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; -*) - as_fn_error $? "bad value ${enableval} for --enable-ppl_lcdd, needs yes or no" "$LINENO" 5 - ;; -esac -build_ppl_lcdd=$enableval - if test x"$build_ppl_lcdd" = xyes; then - BUILD_PPL_LCDD_TRUE= - BUILD_PPL_LCDD_FALSE='#' +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } else - BUILD_PPL_LCDD_TRUE='#' - BUILD_PPL_LCDD_FALSE= -fi - - -enableval=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the ppl_lpsol program" >&5 -$as_echo_n "checking whether to build the ppl_lpsol program... " >&6; } -# Check whether --enable-ppl_lpsol was given. -if test "${enable_ppl_lpsol+set}" = set; then : - enableval=$enable_ppl_lpsol; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } fi - -case "${enableval}" in -yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; -no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; -*) - as_fn_error $? "bad value ${enableval} for --enable-ppl_lpsol, needs yes or no" "$LINENO" 5 - ;; -esac -build_ppl_lpsol=$enableval - if test x"$build_ppl_lpsol" = xyes; then - BUILD_PPL_LPSOL_TRUE= - BUILD_PPL_LPSOL_FALSE='#' +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 else - BUILD_PPL_LPSOL_TRUE='#' - BUILD_PPL_LPSOL_FALSE= + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo_n "checking whether to build the ppl_pips program... " >&6; } -# Check whether --enable-ppl_pips was given. -if test "${enable_ppl_pips+set}" = set; then : - enableval=$enable_ppl_pips; fi -case "${enableval}" in -yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; -no) +LD="$lt_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld -enableval=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the PPL documentation" >&5 -$as_echo_n "checking whether to build the PPL documentation... " >&6; } -# Check whether --enable-documentation was given. -if test "${enable_documentation+set}" = set; then : - enableval=$enable_documentation; -fi -case "${enableval}" in -yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; -no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; -*) - as_fn_error $? "bad value ${enableval} for --enable-documentation, needs yes or no" "$LINENO" 5 - ;; -esac -build_documentation=$enableval - if test x"$build_documentation" = xyes; then - BUILD_DOCUMENTATION_TRUE= - BUILD_DOCUMENTATION_FALSE='#' -else - BUILD_DOCUMENTATION_TRUE='#' - BUILD_DOCUMENTATION_FALSE= -fi -# Define lists of available interfaces: lowercase and blank-separated. -non_prolog_interfaces="cxx c ocaml java" -prolog_interfaces="ciao_prolog gnu_prolog sicstus_prolog swi_prolog xsb_prolog yap_prolog" -available_interfaces="${non_prolog_interfaces} ${prolog_interfaces}" -# This is the list of interfaces that are enabled by default. -default_interfaces=${non_prolog_interfaces} -enableval=not_specified -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which interfaces are enabled" >&5 -$as_echo_n "checking which interfaces are enabled... " >&6; } -# Check whether --enable-interfaces was given. -if test "${enable_interfaces+set}" = set; then : - enableval=$enable_interfaces; -fi -case x"${enableval}" in -xyes | x) - as_fn_error $? "--enable-interfaces needs at least one argument chosen among ${available_interfaces}, none and all" "$LINENO" 5 - ;; -xnone | xno) - for interface in ${available_interfaces} - do - eval ${interface}_interface_enabled=no - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } - ;; -xall) - for interface in ${available_interfaces} - do - eval ${interface}_interface_enabled=yes - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${available_interfaces}" >&5 -$as_echo "${available_interfaces}" >&6; } - ;; -*) - if test x"${enableval}" = xnot_specified - then - enableval=${default_interfaces} - fi - # Make the list blank-separated and lowercase; turn "c++" into "cxx". - required_interfaces=`echo "${enableval}" | sed -e 's/-/_/g' -e 's/[ ,][ ,]*/ /g' -e 's/c++/cxx/g' | tr '[:upper:]' '[:lower:]'` - # Check that the specified interfaces exist. - for interface in ${required_interfaces} - do - case " ${available_interfaces} " in - *\ ${interface}\ *) - ;; - *) - as_fn_error $? "unknown interface ${interface}: must be one of ${available_interfaces}" "$LINENO" 5 - ;; - esac - done - # Initialize the enabled variable for each interface. - for interface in ${available_interfaces} - do - case " ${required_interfaces} " in - *\ ${interface}\ *) - eval ${interface}_interface_enabled=yes - enabled_interfaces="${enabled_interfaces}${enabled_interfaces:+ }${interface}" - ;; - *) - eval ${interface}_interface_enabled=no - ;; - esac - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enabled_interfaces}" >&5 -$as_echo "${enabled_interfaces}" >&6; } - ;; -esac -if test x${cxx_interface_enabled} = xyes -then - build_cxx_interface=yes -fi - if test x$build_cxx_interface = xyes; then - BUILD_CXX_INTERFACE_TRUE= - BUILD_CXX_INTERFACE_FALSE='#' -else - BUILD_CXX_INTERFACE_TRUE='#' - BUILD_CXX_INTERFACE_FALSE= -fi - - -if test x${c_interface_enabled} = xyes -then - build_c_interface=yes -fi - if test x$build_c_interface = xyes; then - BUILD_C_INTERFACE_TRUE= - BUILD_C_INTERFACE_FALSE='#' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 else - BUILD_C_INTERFACE_TRUE='#' - BUILD_C_INTERFACE_FALSE= -fi - - -# Checks for systems for which the interface is enabled. - -# Allow to specify the Java SDK installation directory. - -# Check whether --with-java was given. -if test "${with_java+set}" = set; then : - withval=$with_java; java_dir=$with_java -fi - - -case "${host_os}" in -# On Darwin the JDK, if present, is installed in /Library/Java/Home . -darwin*) - if test "x$java_dir" = x - then - java_dir="/Library/Java/Home" - fi - ;; -# On modern Fedora systems the JDK is usually in /usr/lib/jvm/java . -linux*) - if test "x$java_dir" = x - then - java_dir="/usr/lib/jvm/java" + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" fi - ;; -*) - ;; -esac - -if test "x$java_dir" != x -then - JAVAPREFIX="${java_dir}/bin" + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} fi - -# Checks for Java. -if test x${java_interface_enabled} = xyes -then - # Check for Java programs. Order here is important: check first - # for the compiler. - - -if test "x$JAVAPREFIX" = x -then - test "x$JAVAC" = x && for ac_prog in javac$EXEEXT -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_JAVAC+:} false; then : +if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$JAVAC"; then - ac_cv_prog_JAVAC="$JAVAC" # Let the user override the test. + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -10372,7 +10097,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_JAVAC="$ac_prog" + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -10382,43 +10107,41 @@ fi fi -JAVAC=$ac_cv_prog_JAVAC -if test -n "$JAVAC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 -$as_echo "$JAVAC" >&6; } +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$JAVAC" && break -done -test -n "$JAVAC" || JAVAC="no" - -else - test "x$JAVAC" = x && for ac_prog in javac$EXEEXT + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAC+:} false; then : +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else - case $JAVAC in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $JAVAPREFIX + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -10426,254 +10149,414 @@ done IFS=$as_save_IFS - ;; -esac fi -JAVAC=$ac_cv_path_JAVAC -if test -n "$JAVAC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 -$as_echo "$JAVAC" >&6; } +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$JAVAC" && break + test -n "$ac_ct_DUMPBIN" && break done -test -n "$JAVAC" || JAVAC="no" + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi fi -if test ! x$JAVAC = "xno" -then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $JAVAC supports enums" >&5 -$as_echo_n "checking whether $JAVAC supports enums... " >&6; } -if ${ac_cv_javac_supports_enums+:} false; then : - $as_echo_n "(cached) " >&6 -else + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi -JAVA_TEST=Test.java -CLASS_TEST=Test.class -cat << \EOF > $JAVA_TEST -/* #line 10459 "configure" */ -public class Test { -public enum Relation_Symbol { - /*! Less than. */ - LESS_THAN, - /*! Less than or equal to. */ - LESS_OR_EQUAL, - /*! Equal to. */ - EQUAL, - /*! Greater than or equal to. */ - GREATER_OR_EQUAL, - /*! Greater than. */ - GREATER_THAN, - } -} -EOF -if { ac_try='$JAVAC $JAVACFLAGS $JAVA_TEST' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } >/dev/null 2>&1; then - ac_cv_javac_supports_enums=yes -else - echo "configure: failed program was:" >&5 - cat $JAVA_TEST >&5 - ac_cv_javac_supports_enums=no + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi fi +test -z "$NM" && NM=nm -rm -f $JAVA_TEST $CLASS_TEST Test\$Relation_Symbol.class -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_javac_supports_enums" >&5 -$as_echo "$ac_cv_javac_supports_enums" >&6; } -fi -if test x$JAVAPREFIX = x; then - test x$JAVA = x && for ac_prog in java$EXEEXT -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_JAVA+:} false; then : + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$JAVA"; then - ac_cv_prog_JAVA="$JAVA" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_JAVA="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" fi -done - done -IFS=$as_save_IFS - -fi + rm -f conftest* fi -JAVA=$ac_cv_prog_JAVA -if test -n "$JAVA"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 -$as_echo "$JAVA" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } fi - - test -n "$JAVA" && break -done -test -n "$JAVA" || JAVA="no" - -else - test x$JAVA = x && for ac_prog in java$EXEEXT -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVA+:} false; then : +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else - case $JAVA in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAVA="$JAVA" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $JAVAPREFIX -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + i=0 + teststring="ABCD" - ;; -esac -fi -JAVA=$ac_cv_path_JAVA -if test -n "$JAVA"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 -$as_echo "$JAVA" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; - test -n "$JAVA" && break -done -test -n "$JAVA" || JAVA="no" + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; -fi -if test ! x$JAVA = "xno" -then + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; -# Extract the first word of "uudecode$EXEEXT", so it can be a program name with args. -set dummy uudecode$EXEEXT; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_uudecode+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$uudecode"; then - ac_cv_prog_uudecode="$uudecode" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_uudecode="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac fi -fi -uudecode=$ac_cv_prog_uudecode -if test -n "$uudecode"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $uudecode" >&5 -$as_echo "$uudecode" >&6; } + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } fi +max_cmd_len=$lt_cv_sys_max_cmd_len -if test x$uudecode = xyes; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if uudecode can decode base 64 file" >&5 -$as_echo_n "checking if uudecode can decode base 64 file... " >&6; } -if ${ac_cv_prog_uudecode_base64+:} false; then : - $as_echo_n "(cached) " >&6 + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset else + lt_unset=false +fi -cat << \EOF > Test.uue -begin-base64 644 Test.class -yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE -bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 -bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s -YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG -aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB -AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB -AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ= -==== -EOF -if uudecode$EXEEXT Test.uue; then - ac_cv_prog_uudecode_base64=yes + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 else - echo "configure: 10650: uudecode had trouble decoding base 64 file 'Test.uue'" >&5 - echo "configure: failed file was:" >&5 - cat Test.uue >&5 - ac_cv_prog_uudecode_base64=no + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + fi -rm -f Test.uue + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_uudecode_base64" >&5 -$as_echo "$ac_cv_prog_uudecode_base64" >&6; } + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' fi -if test x$ac_cv_prog_uudecode_base64 != xyes; then - rm -f Test.class - if test x$ac_cv_javac_supports_enums = x; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac -if test "x$JAVAPREFIX" = x -then - test "x$JAVAC" = x && for ac_prog in javac$EXEEXT -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_JAVAC+:} false; then : +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$JAVAC"; then - ac_cv_prog_JAVAC="$JAVAC" # Let the user override the test. + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -10682,7 +10565,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_JAVAC="$ac_prog" + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -10692,43 +10575,37 @@ fi fi -JAVAC=$ac_cv_prog_JAVAC -if test -n "$JAVAC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 -$as_echo "$JAVAC" >&6; } +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$JAVAC" && break -done -test -n "$JAVAC" || JAVAC="no" - -else - test "x$JAVAC" = x && for ac_prog in javac$EXEEXT -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAC+:} false; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else - case $JAVAC in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $JAVAPREFIX + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -10736,247 +10613,296 @@ done IFS=$as_save_IFS - ;; -esac fi -JAVAC=$ac_cv_path_JAVAC -if test -n "$JAVAC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 -$as_echo "$JAVAC" >&6; } -else +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - - test -n "$JAVAC" && break -done -test -n "$JAVAC" || JAVAC="no" - -fi -if test ! x$JAVAC = "xno" -then - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $JAVAC supports enums" >&5 -$as_echo_n "checking whether $JAVAC supports enums... " >&6; } -if ${ac_cv_javac_supports_enums+:} false; then : - $as_echo_n "(cached) " >&6 -else - -JAVA_TEST=Test.java -CLASS_TEST=Test.class -cat << \EOF > $JAVA_TEST -/* #line 10769 "configure" */ -public class Test { -public enum Relation_Symbol { - /*! Less than. */ - LESS_THAN, - /*! Less than or equal to. */ - LESS_OR_EQUAL, - /*! Equal to. */ - EQUAL, - /*! Greater than or equal to. */ - GREATER_OR_EQUAL, - /*! Greater than. */ - GREATER_THAN, - } -} -EOF -if { ac_try='$JAVAC $JAVACFLAGS $JAVA_TEST' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } >/dev/null 2>&1; then - ac_cv_javac_supports_enums=yes + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi else - echo "configure: failed program was:" >&5 - cat $JAVA_TEST >&5 - ac_cv_javac_supports_enums=no + OBJDUMP="$ac_cv_prog_OBJDUMP" fi -rm -f $JAVA_TEST $CLASS_TEST Test\$Relation_Symbol.class +test -z "$OBJDUMP" && OBJDUMP=objdump -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_javac_supports_enums" >&5 -$as_echo "$ac_cv_javac_supports_enums" >&6; } -fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $JAVA works" >&5 -$as_echo_n "checking if $JAVA works... " >&6; } -if ${ac_cv_prog_java_works+:} false; then : - $as_echo_n "(cached) " >&6 -else -JAVA_TEST=Test.java -CLASS_TEST=Test.class -TEST=Test -cat << \EOF > $JAVA_TEST -/* [#]line 10818 "configure" */ -public class Test { -public static void main (String args[]) { - System.exit (0); -} } -EOF -if test x$ac_cv_prog_uudecode_base64 != xyes; then - if { ac_try='$JAVAC $JAVACFLAGS $JAVA_TEST' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } && test -s $CLASS_TEST; then - : - else - echo "configure: failed program was:" >&5 - cat $JAVA_TEST >&5 - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" >&5 -$as_echo "$as_me: WARNING: The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" >&2;} - fi -fi -# if we don't have a Java compiler installed, it's useless to check if Java -# works beacause a working javac is needed. -if test x$ac_cv_javac_supports_enums = xno; then - ac_cv_prog_java_works=skipping -else -if { ac_try='$JAVA $JAVAFLAGS $TEST' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } >/dev/null 2>&1; then - ac_cv_prog_java_works=yes -else - echo "configure: failed program was:" >&5 - cat $JAVA_TEST >&5 - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The Java VM $JAVA failed (see config.log, check the CLASSPATH?)" >&5 -$as_echo "$as_me: WARNING: The Java VM $JAVA failed (see config.log, check the CLASSPATH?)" >&2;} - fi -fi -rm -fr $JAVA_TEST $CLASS_TEST Test.uue -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_java_works" >&5 -$as_echo "$ac_cv_prog_java_works" >&6; } -fi -if test "x$JAVAPREFIX" = x; then - test "x$JAR" = x && for ac_prog in jar$EXEEXT -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_JAR+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$JAR"; then - ac_cv_prog_JAR="$JAR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_JAR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. -fi -fi -JAR=$ac_cv_prog_JAR -if test -n "$JAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAR" >&5 -$as_echo "$JAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; +beos*) + lt_cv_deplibs_check_method=pass_all + ;; - test -n "$JAR" && break -done -test -n "$JAR" || JAR="no" +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; -else - test "x$JAR" = x && for ac_prog in jar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAR="$JAR" # Let the user override the test with a path. +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $JAVAPREFIX -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi ;; -esac -fi -JAR=$ac_cv_path_JAR -if test -n "$JAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAR" >&5 -$as_echo "$JAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; - test -n "$JAR" && break -done -test -n "$JAR" || JAR="no" +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; -fi -test "x$JAR" = xno +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test "x$JAVAPREFIX" = x; then - for ac_prog in javah -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_JAVAH+:} false; then : +if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$JAVAH"; then - ac_cv_prog_JAVAH="$JAVAH" # Let the user override the test. + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -10985,7 +10911,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_JAVAH="$ac_prog" + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -10995,43 +10921,37 @@ fi fi -JAVAH=$ac_cv_prog_JAVAH -if test -n "$JAVAH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAH" >&5 -$as_echo "$JAVAH" >&6; } +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$JAVAH" && break -done -test -n "$JAVAH" || JAVAH="no" - -else - for ac_prog in javah -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JAVAH+:} false; then : +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - case $JAVAH in - [\\/]* | ?:[\\/]*) - ac_cv_path_JAVAH="$JAVAH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $JAVAPREFIX + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JAVAH="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11039,160 +10959,93 @@ done IFS=$as_save_IFS - ;; -esac fi -JAVAH=$ac_cv_path_JAVAH -if test -n "$JAVAH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAH" >&5 -$as_echo "$JAVAH" >&6; } +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - - test -n "$JAVAH" && break -done -test -n "$JAVAH" || JAVAH="no" - -fi - -if test x"`eval 'echo $ac_cv_path_JAVAH'`" != xno ; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi - ac_save_CPPFLAGS="$CPPFLAGS" - ac_dir=`echo $ac_cv_path_JAVAH | sed 's,\(.*\)/[^/]*/[^/]*$,\1/include,'` - ac_machdep=`echo $build_os | sed 's,[-0-9].*,,' | sed 's,cygwin,win32,'` - JNIFLAGS="-I$ac_dir -I$ac_dir/$ac_machdep" - CPPFLAGS="$ac_save_CPPFLAGS $JNIFLAGS" +test -z "$DLLTOOL" && DLLTOOL=dlltool - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - CPPFLAGS="$ac_save_CPPFLAGS" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to include " >&5 -$as_echo "$as_me: WARNING: unable to include " >&2;} - JAVAH=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext - CPPFLAGS="$ac_save_CPPFLAGS" -fi -rm -f conftest.err conftest.i conftest.$ac_ext -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $JNIFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether jlong can contain data pointers" >&5 -$as_echo_n "checking whether jlong can contain data pointers... " >&6; } - if test "$cross_compiling" = yes; then : - ac_jlong_can_contain_pointers=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming it cannot" >&5 -$as_echo "assuming it cannot" >&6; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - int - main() { - if (sizeof(jlong) >= sizeof(void*)) - return 0; - else - return 1; - } -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - ac_jlong_can_contain_pointers=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - ac_jlong_can_contain_pointers=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - CPPFLAGS="$ac_save_CPPFLAGS" -fi -# In order to build the Java interface, it must be enabled and all the -# Java tools must be available. -if test x${java_interface_enabled} = xyes \ -&& test "x$JAVA" != xno \ -&& test "x$ac_cv_javac_supports_enums" != xno \ -&& test "x$JAR" != xno \ -&& test "x$JAVAH" != xno \ -&& test x${ac_jlong_can_contain_pointers} = xyes -then - build_java_interface=yes -fi - if test x$build_java_interface = xyes; then - BUILD_JAVA_INTERFACE_TRUE= - BUILD_JAVA_INTERFACE_FALSE='#' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 else - BUILD_JAVA_INTERFACE_TRUE='#' - BUILD_JAVA_INTERFACE_FALSE= + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO -# Allow to specify the ML GMP installation directory. -# Check whether --with-mlgmp was given. -if test "${with_mlgmp+set}" = set; then : - withval=$with_mlgmp; mlgmp_dir=$with_mlgmp -else - mlgmp_dir=+gmp -fi -# Checks for OCaml. -if test x${ocaml_interface_enabled} = xyes -then - # Detect which tools of the OCaml toolchain are available. - # checking for ocamlc - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlc; ac_word=$2 + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLC+:} false; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLC"; then - ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11201,7 +11054,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc" + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11211,28 +11064,32 @@ fi fi -OCAMLC=$ac_cv_prog_OCAMLC -if test -n "$OCAMLC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 -$as_echo "$OCAMLC" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$AR" && break + done fi -if test -z "$ac_cv_prog_OCAMLC"; then - ac_ct_OCAMLC=$OCAMLC - # Extract the first word of "ocamlc", so it can be a program name with args. -set dummy ocamlc; ac_word=$2 +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAMLC"; then - ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11241,7 +11098,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLC="ocamlc" + ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11251,17 +11108,21 @@ fi fi -ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC -if test -n "$ac_ct_OCAMLC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5 -$as_echo "$ac_ct_OCAMLC" >&6; } +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OCAMLC" = x; then - OCAMLC="no" + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" else case $cross_compiling:$ac_tool_warned in yes:) @@ -11269,145 +11130,91 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OCAMLC=$ac_ct_OCAMLC + AR=$ac_ct_AR fi -else - OCAMLC="$ac_cv_prog_OCAMLC" fi +: ${AR=ar} +: ${AR_FLAGS=cru} - if test "$OCAMLC" != "no"; then - OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5 -$as_echo "OCaml version is $OCAMLVERSION" >&6; } - OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5 -$as_echo "OCaml library path is $OCAMLLIB" >&6; } - # checking for ocamlopt - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLOPT"; then - ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OCAMLOPT=$ac_cv_prog_OCAMLOPT -if test -n "$OCAMLOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5 -$as_echo "$OCAMLOPT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_OCAMLOPT"; then - ac_ct_OCAMLOPT=$OCAMLOPT - # Extract the first word of "ocamlopt", so it can be a program name with args. -set dummy ocamlopt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then : + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAMLOPT"; then - ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT -if test -n "$ac_ct_OCAMLOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5 -$as_echo "$ac_ct_OCAMLOPT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } - if test "x$ac_ct_OCAMLOPT" = x; then - OCAMLOPT="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OCAMLOPT=$ac_ct_OCAMLOPT - fi +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= else - OCAMLOPT="$ac_cv_prog_OCAMLOPT" + archiver_list_spec=$lt_cv_ar_at_file fi - OCAMLBEST=byte - if test "$OCAMLOPT" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5 -$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;} - else - TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` - if test "$TMPVERSION" != "$OCAMLVERSION" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5 -$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; } - OCAMLOPT=no - else - OCAMLBEST=opt - fi - fi - # checking for ocamlc.opt - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2 + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLCDOTOPT"; then - ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test. + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11416,7 +11223,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt" + ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11426,10 +11233,10 @@ fi fi -OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT -if test -n "$OCAMLCDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5 -$as_echo "$OCAMLCDOTOPT" >&6; } +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -11437,17 +11244,17 @@ fi -if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then - ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT - # Extract the first word of "ocamlc.opt", so it can be a program name with args. -set dummy ocamlc.opt; ac_word=$2 +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAMLCDOTOPT"; then - ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test. + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11456,7 +11263,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt" + ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11466,17 +11273,17 @@ fi fi -ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT -if test -n "$ac_ct_OCAMLCDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5 -$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; } +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OCAMLCDOTOPT" = x; then - OCAMLCDOTOPT="no" + if test "x$ac_ct_STRIP" = x; then + STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -11484,34 +11291,29 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT + STRIP=$ac_ct_STRIP fi else - OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT" + STRIP="$ac_cv_prog_STRIP" fi - if test "$OCAMLCDOTOPT" != "no"; then - TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` - if test "$TMPVERSION" != "$OCAMLVERSION" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5 -$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; } - else - OCAMLC=$OCAMLCDOTOPT - fi - fi +test -z "$STRIP" && STRIP=: - # checking for ocamlopt.opt - if test "$OCAMLOPT" != "no" ; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2 + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLOPTDOTOPT"; then - ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test. + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11520,7 +11322,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt" + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11530,10 +11332,10 @@ fi fi -OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT -if test -n "$OCAMLOPTDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5 -$as_echo "$OCAMLOPTDOTOPT" >&6; } +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -11541,17 +11343,17 @@ fi -if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then - ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT - # Extract the first word of "ocamlopt.opt", so it can be a program name with args. -set dummy ocamlopt.opt; ac_word=$2 +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAMLOPTDOTOPT"; then - ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test. + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11560,7 +11362,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt" + ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11570,17 +11372,17 @@ fi fi -ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT -if test -n "$ac_ct_OCAMLOPTDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5 -$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; } +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then - OCAMLOPTDOTOPT="no" + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -11588,1363 +11390,668 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT + RANLIB=$ac_ct_RANLIB fi else - OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT" + RANLIB="$ac_cv_prog_RANLIB" fi - if test "$OCAMLOPTDOTOPT" != "no"; then - TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` - if test "$TMPVERSION" != "$OCAMLVERSION" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5 -$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; } - else - OCAMLOPT=$OCAMLOPTDOTOPT - fi - fi - fi +test -z "$RANLIB" && RANLIB=: - fi - # checking for ocamldep - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamldep; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLDEP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLDEP"; then - ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OCAMLDEP=$ac_cv_prog_OCAMLDEP -if test -n "$OCAMLDEP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5 -$as_echo "$OCAMLDEP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OCAMLDEP"; then - ac_ct_OCAMLDEP=$OCAMLDEP - # Extract the first word of "ocamldep", so it can be a program name with args. -set dummy ocamldep; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLDEP"; then - ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLDEP="ocamldep" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= -fi -fi -ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP -if test -n "$ac_ct_OCAMLDEP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5 -$as_echo "$ac_ct_OCAMLDEP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi - if test "x$ac_ct_OCAMLDEP" = x; then - OCAMLDEP="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; esac - OCAMLDEP=$ac_ct_OCAMLDEP - fi -else - OCAMLDEP="$ac_cv_prog_OCAMLDEP" -fi - # checking for ocamlmktop - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLMKTOP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLMKTOP"; then - ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP -if test -n "$OCAMLMKTOP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5 -$as_echo "$OCAMLMKTOP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_OCAMLMKTOP"; then - ac_ct_OCAMLMKTOP=$OCAMLMKTOP - # Extract the first word of "ocamlmktop", so it can be a program name with args. -set dummy ocamlmktop; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLMKTOP"; then - ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP -if test -n "$ac_ct_OCAMLMKTOP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5 -$as_echo "$ac_ct_OCAMLMKTOP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OCAMLMKTOP" = x; then - OCAMLMKTOP="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OCAMLMKTOP=$ac_ct_OCAMLMKTOP - fi -else - OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP" -fi - # checking for ocamlmklib - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLMKLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLMKLIB"; then - ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB -if test -n "$OCAMLMKLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5 -$as_echo "$OCAMLMKLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_OCAMLMKLIB"; then - ac_ct_OCAMLMKLIB=$OCAMLMKLIB - # Extract the first word of "ocamlmklib", so it can be a program name with args. -set dummy ocamlmklib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLMKLIB"; then - ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB -if test -n "$ac_ct_OCAMLMKLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5 -$as_echo "$ac_ct_OCAMLMKLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OCAMLMKLIB" = x; then - OCAMLMKLIB="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OCAMLMKLIB=$ac_ct_OCAMLMKLIB - fi -else - OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB" -fi - # checking for ocamldoc - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLDOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLDOC"; then - ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OCAMLDOC=$ac_cv_prog_OCAMLDOC -if test -n "$OCAMLDOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5 -$as_echo "$OCAMLDOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_OCAMLDOC"; then - ac_ct_OCAMLDOC=$OCAMLDOC - # Extract the first word of "ocamldoc", so it can be a program name with args. -set dummy ocamldoc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLDOC"; then - ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC -if test -n "$ac_ct_OCAMLDOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5 -$as_echo "$ac_ct_OCAMLDOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OCAMLDOC" = x; then - OCAMLDOC="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OCAMLDOC=$ac_ct_OCAMLDOC - fi -else - OCAMLDOC="$ac_cv_prog_OCAMLDOC" -fi - # checking for ocamlbuild - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLBUILD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLBUILD"; then - ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OCAMLBUILD=$ac_cv_prog_OCAMLBUILD -if test -n "$OCAMLBUILD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5 -$as_echo "$OCAMLBUILD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_OCAMLBUILD"; then - ac_ct_OCAMLBUILD=$OCAMLBUILD - # Extract the first word of "ocamlbuild", so it can be a program name with args. -set dummy ocamlbuild; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLBUILD"; then - ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD -if test -n "$ac_ct_OCAMLBUILD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5 -$as_echo "$ac_ct_OCAMLBUILD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OCAMLBUILD" = x; then - OCAMLBUILD="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OCAMLBUILD=$ac_ct_OCAMLBUILD - fi -else - OCAMLBUILD="$ac_cv_prog_OCAMLBUILD" -fi - if test x"$OCAMLC" != xno - then - # Check for the bytecode version of ML GMP. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ML GMP bytecode module gmp.cma" >&5 -$as_echo_n "checking for ML GMP bytecode module gmp.cma... " >&6; } - if ( test ${mlgmp_dir} = +gmp && test -f ${OCAMLLIB}/gmp/gmp.cma ) \ - || test -f ${mlgmp_dir}/gmp.cma; - then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ocamlc_gmp="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ocamlc_gmp="no" - fi - if test x"$OCAMLOPT" != xno - then - ocamlopt_root=`${OCAMLOPT} -where` - # Check for the native version of ML GMP. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ML GMP native module gmp.cmxa" >&5 -$as_echo_n "checking for ML GMP native module gmp.cmxa... " >&6; } - if ( test ${mlgmp_dir} = +gmp && test -f ${ocamlopt_root}/gmp/gmp.cmxa ) \ - || test -f ${mlgmp_dir}/gmp.cmxa; - then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ocamlopt_gmp="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ocamlopt_gmp="no" - fi - fi - fi -fi - if test x$ocamlc_gmp = xyes; then - HAVE_OCAMLC_TRUE= - HAVE_OCAMLC_FALSE='#' -else - HAVE_OCAMLC_TRUE='#' - HAVE_OCAMLC_FALSE= -fi - if test x$ocamlopt_gmp = xyes; then - HAVE_OCAMLOPT_TRUE= - HAVE_OCAMLOPT_FALSE='#' -else - HAVE_OCAMLOPT_TRUE='#' - HAVE_OCAMLOPT_FALSE= -fi -if test x${ocaml_interface_enabled} = xyes \ -&& (test x$ocamlc_gmp = xyes || test x$ocamlopt_gmp = xyes) -then - build_ocaml_interface=yes -fi - if test x$build_ocaml_interface = xyes; then - BUILD_OCAML_INTERFACE_TRUE= - BUILD_OCAML_INTERFACE_FALSE='#' -else - BUILD_OCAML_INTERFACE_TRUE='#' - BUILD_OCAML_INTERFACE_FALSE= -fi -# Checks for Ciao Prolog. -if test x${ciao_prolog_interface_enabled} = xyes -then -# Extract the first word of "ciao", so it can be a program name with args. -set dummy ciao; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ciao_prolog+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ciao_prolog in - [\\/]* | ?:[\\/]*) - ac_cv_path_ciao_prolog="$ciao_prolog" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ciao_prolog="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ciao_prolog=$ac_cv_path_ciao_prolog -if test -n "$ciao_prolog"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ciao_prolog" >&5 -$as_echo "$ciao_prolog" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test x$ciao_prolog != x -then - # Create a temporary directory $tmp in $TMPDIR (default /tmp). - # Use mktemp if possible; otherwise fall back on mkdir, - # with $RANDOM to make collisions less likely. - : ${TMPDIR=/tmp} - { - tmp=` - (umask 077 && mktemp -d "$TMPDIR/ppl_ciao_XXXXXX") 2>/dev/null - ` && - test -n "$tmp" && test -d "$tmp" - } || { - tmp=$TMPDIR/ppl_ciao_$$-$RANDOM - (umask 077 && mkdir "$tmp") - } || exit $? - cat >$tmp/print_include_dir.pl <<_CIAO_PRINT_INCLUDE_DIR_EOF -main(_) :- - ciaolibdir(Lib_Dir), - get_os(Os), - get_arch(Arch), - format("~p/include/~p~p", [Lib_Dir, Os, Arch]). -_CIAO_PRINT_INCLUDE_DIR_EOF - ciao_prolog_include_dir=`$ciao_prolog $tmp/print_include_dir.pl` - rm -rf $tmp - CIAO_PROLOG_INCLUDE_OPTIONS="-I${ciao_prolog_include_dir}" - ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $CIAO_PROLOG_INCLUDE_OPTIONS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_fn_cxx_check_header_mongrel "$LINENO" "ciao_prolog.h" "ac_cv_header_ciao_prolog_h" "$ac_includes_default" -if test "x$ac_cv_header_ciao_prolog_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ciao Prolog version x.y.z or later" >&5 -$as_echo_n "checking for Ciao Prolog version x.y.z or later... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} -#include +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -int -main() { - return 0; -} +# Allow CC to be a program name with arguments. +compiler=$CC -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - ciao_prolog="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 else - ciao_prolog="" -fi - +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - CPPFLAGS="$ac_save_CPPFLAGS" - CIAO_PROLOG="$ciao_prolog" +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac - fi +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -if test x$ciao_prolog != x -then - have_ciao_prolog=yes -else - have_ciao_prolog=no -fi +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" -fi +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac -if test x${ciao_prolog_interface_enabled} = xyes \ -&& test x$have_ciao_prolog = xyes -then - build_ciao_prolog_interface=yes -fi - if test x$build_ciao_prolog_interface = xyes; then - BUILD_CIAO_PROLOG_INTERFACE_TRUE= - BUILD_CIAO_PROLOG_INTERFACE_FALSE='#' -else - BUILD_CIAO_PROLOG_INTERFACE_TRUE='#' - BUILD_CIAO_PROLOG_INTERFACE_FALSE= -fi +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" -# Checks for GNU Prolog. -if test x${gnu_prolog_interface_enabled} = xyes -then - # Extract the first word of "gprolog", so it can be a program name with args. -set dummy gprolog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GNU_PROLOG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GNU_PROLOG"; then - ac_cv_prog_GNU_PROLOG="$GNU_PROLOG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GNU_PROLOG="gprolog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi -done - done -IFS=$as_save_IFS - -fi -fi -GNU_PROLOG=$ac_cv_prog_GNU_PROLOG -if test -n "$GNU_PROLOG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNU_PROLOG" >&5 -$as_echo "$GNU_PROLOG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + # Check to see that the pipe works correctly. + pipe_works=no - if test x"$GNU_PROLOG" = xgprolog - then - ac_fn_cxx_check_header_mongrel "$LINENO" "gprolog.h" "ac_cv_header_gprolog_h" "$ac_includes_default" -if test "x$ac_cv_header_gprolog_h" = xyes; then : + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF -else - GNU_PROLOG="" -fi + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif - fi -fi +#ifdef __cplusplus +extern "C" { +#endif -if test x${gnu_prolog_interface_enabled} = xyes \ -&& test x$GNU_PROLOG = xgprolog -then - build_gnu_prolog_interface=yes -fi - if test x$build_gnu_prolog_interface = xyes; then - BUILD_GNU_PROLOG_INTERFACE_TRUE= - BUILD_GNU_PROLOG_INTERFACE_FALSE='#' -else - BUILD_GNU_PROLOG_INTERFACE_TRUE='#' - BUILD_GNU_PROLOG_INTERFACE_FALSE= -fi +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + cat <<_LT_EOF >> conftest.$ac_ext -# Checks for SICStus. -if test x${sicstus_prolog_interface_enabled} = xyes -then +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; -# Extract the first word of "sicstus", so it can be a program name with args. -set dummy sicstus; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_sicstus_prolog+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $sicstus_prolog in - [\\/]* | ?:[\\/]*) - ac_cv_path_sicstus_prolog="$sicstus_prolog" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_sicstus_prolog="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= fi done - done -IFS=$as_save_IFS - ;; -esac fi -sicstus_prolog=$ac_cv_path_sicstus_prolog -if test -n "$sicstus_prolog"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sicstus_prolog" >&5 -$as_echo "$sicstus_prolog" >&6; } + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi -if test x$sicstus_prolog != x -then - sicstus_prolog_app_dir=`$sicstus_prolog -f --goal "use_module(library(system)), environ('SP_APP_DIR', X), write(X), nl, halt."` - sicstus_prolog_base=`dirname $sicstus_prolog_app_dir` - SICSTUS_PROLOG_INCLUDE_OPTIONS="-I${sicstus_prolog_base}/include" - ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $SICSTUS_PROLOG_INCLUDE_OPTIONS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # We require SICStus Prolog 3.9.1 or later. - ac_fn_cxx_check_header_mongrel "$LINENO" "sicstus/sicstus.h" "ac_cv_header_sicstus_sicstus_h" "$ac_includes_default" -if test "x$ac_cv_header_sicstus_sicstus_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SICStus version 3.9.1 or later" >&5 -$as_echo_n "checking for SICStus version 3.9.1 or later... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #include - #if SICSTUS_MAJOR_VERSION > 3 || (SICSTUS_MAJOR_VERSION == 3 && SICSTUS_MINOR_VERSION > 9) || (SICSTUS_MAJOR_VERSION == 3 && SICSTUS_MINOR_VERSION == 9 && SICSTUS_REVISION_VERSION >= 1) - yes - #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - sicstus_prolog="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f conftest* -else - sicstus_prolog="" -fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - CPPFLAGS="$ac_save_CPPFLAGS" -fi -if test x$sicstus_prolog != x -then - have_sicstus_prolog=yes -else - have_sicstus_prolog=no -fi -fi -if test x${sicstus_prolog_interface_enabled} = xyes \ -&& test x$have_sicstus_prolog = xyes -then - build_sicstus_prolog_interface=yes -fi - if test x$build_sicstus_prolog_interface = xyes; then - BUILD_SICSTUS_PROLOG_INTERFACE_TRUE= - BUILD_SICSTUS_PROLOG_INTERFACE_FALSE='#' -else - BUILD_SICSTUS_PROLOG_INTERFACE_TRUE='#' - BUILD_SICSTUS_PROLOG_INTERFACE_FALSE= -fi -# Checks for SWI-Prolog. -if test x${swi_prolog_interface_enabled} = xyes -then -# Extract the first word of "swipl$EXEEXT", so it can be a program name with args. -set dummy swipl$EXEEXT; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_swi_prolog+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $swi_prolog in - [\\/]* | ?:[\\/]*) - ac_cv_path_swi_prolog="$swi_prolog" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_swi_prolog="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - ;; -esac -fi -swi_prolog=$ac_cv_path_swi_prolog -if test -n "$swi_prolog"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog" >&5 -$as_echo "$swi_prolog" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -if test -z $swi_prolog -then - # Extract the first word of "swi-prolog$EXEEXT", so it can be a program name with args. -set dummy swi-prolog$EXEEXT; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_swi_prolog+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $swi_prolog in - [\\/]* | ?:[\\/]*) - ac_cv_path_swi_prolog="$swi_prolog" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_swi_prolog="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - ;; -esac -fi -swi_prolog=$ac_cv_path_swi_prolog -if test -n "$swi_prolog"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog" >&5 -$as_echo "$swi_prolog" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test -z $swi_prolog - then - # Extract the first word of "pl$EXEEXT", so it can be a program name with args. -set dummy pl$EXEEXT; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_swi_prolog+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $swi_prolog in - [\\/]* | ?:[\\/]*) - ac_cv_path_swi_prolog="$swi_prolog" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_swi_prolog="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - ;; -esac -fi -swi_prolog=$ac_cv_path_swi_prolog -if test -n "$swi_prolog"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog" >&5 -$as_echo "$swi_prolog" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test -z $swi_prolog - then - # Extract the first word of "plcon$EXEEXT", so it can be a program name with args. -set dummy plcon$EXEEXT; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_swi_prolog+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $swi_prolog in - [\\/]* | ?:[\\/]*) - ac_cv_path_swi_prolog="$swi_prolog" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_swi_prolog="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - ;; -esac -fi -swi_prolog=$ac_cv_path_swi_prolog -if test -n "$swi_prolog"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog" >&5 -$as_echo "$swi_prolog" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + with_sysroot=no fi - fi - fi -fi -if test x$swi_prolog != x -then - swi_prolog_base=`$swi_prolog -dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\([a-z]:\)\{0,1\}\(.*\)";.*/\2/'` - swi_prolog_version=`$swi_prolog -dump-runtime-variables | grep PLVERSION= | sed 's/PLVERSION="\(.*\)";.*/\1/'` - swi_prolog_arch=`$swi_prolog -dump-runtime-variables | grep PLARCH= | sed 's/PLARCH="\(.*\)";.*/\1/'` - swi_prolog_libs=`$swi_prolog -dump-runtime-variables | grep PLLIBS= | sed 's/PLLIBS="\(.*\)";.*/\1/'` - swi_prolog_lib=`$swi_prolog -dump-runtime-variables | grep PLLIB= | sed 's/PLLIB="\(.*\)";.*/\1/'` +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } - # Extract the first word of "swipl-ld$EXEEXT", so it can be a program name with args. -set dummy swipl-ld$EXEEXT; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_swi_prolog_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $swi_prolog_ld in - [\\/]* | ?:[\\/]*) - ac_cv_path_swi_prolog_ld="$swi_prolog_ld" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_swi_prolog_ld="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - ;; -esac -fi -swi_prolog_ld=$ac_cv_path_swi_prolog_ld -if test -n "$swi_prolog_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog_ld" >&5 -$as_echo "$swi_prolog_ld" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test -z $swi_prolog_ld - then - # Extract the first word of "plld$EXEEXT", so it can be a program name with args. -set dummy plld$EXEEXT; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_swi_prolog_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $swi_prolog_ld in - [\\/]* | ?:[\\/]*) - ac_cv_path_swi_prolog_ld="$swi_prolog_ld" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_swi_prolog_ld="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - ;; -esac -fi -swi_prolog_ld=$ac_cv_path_swi_prolog_ld -if test -n "$swi_prolog_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog_ld" >&5 -$as_echo "$swi_prolog_ld" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; fi +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi fi + rm -rf conftest* + ;; - # In Fedora, SWI-Prolog.h is installed only in /usr/include/pl, which, - # IMHO, is a bug (https://bugzilla.redhat.com/show_bug.cgi?id=471071). - SWI_PROLOG_INCLUDE_OPTIONS="-I${swi_prolog_base}/include -I/usr/include/pl" - # If SWI-Prolog was configured with `--disable-libdirversion', then - # the files are not in the `${swi_prolog_arch}' subdirectory. Since - # currently there is no way to know that, we look in both places. - SWI_PROLOG_LD_OPTIONS="-L${swi_prolog_base}/lib/${swi_prolog_arch} -L${swi_prolog_base}/lib ${swi_prolog_lib} ${swi_prolog_libs}" - ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $SWI_PROLOG_INCLUDE_OPTIONS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; - # We require SWI-Prolog 5.6.0 or later. - ac_fn_cxx_check_header_mongrel "$LINENO" "SWI-Prolog.h" "ac_cv_header_SWI_Prolog_h" "$ac_includes_default" -if test "x$ac_cv_header_SWI_Prolog_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SWI-Prolog version 5.6.0 or later" >&5 -$as_echo_n "checking for SWI-Prolog version 5.6.0 or later... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -#include + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ int -main() { -#if !defined(PLVERSION) || PLVERSION < 50600 - choke me -#endif +main () +{ ; return 0; } - _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - swi_prolog="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - swi_prolog="" -fi - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CPPFLAGS="$ac_save_CPPFLAGS" - SWI_PROLOG="$swi_prolog" - SWI_PROLOG_LD="$swi_prolog_ld" - - - - -fi - -if test x$swi_prolog != x -then - have_swi_prolog=yes +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes else - have_swi_prolog=no -fi - + lt_cv_cc_needs_belf=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Under Cygwin, SWI-Prolog does not work with foreign code: -# see http://www.cs.unipr.it/pipermail/ppl-devel/2006-January/007838.html -if test x${swi_prolog_interface_enabled} = xyes \ -&& test x$have_swi_prolog = xyes \ -&& test x"${host_os}" != xcygwin -then - build_swi_prolog_interface=yes -fi - if test x$build_swi_prolog_interface = xyes; then - BUILD_SWI_PROLOG_INTERFACE_TRUE= - BUILD_SWI_PROLOG_INTERFACE_FALSE='#' -else - BUILD_SWI_PROLOG_INTERFACE_TRUE='#' - BUILD_SWI_PROLOG_INTERFACE_FALSE= fi - - -# Checks for XSB. -if test x${xsb_prolog_interface_enabled} = xyes -then - -# Extract the first word of "xsb", so it can be a program name with args. -set dummy xsb; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_xsb_prolog+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $xsb_prolog in - [\\/]* | ?:[\\/]*) - ac_cv_path_xsb_prolog="$xsb_prolog" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_xsb_prolog="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" fi -done - done -IFS=$as_save_IFS - ;; -esac -fi -xsb_prolog=$ac_cv_path_xsb_prolog -if test -n "$xsb_prolog"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsb_prolog" >&5 -$as_echo "$xsb_prolog" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test x$xsb_prolog != x -then - xsb_emu_dir=`xsb --nobanner --quietload --noprompt \ - -e "write('emudir='), \ - xsb_configuration(emudir, X), write(X), nl, halt." \ - 2>/dev/null | sed "s/^emudir=//g"` - xsb_config_dir=`xsb --nobanner --quietload --noprompt \ - -e "write('config_dir='), \ - xsb_configuration(config_dir,X), write(X), nl, halt." \ - 2>/dev/null | sed "s/^config_dir=//g"` - XSB_PROLOG_INCLUDE_OPTIONS="-I${xsb_emu_dir} -I${xsb_config_dir}" +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac -fi +need_locks="$enable_libtool_lock" -if test x$xsb_prolog != x -then - have_xsb_prolog=yes +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 else - have_xsb_prolog=no -fi + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi - -if test x${xsb_prolog_interface_enabled} = xyes \ -&& test x$have_xsb_prolog = xyes -then - build_xsb_prolog_interface=yes fi - if test x$build_xsb_prolog_interface = xyes; then - BUILD_XSB_PROLOG_INTERFACE_TRUE= - BUILD_XSB_PROLOG_INTERFACE_FALSE='#' +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } else - BUILD_XSB_PROLOG_INTERFACE_TRUE='#' - BUILD_XSB_PROLOG_INTERFACE_FALSE= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -# Checks for YAP. -if test x${yap_prolog_interface_enabled} = xyes -then - -# Extract the first word of "yap", so it can be a program name with args. -set dummy yap; ac_word=$2 +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_yap_prolog+:} false; then : +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else - case $yap_prolog in - [\\/]* | ?:[\\/]*) - ac_cv_path_yap_prolog="$yap_prolog" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_yap_prolog="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12952,352 +12059,294 @@ done IFS=$as_save_IFS - ;; -esac fi -yap_prolog=$ac_cv_path_yap_prolog -if test -n "$yap_prolog"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $yap_prolog" >&5 -$as_echo "$yap_prolog" >&6; } +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - -if test x$yap_prolog != x -then - - YAP_PROLOG_INCLUDE_OPTIONS="" - YAP_PROLOG_LD_OPTIONS="-lYap" - ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $YAP_PROLOG_INCLUDE_OPTIONS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - # Check for YAP's foreign language interface header file. - ac_fn_cxx_check_header_mongrel "$LINENO" "Yap/c_interface.h" "ac_cv_header_Yap_c_interface_h" "$ac_includes_default" -if test "x$ac_cv_header_Yap_c_interface_h" = xyes; then : - + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi else - yap_prolog="" + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - CPPFLAGS="$ac_save_CPPFLAGS" - YAP_PROLOG="$yap_prolog" -fi -if test x$yap_prolog != x -then - have_yap_prolog=yes + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 else - have_yap_prolog=no -fi + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi - -if test x${yap_prolog_interface_enabled} = xyes \ -&& test x$have_yap_prolog = xyes -then - build_yap_prolog_interface=yes fi - if test x$build_yap_prolog_interface = xyes; then - BUILD_YAP_PROLOG_INTERFACE_TRUE= - BUILD_YAP_PROLOG_INTERFACE_FALSE='#' +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } else - BUILD_YAP_PROLOG_INTERFACE_TRUE='#' - BUILD_YAP_PROLOG_INTERFACE_FALSE= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -# Test if some Prolog interfaces have to be built. -if test x$build_ciao_prolog_interface = xyes \ -|| test x$build_gnu_prolog_interface = xyes \ -|| test x$build_sicstus_prolog_interface = xyes \ -|| test x$build_swi_prolog_interface = xyes \ -|| test x$build_xsb_prolog_interface = xyes \ -|| test x$build_yap_prolog_interface = xyes -then - build_some_prolog_interfaces=yes fi - if test x$build_some_prolog_interfaces = xyes; then - BUILD_SOME_PROLOG_INTERFACES_TRUE= - BUILD_SOME_PROLOG_INTERFACES_FALSE='#' +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 else - BUILD_SOME_PROLOG_INTERFACES_TRUE='#' - BUILD_SOME_PROLOG_INTERFACES_FALSE= -fi + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -if test x$build_c_interface = xyes \ -|| test x$build_java_interface = xyes \ -|| test x$build_ocaml_interface = xyes \ -|| test x$build_some_prolog_interfaces = xyes -then - # Look for a recent enough version of GNU M4. + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU M4 that supports accurate traces" >&5 -$as_echo_n "checking for GNU M4 that supports accurate traces... " >&6; } -if ${ac_cv_path_M4+:} false; then : + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else - rm -f conftest.m4f -if test -z "$M4"; then - ac_path_M4_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in m4 gm4 gnum4; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_M4="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_M4" || continue - # Root out GNU M4 1.4.4, as well as non-GNU m4 that ignore -t, -F. - ac_snippet=change'quote(<,>)in''dir(,mac,bug)d'nl - test -z "`$ac_path_M4 -F conftest.m4f &1`" \ - && test -z "`echo $ac_snippet | $ac_path_M4 --trace=mac 2>&1`" \ - && test -f conftest.m4f \ - && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=: - rm -f conftest.m4f - $ac_path_M4_found && break 3 - done - done + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_M4"; then - as_fn_error $? "no acceptable m4 could be found in \$PATH. -GNU M4 1.4.5 or later is required; 1.4.11 or later is recommended" "$LINENO" 5 - fi -else - ac_cv_path_M4=$M4 -fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_M4" >&5 -$as_echo "$ac_cv_path_M4" >&6; } - M4=$ac_cv_path_M4 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how m4 supports trace files" >&5 -$as_echo_n "checking how m4 supports trace files... " >&6; } -if ${ac_cv_prog_gnu_m4_debugfile+:} false; then : - $as_echo_n "(cached) " >&6 +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } else - case `$M4 --help < /dev/null 2>&1` in - *debugfile*) ac_cv_prog_gnu_m4_debugfile=--debugfile ;; - *) ac_cv_prog_gnu_m4_debugfile=--error-output ;; - esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gnu_m4_debugfile" >&5 -$as_echo "$ac_cv_prog_gnu_m4_debugfile" >&6; } - M4_DEBUGFILE=$ac_cv_prog_gnu_m4_debugfile - -fi -# Define the list of instantiations that are enabled by default. -# Different instantiations are separated by a '@' character. -di=" Polyhedron @ Grid" -di="${di} @ Rational_Box" -di="${di} @ BD_Shape @ BD_Shape" -di="${di} @ Octagonal_Shape @ Octagonal_Shape" -di="${di} @ Constraints_Product" -di="${di} @ Pointset_Powerset" -di="${di} @ Pointset_Powerset" -if test $ac_supported_double = 1 -then - di="${di} @ Double_Box @ BD_Shape @ Octagonal_Shape" fi -default_instantiations="${di}" +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -# Define the list of all instantiations. -# Different instantiations are separated by a '@' character. -ai=" Int8_Box @ Int16_Box @ Int32_Box @ Int64_Box" -ai="${ai} @ Uint8_Box @ Uint16_Box @ Uint32_Box @ Uint64_Box" -ai="${ai} @ Z_Box @ Rational_Box" -ai="${ai} @ BD_Shape @ BD_Shape" -ai="${ai} @ BD_Shape @ BD_Shape" -ai="${ai} @ BD_Shape @ BD_Shape" -ai="${ai} @ Octagonal_Shape @ Octagonal_Shape" -ai="${ai} @ Octagonal_Shape @ Octagonal_Shape" -ai="${ai} @ Octagonal_Shape @ Octagonal_Shape" -ai="${ai} @ Polyhedron @ Grid" -ai="${ai} @ Pointset_Powerset @ Pointset_Powerset" -ai="${ai} @ Pointset_Powerset @ Pointset_Powerset" -ai="${ai} @ Pointset_Powerset @ Pointset_Powerset" -ai="${ai} @ Pointset_Powerset @ Pointset_Powerset" -ai="${ai} @ Pointset_Powerset @ Pointset_Powerset" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset >" -ai="${ai} @ Pointset_Powerset" -ai="${ai} @ Pointset_Powerset" -ai="${ai} @ Pointset_Powerset" -ai="${ai} @ Constraints_Product" -ai="${ai} @ Constraints_Product" -ai="${ai} @ Constraints_Product" -ai="${ai} @ Constraints_Product" -if test $ac_supported_float = 1 -then - ai="${ai} @ Float_Box @ BD_Shape" - ai="${ai} @ Octagonal_Shape" - ai="${ai} @ Pointset_Powerset" - ai="${ai} @ Pointset_Powerset >" - ai="${ai} @ Pointset_Powerset >" fi -if test $ac_supported_double = 1 -then - ai="${ai} @ Double_Box @ BD_Shape" - ai="${ai} @ Octagonal_Shape" - ai="${ai} @ Pointset_Powerset" - ai="${ai} @ Pointset_Powerset >" - ai="${ai} @ Pointset_Powerset >" fi -if test $ac_supported_long_double = 1 -then - ai="${ai} @ Long_Double_Box @ BD_Shape" - ai="${ai} @ Octagonal_Shape" - ai="${ai} @ Pointset_Powerset" - ai="${ai} @ Pointset_Powerset >" - ai="${ai} @ Pointset_Powerset >" +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -available_instantiations=${ai} -enableval=not_specified -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which instantiations are enabled" >&5 -$as_echo_n "checking which instantiations are enabled... " >&6; } -# Check whether --enable-instantiations was given. -if test "${enable_instantiations+set}" = set; then : - enableval=$enable_instantiations; + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" fi -case x"${enableval}" in -xyes | x) - ai_one_per_line=`echo "${available_instantiations}" | sed -e 's/ *@ */\n/g' -e 's/ *\([A-Z]\)/\1/g'` - as_fn_error $? " ---enable-instantiations needs at least one argument chosen among none, -all, and an @-separated list of instantiation specifiers included -in the following list: -${ai_one_per_line}" "$LINENO" 5 - ;; -xno | xnone) - enableval= - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } - ;; -*) - if test x"${enableval}" = xnot_specified - then - enableval=${default_instantiations} - elif test x"${enableval}" = xall - then - enableval=${available_instantiations} + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - # Avoid extra blanks. - required_instantiations=`echo "${enableval}" | sed -e 's/[ ][ ]*/ /g' -e 's/[ ]*\([@<>,]\)/\1/g' -e 's/\([@<>,]\)[ ]*/\1/g' -e 's/>>/> >/g' -e 's/^[ ]//g' -e 's/[ ]$//g'` - # Check the specified instantiations for validity. - ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I${srcdir} ${gmp_include_options}" - old_IFS="${IFS}" - IFS=@ - set -- ${required_instantiations} - IFS="${old_IFS}" - for instantiation - do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include "instchk.hh" - -using namespace Parma_Polyhedra_Library; - -bool valid = ${instantiation}::valid_instantiation(); +done + done +IFS=$as_save_IFS -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - valid_instantiation=yes +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } else - valid_instantiation=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test x${valid_instantiation} != xyes - then - as_fn_error $? "invalid instantiation ${instantiation}" "$LINENO" 5 - fi - done - CPPFLAGS="$ac_save_CPPFLAGS" - required_instantiations_canonical_names=`echo "${required_instantiations}" | sed -e 's/> //g' -e 's/>//g' -e 's/[< ,]/_/g'` - - required_instantiations_c_source_names=`echo "${required_instantiations_canonical_names}" | sed -e 's/@Pointset_Powerset_Polyhedron/@Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g' -e 's/^Pointset_Powerset_Polyhedron/Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g'` - required_instantiations_c_cxx_objects=`echo "${required_instantiations_c_source_names}" | sed -e 's/@/.lo /g' -e 's/$/.lo/g' | sed -e 's/\([^. ]*\)\.lo/ppl_c_\1.lo/g'` - required_instantiations_c_cxx_sources=`echo "${required_instantiations_c_cxx_objects}" | sed -e 's/\([^. ]*\)\.lo/\1.cc/g'` - required_instantiations_c_cxx_headers=`echo "${required_instantiations_c_cxx_sources}" | sed -e 's/\.cc/.hh/g'` - - required_instantiations_prolog_source_names=`echo "${required_instantiations_canonical_names}" | sed -e 's/@Pointset_Powerset_Polyhedron/@Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g' -e 's/^Pointset_Powerset_Polyhedron/Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g'` - required_instantiations_prolog_cxx_objects=`echo "${required_instantiations_prolog_source_names}" | sed -e 's/@/.lo /g' -e 's/$/.lo/g' | sed -e 's/\([^. ]*\)\.lo/ppl_prolog_\1.lo/g'` - required_instantiations_prolog_cxx_sources=`echo "${required_instantiations_prolog_cxx_objects}" | sed -e 's/\([^. ]*\)\.lo/\1.cc/g'` - required_instantiations_prolog_cxx_headers=`echo "${required_instantiations_prolog_cxx_sources}" | sed -e 's/\.cc/.hh/g'` - required_instantiations_prolog_generated_test_sources=`echo "${required_instantiations_prolog_source_names}" | sed -e 's/@/.pl /g' -e 's/$/.pl/g' | sed -e 's/\([^. ]*\)\.pl/ppl_prolog_generated_test_\1.pl/g'` - - required_instantiations_java_source_names=`echo "${required_instantiations_canonical_names}" | sed -e 's/^Polyhedron/Polyhedron@C_Polyhedron@NNC_Polyhedron/g' -e 's/@Polyhedron/@Polyhedron@C_Polyhedron@NNC_Polyhedron/g' -e 's/@Pointset_Powerset_Polyhedron/@Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g' -e 's/^Pointset_Powerset_Polyhedron/Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g' | sed -e 's/Pointset_Powerset_[a-zA-Z0-9_]*/&@&_Iterator/g'` - required_instantiations_java_sources=`echo "${required_instantiations_java_source_names}" | sed -e 's/@/.java /g' -e 's/$/.java/g'` - required_instantiations_java_classes=`echo "${required_instantiations_java_sources}" | sed -e 's/\.java/.class/g'` - required_instantiations_java_cxx_headers=`echo "${required_instantiations_java_sources}" | sed -e 's/\([^. ]*\)\.java/parma_polyhedra_library.\1/g'` - required_instantiations_java_cxx_headers_sources=`echo "${required_instantiations_java_sources}" | sed -e 's/\([^. ]*\)\.java/parma_polyhedra_library_\1.h/g'` - required_instantiations_java_cxx_objects=`echo "${required_instantiations_canonical_names}" | sed -e 's/@/.lo /g' -e 's/$/.lo/g' | sed -e 's/\([^. ]*\)\.lo/ppl_java_\1.lo/g'` - required_instantiations_java_cxx_sources=`echo "${required_instantiations_java_cxx_objects}" | sed -e 's/\([^. ]*\)\.lo/\1.cc/g'` - - required_instantiations_ocaml_source_names=`echo "${required_instantiations_canonical_names}" | sed -e 's/@Pointset_Powerset_Polyhedron/@Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g' -e 's/^Pointset_Powerset_Polyhedron/Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g'` - required_instantiations_ocaml_cxx_objects=`echo "${required_instantiations_ocaml_source_names}" | sed -e 's/@/.o /g' -e 's/$/.o/g' | sed -e 's/\([^. ]*\)\.o/ppl_ocaml_\1.o/g'` - required_instantiations_ocaml_cxx_sources=`echo "${required_instantiations_ocaml_cxx_objects}" | sed -e 's/\([^. ]*\)\.o/\1.cc/g'` - required_instantiations_ocaml_cxx_headers=`echo "${required_instantiations_ocaml_cxx_sources}" | sed -e 's/\.cc/.hh/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${required_instantiations}" >&5 -$as_echo "${required_instantiations}" >&6; } - ;; -esac -enableval=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tests should be run under Valgrind" >&5 -$as_echo_n "checking whether tests should be run under Valgrind... " >&6; } -# Check whether --enable-valgrind-tests was given. -if test "${enable_valgrind_tests+set}" = set; then : - enableval=$enable_valgrind_tests; fi - -case "${enableval}" in -yes) - # Extract the first word of "valgrind", so it can be a program name with args. -set dummy valgrind; ac_word=$2 +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_VALGRIND+:} false; then : +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$VALGRIND"; then - ac_cv_prog_VALGRIND="$VALGRIND" # Let the user override the test. + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -13306,7 +12355,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_VALGRIND="valgrind" + ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -13316,240 +12365,213 @@ fi fi -VALGRIND=$ac_cv_prog_VALGRIND -if test -n "$VALGRIND"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VALGRIND" >&5 -$as_echo "$VALGRIND" >&6; } +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - - if test x"$VALGRIND" = xvalgrind - then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - enable_valgrind_tests=yes + if test "x$ac_ct_LIPO" = x; then + LIPO=":" else - as_fn_error $? "bad value ${enableval} for --enable-valgrind-tests, cannot find Valgrind" "$LINENO" 5 - fi - ;; -no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - enable_valgrind_tests=no - ;; -*) - as_fn_error $? "bad value ${enableval} for --enable-valgrind-tests, needs yes or no" "$LINENO" 5 - ;; + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac - if test x"$enable_valgrind_tests" = xyes; then - VALGRIND_TESTS_ENABLED_TRUE= - VALGRIND_TESTS_ENABLED_FALSE='#' + LIPO=$ac_ct_LIPO + fi else - VALGRIND_TESTS_ENABLED_TRUE='#' - VALGRIND_TESTS_ENABLED_FALSE= + LIPO="$ac_cv_prog_LIPO" fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -enableval=quick -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`make check' does a thorough or quick check" >&5 -$as_echo_n "checking whether \`make check' does a thorough or quick check... " >&6; } -# Check whether --enable-check was given. -if test "${enable_check+set}" = set; then : - enableval=$enable_check; fi - -case "${enableval}" in -thorough) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: thorough" >&5 -$as_echo "thorough" >&6; } - ;; -quick) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: quick" >&5 -$as_echo "quick" >&6; } - ;; -*) - as_fn_error $? "bad value ${enableval} for --enable-check, needs thorough or quick" "$LINENO" 5 - ;; -esac - if test x"$enableval" = xthorough; then - THOROUGH_MAKE_CHECK_TRUE= - THOROUGH_MAKE_CHECK_FALSE='#' +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } else - THOROUGH_MAKE_CHECK_TRUE='#' - THOROUGH_MAKE_CHECK_FALSE= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -# Libtool. +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - - - - - - - - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } else - ac_cv_path_SED=$SED + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" @@ -13561,10 +12583,6 @@ -test -z "$GREP" && GREP=grep - - - @@ -13581,524 +12599,316 @@ -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi fi -if ${lt_cv_path_LD+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi + lt_cv_ld_exported_symbols_list=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" -LD="$lt_cv_path_LD" -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF +fi +done +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 + + +# Set options +enable_dlopen=yes + + + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi + enable_shared=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - test -n "$ac_ct_DUMPBIN" && break -done - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; *) - DUMPBIN=: + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" ;; esac - fi - - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi +else + enable_static=yes fi -test -z "$NM" && NM=nm -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + pic_mode=default fi -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring="ABCD" - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; +test -z "$pic_mode" && pic_mode=default - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + IFS="$lt_save_ifs" + ;; + esac else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + enable_fast_install=yes fi -max_cmd_len=$lt_cv_sys_max_cmd_len -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac @@ -14108,447 +12918,278 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac -fi -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -fi -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac +test -z "$LN_S" && LN_S="ln -s" + -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" +rmdir .libs 2>/dev/null fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES fi ;; +esac -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; +# Global variables: +ofile=libtool +can_build_shared=yes -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; +with_gnu_ld="$lt_cv_prog_gnu_ld" -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; +old_CC="$CC" +old_CFLAGS="$CFLAGS" -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; esac - ;; +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" ;; +esac +fi -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org -tpf*) - lt_cv_deplibs_check_method=pass_all +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac +fi +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac + + else + MAGIC_CMD=: + fi fi -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +# Source file extension for C test sources. +ac_ext=c +# Object file extension for compiled C test sources. +objext=o +objext=$objext +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' @@ -14556,1695 +13197,1925 @@ +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +# Allow CC to be a program name with arguments. +compiler=$CC +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then +lt_prog_compiler_no_builtin_flag= +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + : fi - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" fi -test -z "$DLLTOOL" && DLLTOOL=dlltool - - + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; - test -n "$ac_ct_AR" && break -done + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; -: ${AR=ar} -: ${AR_FLAGS=cru} + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; -int -main () -{ + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac else - archiver_list_spec=$lt_cv_ar_at_file + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no fi +fi -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : else - STRIP="$ac_cv_prog_STRIP" + lt_prog_compiler_static= fi -test -z "$STRIP" && STRIP=: -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } -test -z "$RANLIB" && RANLIB=: + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + ld_shlibs=yes + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. +_LT_EOF + fi + ;; + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac -# Allow CC to be a program name with arguments. -compiler=$CC + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' +int +main () +{ -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +fi -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + aix_libpath=$lt_cv_aix_libpath_ +fi -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do +int +main () +{ - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - # Check to see that the pipe works correctly. - pipe_works=no +fi - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF + aix_libpath=$lt_cv_aix_libpath_ +fi - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi fi + ;; - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; - cat <<_LT_EOF >> conftest.$ac_ext + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; + darwin* | rhapsody*) -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break else - lt_cv_sys_global_symbol_pipe= + whole_archive_flag_spec='' fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + else + ld_shlibs=no + fi + ;; + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 else - with_sysroot=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi ;; esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; + link_all_deplibs=yes + ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; - esac - fi - rm -rf conftest* - ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; -int -main () -{ + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi ;; - esac - fi - rm -rf conftest* - ;; -esac -need_locks="$enable_libtool_lock" + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + *) + ld_shlibs=no + ;; + esac -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi +with_gnu_ld=$with_gnu_ld -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + ;; +esac -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi @@ -16272,202 +15143,22 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF -fi -done -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf -# Set options -enable_dlopen=yes - enable_win32_dll=no - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi @@ -16477,28 +15168,6 @@ - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi @@ -16509,30 +15178,8 @@ -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - pic_mode=default -fi -test -z "$pic_mode" && pic_mode=default @@ -16540,28 +15187,6 @@ - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes -fi @@ -16573,11 +15198,7 @@ -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -16608,7 +15229,6 @@ -test -z "$LN_S" && LN_S="ln -s" @@ -16623,340 +15243,762 @@ -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown case $host_os in aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH fi ;; -esac -# Global variables: -ofile=libtool -can_build_shared=yes +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; -with_gnu_ld="$lt_cv_prog_gnu_ld" +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; -old_CC="$CC" -old_CFLAGS="$CFLAGS" +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' -_LT_EOF - fi ;; - esac + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` else - MAGIC_CMD=: - fi -fi - + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac ;; -esac -# Use C for the default configuration in the libtool script +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir +fi + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi -# Allow CC to be a program name with arguments. -compiler=$CC + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; -lt_prog_compiler_no_builtin_flag= +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; esac + ;; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi @@ -16964,381 +16006,43 @@ - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi -fi @@ -17350,46 +16054,8 @@ -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi @@ -17397,1299 +16063,629 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - ld_shlibs=yes - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); int main () { - +return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes - aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" else - if ${lt_cv_aix_libpath_+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); int main () { - +return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - aix_libpath=$lt_cv_aix_libpath_ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; +fi - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - darwin* | rhapsody*) +fi - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' +fi + + +fi + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes else - whole_archive_flag_spec='' + enable_dlopen=no fi - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - else - ld_shlibs=no - fi + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - ;; + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; +#if HAVE_DLFCN_H +#include +#endif - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; +#include - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: +#if HAVE_DLFCN_H +#include +#endif - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' +#include - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" +rm -fr conftest* + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac - *nto* | *qnx*) - ;; + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - *) - ld_shlibs=no - ;; - esac - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no -with_gnu_ld=$with_gnu_ld @@ -18700,170 +16696,424 @@ + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +CC="$lt_save_CC" + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + done + ac_cv_prog_CXXCPP=$CXXCPP +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +else + _lt_caught_CXX_error=yes +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no +# Source file extension for C++ test sources. +ac_ext=cpp +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + # ltmain only uses $CC for tagged configurations so make sure $CC is set. +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +# Allow CC to be a program name with arguments. +compiler=$CC + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + if test "$GXX" = yes; then + # Set up default GNU C++ configuration +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld @@ -18871,865 +17121,1254 @@ + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + GXX=no + with_gnu_ld=no + wlarc= + fi + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='${wl}-f,' + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + export_dynamic_flag_spec_CXX='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi +fi + aix_libpath=$lt_cv_aix_libpath__CXX +fi + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi +fi + aix_libpath=$lt_cv_aix_libpath__CXX +fi + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi + else + ld_shlibs_CXX=no + fi + ;; + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object_CXX=yes -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; + hardcode_libdir_separator_CXX=: -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no + output_verbose_link_cmd='func_echo_all' - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' -int -main () -{ + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' -fi + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test "$ld_shlibs_CXX" = no && can_build_shared=no + GCC_CXX="$GXX" + LD_CXX="$LD" + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + prev= + ;; + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + *) ;; # Ignore the rest. + esac + done + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi @@ -19761,557 +18400,1437 @@ + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes + freebsd2.*) + shlibpath_overrides_runpath=yes ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes ;; + esac + ;; - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; -fi +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= ;; - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); int main () { -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi - - -fi - - -fi - + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir fi - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' fi -fi -rm -fr conftest* + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; -#if HAVE_DLFCN_H -#include -#endif +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; -#include +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif +rdos*) + dynamic_linker=no + ;; -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; esac - else : - # compilation failed - lt_cv_dlopen_self_static=no fi -fi -rm -fr conftest* - + sys_lib_dlsearch_path_spec='/usr/lib' + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi @@ -20328,40 +19847,6 @@ -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - @@ -20369,194 +19854,78 @@ - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -CC="$lt_save_CC" - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - done - ac_cv_prog_CXXCPP=$CXXCPP -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test "X$hardcode_automatic_CXX" = "Xyes" ; then + # We can hardcode non-existent directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi else - # Broken: fails on valid input. -continue + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported fi -rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break +if test "$hardcode_action_CXX" = relink || + test "$inherit_rpath_CXX" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -else - _lt_caught_CXX_error=yes -fi + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -20564,3084 +19933,5370 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -compiler_needs_object_CXX=no -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_direct_absolute_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -inherit_rpath_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -reload_flag_CXX=$reload_flag -reload_cmds_CXX=$reload_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[]) { return(0); }' - # ltmain only uses $CC for tagged configurations so make sure $CC is set. -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Allow CC to be a program name with arguments. -compiler=$CC - # save warnings/boilerplate of simple test code - ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - compiler_CXX=$CC - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + ac_config_commands="$ac_config_commands libtool" - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' - else - lt_prog_compiler_no_builtin_flag_CXX= - fi - if test "$GXX" = yes; then - # Set up default GNU C++ configuration +# Only expand once: -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes + if test x"$enable_shared" = xyes; then + ENABLE_SHARED_TRUE= + ENABLE_SHARED_FALSE='#' else - with_gnu_ld=no + ENABLE_SHARED_TRUE='#' + ENABLE_SHARED_FALSE= fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + if test x"$enable_static" = xyes; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE='#' else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + ENABLE_STATIC_TRUE='#' + ENABLE_STATIC_FALSE= fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$as_me: creating $CONFIG_LT" >&6;} +as_write_fail=0 +cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>"$CONFIG_LT" <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi -LD="$lt_cv_path_LD" -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 /dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit - else - GXX=no - with_gnu_ld=no - wlarc= - fi +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append - # PORTME: fill in a description of your system's C++ link characteristics - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - ld_shlibs_CXX=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - file_list_spec_CXX='${wl}-f,' +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` - export_dynamic_flag_spec_CXX='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false fi - aix_libpath=$lt_cv_aix_libpath__CXX -fi - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +exec 6>&1 +## --------------------------------- ## +## Main body of "$CONFIG_LT" script. ## +## --------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x "$CONFIG_LT" -int -main () +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec 5>>config.log { + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $0 [OPTIONS] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +the Parma Polyhedra Library config.lt 1.2 +configured by $0, generated by GNU Autoconf 2.69. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +while test $# != 0 +do + case $1 in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) as_fn_error $? "unrecognized option: $1 +Try \`$0 --help' for more information." "$LINENO" 5 ;; + + *) as_fn_error $? "unrecognized argument: $1 +Try \`$0 --help' for more information." "$LINENO" 5 ;; + esac + shift +done + +if $lt_cl_silent; then + exec 6>/dev/null fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' -fi +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' - aix_libpath=$lt_cv_aix_libpath__CXX -fi +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - fi - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_CXX=no - fi - ;; +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_CXX=' ' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=yes - file_list_spec_CXX='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' - enable_shared_with_static_runtimes_CXX=yes - # Don't use ranlib - old_postinstall_cmds_CXX='chmod 644 $oldlib' - postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - esac - ;; - darwin* | rhapsody*) + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec_CXX='' - fi - link_all_deplibs_CXX=yes - allow_undefined_flag_CXX="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - if test "$lt_cv_apple_cc_single_mod" != "yes"; then - archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + + + +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 +$as_echo "$as_me: creating $ofile" >&6;} + + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST fi - else - ld_shlibs_CXX=no - fi + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" - ;; + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; +# The names of the tagged configurations supported by this script. +available_tags="CXX " - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; +# ### BEGIN LIBTOOL CONFIG - gnu*) - ;; +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision - haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs_CXX=yes - ;; +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. +# Whether or not to build static libraries. +build_old_libs=$enable_static - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; +# What type of objects to build. +pic_mode=$pic_mode - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; +# An echo program that protects backslashes. +ECHO=$lt_ECHO - interix[3-9]*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - inherit_rpath_CXX=yes - ;; +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler +# An ERE matcher. +EGREP=$lt_EGREP - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' +# A literal string matcher. +FGREP=$lt_FGREP - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' +# A BSD- or MS-compatible name lister. +NM=$lt_NM - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [1-5].* | *pgcpp\ [1-5].*) - prelink_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - old_archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac +# Whether we need soft or hard links. +LN_S=$lt_LN_S - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: +# Object file suffix (normally "o"). +objext=$ac_objext - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object_CXX=yes +# Executable file suffix (normally ""). +exeext=$exeext - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' +# whether the shell understands "unset". +lt_unset=$lt_unset - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP - *nto* | *qnx*) - ld_shlibs_CXX=yes - ;; +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - hardcode_direct_absolute_CXX=yes - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - ld_shlibs_CXX=no - fi - ;; +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +# DLL creation program. +DLLTOOL=$lt_DLLTOOL - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - case $host in - osf3*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - ;; - *) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - ;; - esac +# The archiver. +AR=$lt_AR - hardcode_libdir_separator_CXX=: +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' - ;; - esac - link_all_deplibs_CXX=yes +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec - output_verbose_link_cmd='func_echo_all' +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +# The name of the directory that contains temporary libtool files. +objdir=$objdir - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' +# Must we lock files when doing compilation? +need_locks=$lt_need_locks - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" - reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; +# Old archive suffix (normally "a"). +libext=$libext - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } - test "$ld_shlibs_CXX" = no && can_build_shared=no +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink - GCC_CXX="$GXX" - LD_CXX="$LD" +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - # Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= +# Do we need a version for libraries? +need_version=$need_version -cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF +# Library versioning type. +version_type=$version_type +# Shared library runtime path variable. +runpath_var=$runpath_var -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac +# Shared library path variable. +shlibpath_var=$shlibpath_var -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no +# Format of library name prefix. +libname_spec=$lt_libname_spec - for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - fi +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - prev= - ;; +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds - *) ;; # Ignore the rest. +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval - esac - done +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# PORTME: override above test on systems where it is broken -case $host_os in -interix[3-9]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; +# Whether dlopen is supported. +dlopen_support=$enable_dlopen -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac +# The linker used to build libraries. +LD=$lt_LD +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - compiler_lib_search_dirs_CXX= -if test -n "${compiler_lib_search_path_CXX}"; then - compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds +# A language specific compiler. +CC=$lt_compiler +# Is the compiler the GNU compiler? +with_gcc=$GCC +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds - lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic_CXX='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + +as_fn_exit 0 +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec 5>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec 5>>config.log +$lt_cl_success || as_fn_exit 1 + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + + + +# Checks on the GMP library. + + + +# Check whether --with-gmp was given. +if test "${with_gmp+set}" = set; then : + withval=$with_gmp; +fi + + + +# Check whether --with-gmp-include was given. +if test "${with_gmp_include+set}" = set; then : + withval=$with_gmp_include; +fi + + + +# Check whether --with-gmp-lib was given. +if test "${with_gmp_lib+set}" = set; then : + withval=$with_gmp_lib; +fi + + +if test -n "$with_gmp" +then + gmp_include_options="-I$with_gmp/include" + gmp_library_paths="$with_gmp/lib" + gmp_library_options="-L$gmp_library_paths" +fi + +if test -n "$with_gmp_include" +then + gmp_include_options="-I$with_gmp_include" +fi + +if test -n "$with_gmp_lib" +then + gmp_library_paths="$with_gmp_lib" + gmp_library_options="-L$gmp_library_paths" +fi + +gmp_libs="-lgmpxx -lgmp" + + +# Check whether --with-gmp-build was given. +if test "${with_gmp_build+set}" = set; then : + withval=$with_gmp_build; gmp_build_dir=$with_gmp_build + if test -n "$with_gmp" \ + || test -n "$with_gmp_include" || test -n "$with_gmp_lib" + then + as_fn_error $? "cannot use --with-gmp-build and other --with-gmp* options together" "$LINENO" 5 else - case $host_os in - aix[4-9]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-qpic' - lt_prog_compiler_static_CXX='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; + gmp_srcdir=`echo @abs_srcdir@ | $gmp_build_dir/config.status --file=-` + gmp_include_options="-I$gmp_build_dir -I$gmp_build_dir/tune -I$gmp_srcdir" + gmp_libs="$gmp_build_dir/libgmp.la $gmp_build_dir/libgmpxx.la" + fi +fi + + +gmp_library_options="$gmp_library_options $gmp_libs" + +if test -n "$with_gmp_build" +then + ac_save_CXX="$CXX" + CXX="libtool --mode=link --tag=CXX $CXX" +fi + +ac_save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $gmp_include_options" +ac_save_LIBS="$LIBS" +LIBS="$LIBS $gmp_library_options" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the GMP library version 4.1.3 or above" >&5 +$as_echo_n "checking for the GMP library version 4.1.3 or above... " >&6; } +if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +#if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR == 1 && __GNU_MP_VERSION_PATCHLEVEL < 3) +#GMP version 4.1.3 or higher is required +#endif + +int +main() { + return 0; +} + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_cv_have_gmp=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ac_cv_have_gmp=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#include + +#if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR == 1 && __GNU_MP_VERSION_PATCHLEVEL < 3) +#GMP version 4.1.3 or higher is required +#endif + +#ifndef BITS_PER_MP_LIMB +#define BITS_PER_MP_LIMB GMP_LIMB_BITS +#endif + +int +main() { + std::string header_version; + { + std::ostringstream s(header_version); + s << __GNU_MP_VERSION << "." << __GNU_MP_VERSION_MINOR; + // Starting from GMP version 4.3.0, the gmp_version variable + // always contains three parts. In previous versions the + // patchlevel was omitted if it was 0. + if (__GNU_MP_VERSION_PATCHLEVEL != 0 + || __GNU_MP_VERSION > 4 + || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR >= 3)) + s << "." << __GNU_MP_VERSION_PATCHLEVEL; + header_version = s.str(); + } + + std::string library_version = gmp_version; + + if (header_version != library_version) { + std::cerr + << "GMP header (gmpxx.h) and library (ligmpxx.*) version mismatch:\n" + << "header gives " << header_version << ";\n" + << "library gives " << library_version << "." << std::endl; + return 1; + } + + if (sizeof(mp_limb_t)*CHAR_BIT != BITS_PER_MP_LIMB + || BITS_PER_MP_LIMB != mp_bits_per_limb) { + std::cerr + << "GMP header (gmpxx.h) and library (ligmpxx.*) bits-per-limb mismatch:\n" + << "header gives " << BITS_PER_MP_LIMB << ";\n" + << "library gives " << mp_bits_per_limb << ".\n" + << "This probably means you are on a bi-arch system and\n" + << "you are compiling with the wrong header or linking with\n" + << "the wrong library." << std::endl; + return 1; + } + + mpz_class n("3141592653589793238462643383279502884"); + return 0; +} + +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_cv_have_gmp=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ac_cv_have_gmp=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +have_gmp=${ac_cv_have_gmp} + +if test x"$ac_cv_have_gmp" = xyes +then + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of mp_limb_t" >&5 +$as_echo_n "checking size of mp_limb_t... " >&6; } +if ${ac_cv_sizeof_mp_limb_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (mp_limb_t))" "ac_cv_sizeof_mp_limb_t" "#include +"; then : + +else + if test "$ac_cv_type_mp_limb_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (mp_limb_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_mp_limb_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_mp_limb_t" >&5 +$as_echo "$ac_cv_sizeof_mp_limb_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_MP_LIMB_T $ac_cv_sizeof_mp_limb_t +_ACEOF + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GMP has been compiled with support for exceptions" >&5 +$as_echo_n "checking whether GMP has been compiled with support for exceptions... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming yes" >&5 +$as_echo "assuming yes" >&6; } + ac_cv_gmp_supports_exceptions=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +static void* +x_malloc(size_t) { + throw std::bad_alloc(); +} + +static void* +x_realloc(void*, size_t, size_t) { + throw std::bad_alloc(); +} + +static void +x_free(void*, size_t) { +} + +int main() { + mp_set_memory_functions(x_malloc, x_realloc, x_free); + try { + mpz_class n("3141592653589793238462643383279502884"); + } + catch (std::bad_alloc&) { + return 0; + } + return 1; +} + +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_cv_gmp_supports_exceptions=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ac_cv_gmp_supports_exceptions=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +gmp_supports_exceptions=${ac_cv_gmp_supports_exceptions} +if test x"$gmp_supports_exceptions" = xyes +then + value=1 +else + value=0 +fi + +cat >>confdefs.h <<_ACEOF +#define PPL_GMP_SUPPORTS_EXCEPTIONS $value +_ACEOF + + +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + +LIBS="$ac_save_LIBS" +CPPFLAGS="$ac_save_CPPFLAGS" + +if test -n "$with_gmp_build" +then + CXX="$ac_save_CXX" +fi + +if test x"$have_gmp" = xno +then + as_fn_error $? "Cannot find GMP version 4.1.3 or higher. +GMP is the GNU Multi-Precision library: +see http://www.swox.com/gmp/ for more information. +When compiling the GMP library, do not forget to enable the C++ interface: +add --enable-cxx to the configuration options." "$LINENO" 5 +else + if test x"$have_gmpxx" = xno + then + as_fn_error $? "GMP compiled without enabling the C++ interface. +GMP is the GNU Multi-Precision library: +see http://www.swox.com/gmp/ for more information. +When compiling the GMP library, do not forget to enable the C++ interface: +add --enable-cxx to the configuration options." "$LINENO" 5 + fi +fi + +ac_fn_cxx_check_member "$LINENO" "__mpz_struct" "_mp_alloc" "ac_cv_member___mpz_struct__mp_alloc" "#include +" +if test "x$ac_cv_member___mpz_struct__mp_alloc" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE___MPZ_STRUCT__MP_ALLOC 1 +_ACEOF + + +else + gmp_has_changes=yes +fi +ac_fn_cxx_check_member "$LINENO" "__mpz_struct" "_mp_size" "ac_cv_member___mpz_struct__mp_size" "#include +" +if test "x$ac_cv_member___mpz_struct__mp_size" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE___MPZ_STRUCT__MP_SIZE 1 +_ACEOF + + +else + gmp_has_changes=yes +fi +ac_fn_cxx_check_member "$LINENO" "__mpz_struct" "_mp_d" "ac_cv_member___mpz_struct__mp_d" "#include +" +if test "x$ac_cv_member___mpz_struct__mp_d" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE___MPZ_STRUCT__MP_D 1 +_ACEOF + + +else + gmp_has_changes=yes +fi + + +if test x"$gmp_has_changed" = xyes +then + as_fn_error $? "GMP HAS CHANGED: +*** The PPL exploits some implementation details of GMP that were current +*** until (at least) version 4.1.4 of GMP. You seem to be using a version +*** where these details have changed. +*** Please report this to ppl-devel@cs.unipr.it." "$LINENO" 5 +fi + +extra_includes="${extra_includes}${extra_includes:+ }${gmp_include_options}" +extra_libraries="${extra_libraries}${extra_libraries:+ }${gmp_library_options}" + +enableval=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the ppl_lcdd program" >&5 +$as_echo_n "checking whether to build the ppl_lcdd program... " >&6; } +# Check whether --enable-ppl_lcdd was given. +if test "${enable_ppl_lcdd+set}" = set; then : + enableval=$enable_ppl_lcdd; +fi + +case "${enableval}" in +yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ;; +no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; +*) + as_fn_error $? "bad value ${enableval} for --enable-ppl_lcdd, needs yes or no" "$LINENO" 5 + ;; +esac +build_ppl_lcdd=$enableval + if test x"$build_ppl_lcdd" = xyes; then + BUILD_PPL_LCDD_TRUE= + BUILD_PPL_LCDD_FALSE='#' +else + BUILD_PPL_LCDD_TRUE='#' + BUILD_PPL_LCDD_FALSE= +fi + + +enableval=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the ppl_lpsol program" >&5 +$as_echo_n "checking whether to build the ppl_lpsol program... " >&6; } +# Check whether --enable-ppl_lpsol was given. +if test "${enable_ppl_lpsol+set}" = set; then : + enableval=$enable_ppl_lpsol; +fi + +case "${enableval}" in +yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ;; +no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; +*) + as_fn_error $? "bad value ${enableval} for --enable-ppl_lpsol, needs yes or no" "$LINENO" 5 + ;; +esac +build_ppl_lpsol=$enableval + if test x"$build_ppl_lpsol" = xyes; then + BUILD_PPL_LPSOL_TRUE= + BUILD_PPL_LPSOL_FALSE='#' +else + BUILD_PPL_LPSOL_TRUE='#' + BUILD_PPL_LPSOL_FALSE= +fi + + +enableval=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the ppl_pips program" >&5 +$as_echo_n "checking whether to build the ppl_pips program... " >&6; } +# Check whether --enable-ppl_pips was given. +if test "${enable_ppl_pips+set}" = set; then : + enableval=$enable_ppl_pips; +fi + +case "${enableval}" in +yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ;; +no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; +*) + as_fn_error $? "bad value ${enableval} for --enable-ppl_pips, needs yes or no" "$LINENO" 5 + ;; +esac +build_ppl_pips=$enableval + if test x"$build_ppl_pips" = xyes; then + BUILD_PPL_PIPS_TRUE= + BUILD_PPL_PIPS_FALSE='#' +else + BUILD_PPL_PIPS_TRUE='#' + BUILD_PPL_PIPS_FALSE= +fi + + +enableval=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the PPL documentation" >&5 +$as_echo_n "checking whether to build the PPL documentation... " >&6; } +# Check whether --enable-documentation was given. +if test "${enable_documentation+set}" = set; then : + enableval=$enable_documentation; +fi + +case "${enableval}" in +yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ;; +no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; +*) + as_fn_error $? "bad value ${enableval} for --enable-documentation, needs yes or no" "$LINENO" 5 + ;; +esac +build_documentation=$enableval + if test x"$build_documentation" = xyes; then + BUILD_DOCUMENTATION_TRUE= + BUILD_DOCUMENTATION_FALSE='#' +else + BUILD_DOCUMENTATION_TRUE='#' + BUILD_DOCUMENTATION_FALSE= +fi + + +# Define lists of available interfaces: lowercase and blank-separated. +non_prolog_interfaces="cxx c ocaml java" +prolog_interfaces="ciao_prolog gnu_prolog sicstus_prolog swi_prolog xsb_prolog yap_prolog" +available_interfaces="${non_prolog_interfaces} ${prolog_interfaces}" + +# This is the list of interfaces that are enabled by default. +default_interfaces=${non_prolog_interfaces} + +enableval=not_specified +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which interfaces are enabled" >&5 +$as_echo_n "checking which interfaces are enabled... " >&6; } +# Check whether --enable-interfaces was given. +if test "${enable_interfaces+set}" = set; then : + enableval=$enable_interfaces; +fi + +case x"${enableval}" in +xyes | x) + as_fn_error $? "--enable-interfaces needs at least one argument chosen among ${available_interfaces}, none and all" "$LINENO" 5 + ;; +xnone | xno) + for interface in ${available_interfaces} + do + eval ${interface}_interface_enabled=no + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } + ;; +xall) + for interface in ${available_interfaces} + do + eval ${interface}_interface_enabled=yes + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${available_interfaces}" >&5 +$as_echo "${available_interfaces}" >&6; } + ;; +*) + if test x"${enableval}" = xnot_specified + then + enableval=${default_interfaces} + fi + # Make the list blank-separated and lowercase; turn "c++" into "cxx". + required_interfaces=`echo "${enableval}" | sed -e 's/-/_/g' -e 's/[ ,][ ,]*/ /g' -e 's/c++/cxx/g' | tr '[:upper:]' '[:lower:]'` + # Check that the specified interfaces exist. + for interface in ${required_interfaces} + do + case " ${available_interfaces} " in + *\ ${interface}\ *) + ;; + *) + as_fn_error $? "unknown interface ${interface}: must be one of ${available_interfaces}" "$LINENO" 5 + ;; + esac + done + # Initialize the enabled variable for each interface. + for interface in ${available_interfaces} + do + case " ${required_interfaces} " in + *\ ${interface}\ *) + eval ${interface}_interface_enabled=yes + enabled_interfaces="${enabled_interfaces}${enabled_interfaces:+ }${interface}" + ;; + *) + eval ${interface}_interface_enabled=no + ;; esac + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enabled_interfaces}" >&5 +$as_echo "${enabled_interfaces}" >&6; } + ;; +esac + +if test x${cxx_interface_enabled} = xyes +then + build_cxx_interface=yes +fi + if test x$build_cxx_interface = xyes; then + BUILD_CXX_INTERFACE_TRUE= + BUILD_CXX_INTERFACE_FALSE='#' +else + BUILD_CXX_INTERFACE_TRUE='#' + BUILD_CXX_INTERFACE_FALSE= +fi + + +if test x${c_interface_enabled} = xyes +then + build_c_interface=yes +fi + if test x$build_c_interface = xyes; then + BUILD_C_INTERFACE_TRUE= + BUILD_C_INTERFACE_FALSE='#' +else + BUILD_C_INTERFACE_TRUE='#' + BUILD_C_INTERFACE_FALSE= +fi + + +# Checks for systems for which the interface is enabled. + +# Allow to specify the Java SDK installation directory. + +# Check whether --with-java was given. +if test "${with_java+set}" = set; then : + withval=$with_java; java_dir=$with_java +fi + + +case "${host_os}" in +# On Darwin the JDK, if present, is installed in /Library/Java/Home . +darwin*) + if test "x$java_dir" = x + then + java_dir="/Library/Java/Home" + fi + ;; +# On modern Fedora systems the JDK is usually in /usr/lib/jvm/java . +linux*) + if test "x$java_dir" = x + then + java_dir="/usr/lib/jvm/java" + fi + ;; +*) + ;; +esac + +if test "x$java_dir" != x +then + JAVAPREFIX="${java_dir}/bin" +fi + +# Checks for Java. +if test x${java_interface_enabled} = xyes +then + # Check for Java programs. Order here is important: check first + # for the compiler. + + +if test "x$JAVAPREFIX" = x +then + test "x$JAVAC" = x && for ac_prog in javac$EXEEXT +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_JAVAC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$JAVAC"; then + ac_cv_prog_JAVAC="$JAVAC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_JAVAC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +JAVAC=$ac_cv_prog_JAVAC +if test -n "$JAVAC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 +$as_echo "$JAVAC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$JAVAC" && break +done +test -n "$JAVAC" || JAVAC="no" + +else + test "x$JAVAC" = x && for ac_prog in javac$EXEEXT +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_JAVAC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $JAVAC in + [\\/]* | ?:[\\/]*) + ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $JAVAPREFIX +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +JAVAC=$ac_cv_path_JAVAC +if test -n "$JAVAC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 +$as_echo "$JAVAC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$JAVAC" && break +done +test -n "$JAVAC" || JAVAC="no" + +fi +if test ! x$JAVAC = "xno" +then + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $JAVAC supports enums" >&5 +$as_echo_n "checking whether $JAVAC supports enums... " >&6; } +if ${ac_cv_javac_supports_enums+:} false; then : + $as_echo_n "(cached) " >&6 +else + +JAVA_TEST=Test.java +CLASS_TEST=Test.class +cat << \EOF > $JAVA_TEST +/* #line 22364 "configure" */ +public class Test { +public enum Relation_Symbol { + /*! Less than. */ + LESS_THAN, + /*! Less than or equal to. */ + LESS_OR_EQUAL, + /*! Equal to. */ + EQUAL, + /*! Greater than or equal to. */ + GREATER_OR_EQUAL, + /*! Greater than. */ + GREATER_THAN, + } +} +EOF +if { ac_try='$JAVAC $JAVACFLAGS $JAVA_TEST' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } >/dev/null 2>&1; then + ac_cv_javac_supports_enums=yes +else + echo "configure: failed program was:" >&5 + cat $JAVA_TEST >&5 + ac_cv_javac_supports_enums=no +fi + +rm -f $JAVA_TEST $CLASS_TEST Test\$Relation_Symbol.class + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_javac_supports_enums" >&5 +$as_echo "$ac_cv_javac_supports_enums" >&6; } + +fi + + +if test x$JAVAPREFIX = x; then + test x$JAVA = x && for ac_prog in java$EXEEXT +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_JAVA+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$JAVA"; then + ac_cv_prog_JAVA="$JAVA" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_JAVA="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +JAVA=$ac_cv_prog_JAVA +if test -n "$JAVA"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 +$as_echo "$JAVA" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$JAVA" && break +done +test -n "$JAVA" || JAVA="no" + +else + test x$JAVA = x && for ac_prog in java$EXEEXT +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_JAVA+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $JAVA in + [\\/]* | ?:[\\/]*) + ac_cv_path_JAVA="$JAVA" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $JAVAPREFIX +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +JAVA=$ac_cv_path_JAVA +if test -n "$JAVA"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 +$as_echo "$JAVA" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$JAVA" && break +done +test -n "$JAVA" || JAVA="no" + +fi +if test ! x$JAVA = "xno" +then + +# Extract the first word of "uudecode$EXEEXT", so it can be a program name with args. +set dummy uudecode$EXEEXT; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_uudecode+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$uudecode"; then + ac_cv_prog_uudecode="$uudecode" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_uudecode="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +uudecode=$ac_cv_prog_uudecode +if test -n "$uudecode"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $uudecode" >&5 +$as_echo "$uudecode" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test x$uudecode = xyes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if uudecode can decode base 64 file" >&5 +$as_echo_n "checking if uudecode can decode base 64 file... " >&6; } +if ${ac_cv_prog_uudecode_base64+:} false; then : + $as_echo_n "(cached) " >&6 +else + +cat << \EOF > Test.uue +begin-base64 644 Test.class +yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE +bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 +bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s +YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG +aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB +AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB +AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ= +==== +EOF +if uudecode$EXEEXT Test.uue; then + ac_cv_prog_uudecode_base64=yes +else + echo "configure: 22555: uudecode had trouble decoding base 64 file 'Test.uue'" >&5 + echo "configure: failed file was:" >&5 + cat Test.uue >&5 + ac_cv_prog_uudecode_base64=no +fi +rm -f Test.uue +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_uudecode_base64" >&5 +$as_echo "$ac_cv_prog_uudecode_base64" >&6; } +fi +if test x$ac_cv_prog_uudecode_base64 != xyes; then + rm -f Test.class + if test x$ac_cv_javac_supports_enums = x; then + +if test "x$JAVAPREFIX" = x +then + test "x$JAVAC" = x && for ac_prog in javac$EXEEXT +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_JAVAC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$JAVAC"; then + ac_cv_prog_JAVAC="$JAVAC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_JAVAC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +JAVAC=$ac_cv_prog_JAVAC +if test -n "$JAVAC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 +$as_echo "$JAVAC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$JAVAC" && break +done +test -n "$JAVAC" || JAVAC="no" + +else + test "x$JAVAC" = x && for ac_prog in javac$EXEEXT +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_JAVAC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $JAVAC in + [\\/]* | ?:[\\/]*) + ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $JAVAPREFIX +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +JAVAC=$ac_cv_path_JAVAC +if test -n "$JAVAC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 +$as_echo "$JAVAC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$JAVAC" && break +done +test -n "$JAVAC" || JAVAC="no" + +fi +if test ! x$JAVAC = "xno" +then + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $JAVAC supports enums" >&5 +$as_echo_n "checking whether $JAVAC supports enums... " >&6; } +if ${ac_cv_javac_supports_enums+:} false; then : + $as_echo_n "(cached) " >&6 +else + +JAVA_TEST=Test.java +CLASS_TEST=Test.class +cat << \EOF > $JAVA_TEST +/* #line 22674 "configure" */ +public class Test { +public enum Relation_Symbol { + /*! Less than. */ + LESS_THAN, + /*! Less than or equal to. */ + LESS_OR_EQUAL, + /*! Equal to. */ + EQUAL, + /*! Greater than or equal to. */ + GREATER_OR_EQUAL, + /*! Greater than. */ + GREATER_THAN, + } +} +EOF +if { ac_try='$JAVAC $JAVACFLAGS $JAVA_TEST' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } >/dev/null 2>&1; then + ac_cv_javac_supports_enums=yes +else + echo "configure: failed program was:" >&5 + cat $JAVA_TEST >&5 + ac_cv_javac_supports_enums=no +fi + +rm -f $JAVA_TEST $CLASS_TEST Test\$Relation_Symbol.class + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_javac_supports_enums" >&5 +$as_echo "$ac_cv_javac_supports_enums" >&6; } + +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $JAVA works" >&5 +$as_echo_n "checking if $JAVA works... " >&6; } +if ${ac_cv_prog_java_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + +JAVA_TEST=Test.java +CLASS_TEST=Test.class +TEST=Test +cat << \EOF > $JAVA_TEST +/* [#]line 22723 "configure" */ +public class Test { +public static void main (String args[]) { + System.exit (0); +} } +EOF +if test x$ac_cv_prog_uudecode_base64 != xyes; then + if { ac_try='$JAVAC $JAVACFLAGS $JAVA_TEST' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } && test -s $CLASS_TEST; then + : + else + echo "configure: failed program was:" >&5 + cat $JAVA_TEST >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" >&5 +$as_echo "$as_me: WARNING: The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" >&2;} + fi +fi +# if we don't have a Java compiler installed, it's useless to check if Java +# works beacause a working javac is needed. +if test x$ac_cv_javac_supports_enums = xno; then + ac_cv_prog_java_works=skipping +else +if { ac_try='$JAVA $JAVAFLAGS $TEST' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } >/dev/null 2>&1; then + ac_cv_prog_java_works=yes +else + echo "configure: failed program was:" >&5 + cat $JAVA_TEST >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The Java VM $JAVA failed (see config.log, check the CLASSPATH?)" >&5 +$as_echo "$as_me: WARNING: The Java VM $JAVA failed (see config.log, check the CLASSPATH?)" >&2;} fi +fi +rm -fr $JAVA_TEST $CLASS_TEST Test.uue -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_java_works" >&5 +$as_echo "$ac_cv_prog_java_works" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + +fi + + +if test "x$JAVAPREFIX" = x; then + test "x$JAR" = x && for ac_prog in jar$EXEEXT +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_JAR+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX + if test -n "$JAR"; then + ac_cv_prog_JAR="$JAR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_JAR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +JAR=$ac_cv_prog_JAR +if test -n "$JAR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAR" >&5 +$as_echo "$JAR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } -lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + + test -n "$JAR" && break +done +test -n "$JAR" || JAR="no" + +else + test "x$JAR" = x && for ac_prog in jar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_JAR+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works_CXX=yes - fi - fi - $RM conftest* + case $JAR in + [\\/]* | ?:[\\/]*) + ac_cv_path_JAR="$JAR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $JAVAPREFIX +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } +JAR=$ac_cv_path_JAR +if test -n "$JAR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAR" >&5 +$as_echo "$JAR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$JAR" && break +done +test -n "$JAR" || JAR="no" + +fi +test "x$JAR" = xno + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" +if test "x$JAVAPREFIX" = x; then + for ac_prog in javah +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_JAVAH+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$JAVAH"; then + ac_cv_prog_JAVAH="$JAVAH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_JAVAH="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +JAVAH=$ac_cv_prog_JAVAH +if test -n "$JAVAH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAH" >&5 +$as_echo "$JAVAH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$JAVAH" && break +done +test -n "$JAVAH" || JAVAH="no" + +else + for ac_prog in javah +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_JAVAH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $JAVAH in + [\\/]* | ?:[\\/]*) + ac_cv_path_JAVAH="$JAVAH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $JAVAPREFIX +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_JAVAH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no + ;; +esac fi - +JAVAH=$ac_cv_path_JAVAH +if test -n "$JAVAH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAH" >&5 +$as_echo "$JAVAH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$JAVAH" && break +done +test -n "$JAVAH" || JAVAH="no" +fi +if test x"`eval 'echo $ac_cv_path_JAVAH'`" != xno ; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : - $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works_CXX=yes - fi - else - lt_cv_prog_compiler_static_works_CXX=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + ac_save_CPPFLAGS="$CPPFLAGS" + ac_dir=`echo $ac_cv_path_JAVAH | sed 's,\(.*\)/[^/]*/[^/]*$,\1/include,'` + ac_machdep=`echo $build_os | sed 's,[-0-9].*,,' | sed 's,cygwin,win32,'` + JNIFLAGS="-I$ac_dir -I$ac_dir/$ac_machdep" + CPPFLAGS="$ac_save_CPPFLAGS $JNIFLAGS" -if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then - : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + CPPFLAGS="$ac_save_CPPFLAGS" else - lt_prog_compiler_static_CXX= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to include " >&5 +$as_echo "$as_me: WARNING: unable to include " >&2;} + JAVAH=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext + CPPFLAGS="$ac_save_CPPFLAGS" fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $JNIFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether jlong can contain data pointers" >&5 +$as_echo_n "checking whether jlong can contain data pointers... " >&6; } + if test "$cross_compiling" = yes; then : + ac_jlong_can_contain_pointers=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming it cannot" >&5 +$as_echo "assuming it cannot" >&6; } else - lt_cv_prog_compiler_c_o_CXX=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* + int + main() { + if (sizeof(jlong) >= sizeof(void*)) + return 0; + else + return 1; + } +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_jlong_can_contain_pointers=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + ac_jlong_can_contain_pointers=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + CPPFLAGS="$ac_save_CPPFLAGS" +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 +# In order to build the Java interface, it must be enabled and all the +# Java tools must be available. +if test x${java_interface_enabled} = xyes \ +&& test "x$JAVA" != xno \ +&& test "x$ac_cv_javac_supports_enums" != xno \ +&& test "x$JAR" != xno \ +&& test "x$JAVAH" != xno \ +&& test x${ac_jlong_can_contain_pointers} = xyes +then + build_java_interface=yes +fi + if test x$build_java_interface = xyes; then + BUILD_JAVA_INTERFACE_TRUE= + BUILD_JAVA_INTERFACE_FALSE='#' else - lt_cv_prog_compiler_c_o_CXX=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + BUILD_JAVA_INTERFACE_TRUE='#' + BUILD_JAVA_INTERFACE_FALSE= +fi - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* + + +# Allow to specify the ML GMP installation directory. + +# Check whether --with-mlgmp was given. +if test "${with_mlgmp+set}" = set; then : + withval=$with_mlgmp; mlgmp_dir=$with_mlgmp +else + mlgmp_dir=+gmp +fi + + +# Checks for OCaml. +if test x${ocaml_interface_enabled} = xyes +then + # Detect which tools of the OCaml toolchain are available. + # checking for ocamlc + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLC"; then + ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } +fi +OCAMLC=$ac_cv_prog_OCAMLC +if test -n "$OCAMLC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 +$as_echo "$OCAMLC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OCAMLC"; then + ac_ct_OCAMLC=$OCAMLC + # Extract the first word of "ocamlc", so it can be a program name with args. +set dummy ocamlc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLC"; then + ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLC="ocamlc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC +if test -n "$ac_ct_OCAMLC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5 +$as_echo "$ac_ct_OCAMLC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn + if test "x$ac_ct_OCAMLC" = x; then + OCAMLC="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLC=$ac_ct_OCAMLC fi else - need_locks=no + OCAMLC="$ac_cv_prog_OCAMLC" fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - case $host_os in - aix[4-9]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) - exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - ;; - esac - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -with_gnu_ld_CXX=$with_gnu_ld + if test "$OCAMLC" != "no"; then + OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5 +$as_echo "OCaml version is $OCAMLVERSION" >&6; } + OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5 +$as_echo "OCaml library path is $OCAMLLIB" >&6; } + # checking for ocamlopt + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLOPT"; then + ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OCAMLOPT=$ac_cv_prog_OCAMLOPT +if test -n "$OCAMLOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5 +$as_echo "$OCAMLOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : +fi +if test -z "$ac_cv_prog_OCAMLOPT"; then + ac_ct_OCAMLOPT=$OCAMLOPT + # Extract the first word of "ocamlopt", so it can be a program name with args. +set dummy ocamlopt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then : $as_echo_n "(cached) " >&6 else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc_CXX=no - else - lt_cv_archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* + if test -n "$ac_ct_OCAMLOPT"; then + ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } - archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX - ;; - esac - fi - ;; +fi +ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT +if test -n "$ac_ct_OCAMLOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5 +$as_echo "$ac_ct_OCAMLOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OCAMLOPT" = x; then + OCAMLOPT="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac + OCAMLOPT=$ac_ct_OCAMLOPT + fi +else + OCAMLOPT="$ac_cv_prog_OCAMLOPT" +fi + + OCAMLBEST=byte + if test "$OCAMLOPT" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5 +$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;} + else + TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` + if test "$TMPVERSION" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5 +$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; } + OCAMLOPT=no + else + OCAMLBEST=opt + fi + fi + # checking for ocamlc.opt + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLCDOTOPT"; then + ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT +if test -n "$OCAMLCDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5 +$as_echo "$OCAMLCDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then + ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT + # Extract the first word of "ocamlc.opt", so it can be a program name with args. +set dummy ocamlc.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLCDOTOPT"; then + ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT +if test -n "$ac_ct_OCAMLCDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5 +$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OCAMLCDOTOPT" = x; then + OCAMLCDOTOPT="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT + fi +else + OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT" +fi + if test "$OCAMLCDOTOPT" != "no"; then + TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` + if test "$TMPVERSION" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5 +$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; } + else + OCAMLC=$OCAMLCDOTOPT + fi + fi + # checking for ocamlopt.opt + if test "$OCAMLOPT" != "no" ; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLOPTDOTOPT"; then + ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT +if test -n "$OCAMLOPTDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5 +$as_echo "$OCAMLOPTDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then + ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT + # Extract the first word of "ocamlopt.opt", so it can be a program name with args. +set dummy ocamlopt.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLOPTDOTOPT"; then + ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT +if test -n "$ac_ct_OCAMLOPTDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5 +$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then + OCAMLOPTDOTOPT="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT + fi +else + OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT" +fi + if test "$OCAMLOPTDOTOPT" != "no"; then + TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` + if test "$TMPVERSION" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5 +$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; } + else + OCAMLOPT=$OCAMLOPTDOTOPT + fi + fi + fi + fi + # checking for ocamldep + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamldep; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLDEP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLDEP"; then + ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OCAMLDEP=$ac_cv_prog_OCAMLDEP +if test -n "$OCAMLDEP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5 +$as_echo "$OCAMLDEP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OCAMLDEP"; then + ac_ct_OCAMLDEP=$OCAMLDEP + # Extract the first word of "ocamldep", so it can be a program name with args. +set dummy ocamldep; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLDEP"; then + ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLDEP="ocamldep" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP +if test -n "$ac_ct_OCAMLDEP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5 +$as_echo "$ac_ct_OCAMLDEP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OCAMLDEP" = x; then + OCAMLDEP="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLDEP=$ac_ct_OCAMLDEP + fi +else + OCAMLDEP="$ac_cv_prog_OCAMLDEP" +fi + # checking for ocamlmktop + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLMKTOP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLMKTOP"; then + ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP +if test -n "$OCAMLMKTOP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5 +$as_echo "$OCAMLMKTOP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OCAMLMKTOP"; then + ac_ct_OCAMLMKTOP=$OCAMLMKTOP + # Extract the first word of "ocamlmktop", so it can be a program name with args. +set dummy ocamlmktop; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLMKTOP"; then + ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP +if test -n "$ac_ct_OCAMLMKTOP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5 +$as_echo "$ac_ct_OCAMLMKTOP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OCAMLMKTOP" = x; then + OCAMLMKTOP="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLMKTOP=$ac_ct_OCAMLMKTOP + fi +else + OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP" +fi + # checking for ocamlmklib + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLMKLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLMKLIB"; then + ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB +if test -n "$OCAMLMKLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5 +$as_echo "$OCAMLMKLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OCAMLMKLIB"; then + ac_ct_OCAMLMKLIB=$OCAMLMKLIB + # Extract the first word of "ocamlmklib", so it can be a program name with args. +set dummy ocamlmklib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLMKLIB"; then + ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB +if test -n "$ac_ct_OCAMLMKLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5 +$as_echo "$ac_ct_OCAMLMKLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OCAMLMKLIB" = x; then + OCAMLMKLIB="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLMKLIB=$ac_ct_OCAMLMKLIB + fi +else + OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB" +fi + # checking for ocamldoc + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLDOC"; then + ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OCAMLDOC=$ac_cv_prog_OCAMLDOC +if test -n "$OCAMLDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5 +$as_echo "$OCAMLDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OCAMLDOC"; then + ac_ct_OCAMLDOC=$OCAMLDOC + # Extract the first word of "ocamldoc", so it can be a program name with args. +set dummy ocamldoc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLDOC"; then + ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC +if test -n "$ac_ct_OCAMLDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5 +$as_echo "$ac_ct_OCAMLDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OCAMLDOC" = x; then + OCAMLDOC="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLDOC=$ac_ct_OCAMLDOC + fi +else + OCAMLDOC="$ac_cv_prog_OCAMLDOC" +fi + # checking for ocamlbuild + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLBUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLBUILD"; then + ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OCAMLBUILD=$ac_cv_prog_OCAMLBUILD +if test -n "$OCAMLBUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5 +$as_echo "$OCAMLBUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OCAMLBUILD"; then + ac_ct_OCAMLBUILD=$OCAMLBUILD + # Extract the first word of "ocamlbuild", so it can be a program name with args. +set dummy ocamlbuild; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLBUILD"; then + ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD +if test -n "$ac_ct_OCAMLBUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5 +$as_echo "$ac_ct_OCAMLBUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OCAMLBUILD" = x; then + OCAMLBUILD="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLBUILD=$ac_ct_OCAMLBUILD + fi +else + OCAMLBUILD="$ac_cv_prog_OCAMLBUILD" +fi + if test x"$OCAMLC" != xno + then + # Check for the bytecode version of ML GMP. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ML GMP bytecode module gmp.cma" >&5 +$as_echo_n "checking for ML GMP bytecode module gmp.cma... " >&6; } + if ( test ${mlgmp_dir} = +gmp && test -f ${OCAMLLIB}/gmp/gmp.cma ) \ + || test -f ${mlgmp_dir}/gmp.cma; + then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ocamlc_gmp="yes" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ocamlc_gmp="no" + fi + if test x"$OCAMLOPT" != xno + then + ocamlopt_root=`${OCAMLOPT} -where` + # Check for the native version of ML GMP. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ML GMP native module gmp.cmxa" >&5 +$as_echo_n "checking for ML GMP native module gmp.cmxa... " >&6; } + if ( test ${mlgmp_dir} = +gmp && test -f ${ocamlopt_root}/gmp/gmp.cmxa ) \ + || test -f ${mlgmp_dir}/gmp.cmxa; + then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ocamlopt_gmp="yes" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ocamlopt_gmp="no" + fi + fi + fi +fi + if test x$ocamlc_gmp = xyes; then + HAVE_OCAMLC_TRUE= + HAVE_OCAMLC_FALSE='#' +else + HAVE_OCAMLC_TRUE='#' + HAVE_OCAMLC_FALSE= +fi + if test x$ocamlopt_gmp = xyes; then + HAVE_OCAMLOPT_TRUE= + HAVE_OCAMLOPT_FALSE='#' +else + HAVE_OCAMLOPT_TRUE='#' + HAVE_OCAMLOPT_FALSE= +fi +if test x${ocaml_interface_enabled} = xyes \ +&& (test x$ocamlc_gmp = xyes || test x$ocamlopt_gmp = xyes) +then + build_ocaml_interface=yes +fi + if test x$build_ocaml_interface = xyes; then + BUILD_OCAML_INTERFACE_TRUE= + BUILD_OCAML_INTERFACE_FALSE='#' +else + BUILD_OCAML_INTERFACE_TRUE='#' + BUILD_OCAML_INTERFACE_FALSE= +fi +# Checks for Ciao Prolog. +if test x${ciao_prolog_interface_enabled} = xyes +then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } +# Extract the first word of "ciao", so it can be a program name with args. +set dummy ciao; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ciao_prolog+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ciao_prolog in + [\\/]* | ?:[\\/]*) + ac_cv_path_ciao_prolog="$ciao_prolog" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ciao_prolog="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no + ;; +esac +fi +ciao_prolog=$ac_cv_path_ciao_prolog +if test -n "$ciao_prolog"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ciao_prolog" >&5 +$as_echo "$ciao_prolog" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH +if test x$ciao_prolog != x +then + # Create a temporary directory $tmp in $TMPDIR (default /tmp). + # Use mktemp if possible; otherwise fall back on mkdir, + # with $RANDOM to make collisions less likely. + : ${TMPDIR=/tmp} + { + tmp=` + (umask 077 && mktemp -d "$TMPDIR/ppl_ciao_XXXXXX") 2>/dev/null + ` && + test -n "$tmp" && test -d "$tmp" + } || { + tmp=$TMPDIR/ppl_ciao_$$-$RANDOM + (umask 077 && mkdir "$tmp") + } || exit $? + cat >$tmp/print_include_dir.pl <<_CIAO_PRINT_INCLUDE_DIR_EOF +main(_) :- + ciaolibdir(Lib_Dir), + get_os(Os), + get_arch(Arch), + format("~p/include/~p~p", [Lib_Dir, Os, Arch]). +_CIAO_PRINT_INCLUDE_DIR_EOF + ciao_prolog_include_dir=`$ciao_prolog $tmp/print_include_dir.pl` + rm -rf $tmp - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; + CIAO_PROLOG_INCLUDE_OPTIONS="-I${ciao_prolog_include_dir}" -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $CIAO_PROLOG_INCLUDE_OPTIONS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; + ac_fn_cxx_check_header_mongrel "$LINENO" "ciao_prolog.h" "ac_cv_header_ciao_prolog_h" "$ac_includes_default" +if test "x$ac_cv_header_ciao_prolog_h" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ciao Prolog version x.y.z or later" >&5 +$as_echo_n "checking for Ciao Prolog version x.y.z or later... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; +#include -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; +int +main() { + return 0; +} -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + ciao_prolog="" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + ciao_prolog="" +fi - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; + CPPFLAGS="$ac_save_CPPFLAGS" + CIAO_PROLOG="$ciao_prolog" - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; +if test x$ciao_prolog != x +then + have_ciao_prolog=yes +else + have_ciao_prolog=no +fi -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +fi -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac +if test x${ciao_prolog_interface_enabled} = xyes \ +&& test x$have_ciao_prolog = xyes +then + build_ciao_prolog_interface=yes +fi + if test x$build_ciao_prolog_interface = xyes; then + BUILD_CIAO_PROLOG_INTERFACE_TRUE= + BUILD_CIAO_PROLOG_INTERFACE_FALSE='#' +else + BUILD_CIAO_PROLOG_INTERFACE_TRUE='#' + BUILD_CIAO_PROLOG_INTERFACE_FALSE= +fi + + +# Checks for GNU Prolog. +if test x${gnu_prolog_interface_enabled} = xyes +then + # Extract the first word of "gprolog", so it can be a program name with args. +set dummy gprolog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GNU_PROLOG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GNU_PROLOG"; then + ac_cv_prog_GNU_PROLOG="$GNU_PROLOG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GNU_PROLOG="gprolog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; +done + done +IFS=$as_save_IFS -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; +fi +fi +GNU_PROLOG=$ac_cv_prog_GNU_PROLOG +if test -n "$GNU_PROLOG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNU_PROLOG" >&5 +$as_echo "$GNU_PROLOG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; + if test x"$GNU_PROLOG" = xgprolog + then + ac_fn_cxx_check_header_mongrel "$LINENO" "gprolog.h" "ac_cv_header_gprolog_h" "$ac_includes_default" +if test "x$ac_cv_header_gprolog_h" = xyes; then : -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes +else + GNU_PROLOG="" +fi + + + fi +fi + +if test x${gnu_prolog_interface_enabled} = xyes \ +&& test x$GNU_PROLOG = xgprolog +then + build_gnu_prolog_interface=yes +fi + if test x$build_gnu_prolog_interface = xyes; then + BUILD_GNU_PROLOG_INTERFACE_TRUE= + BUILD_GNU_PROLOG_INTERFACE_FALSE='#' +else + BUILD_GNU_PROLOG_INTERFACE_TRUE='#' + BUILD_GNU_PROLOG_INTERFACE_FALSE= +fi + + +# Checks for SICStus. +if test x${sicstus_prolog_interface_enabled} = xyes +then + +# Extract the first word of "sicstus", so it can be a program name with args. +set dummy sicstus; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_sicstus_prolog+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $sicstus_prolog in + [\\/]* | ?:[\\/]*) + ac_cv_path_sicstus_prolog="$sicstus_prolog" # Let the user override the test with a path. ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_sicstus_prolog="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no ;; +esac +fi +sicstus_prolog=$ac_cv_path_sicstus_prolog +if test -n "$sicstus_prolog"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sicstus_prolog" >&5 +$as_echo "$sicstus_prolog" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test x$sicstus_prolog != x +then + sicstus_prolog_app_dir=`$sicstus_prolog -f --goal "use_module(library(system)), environ('SP_APP_DIR', X), write(X), nl, halt."` + sicstus_prolog_base=`dirname $sicstus_prolog_app_dir` + SICSTUS_PROLOG_INCLUDE_OPTIONS="-I${sicstus_prolog_base}/include" + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $SICSTUS_PROLOG_INCLUDE_OPTIONS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + + # We require SICStus Prolog 3.9.1 or later. + ac_fn_cxx_check_header_mongrel "$LINENO" "sicstus/sicstus.h" "ac_cv_header_sicstus_sicstus_h" "$ac_includes_default" +if test "x$ac_cv_header_sicstus_sicstus_h" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SICStus version 3.9.1 or later" >&5 +$as_echo_n "checking for SICStus version 3.9.1 or later... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int -main () -{ + #include + #if SICSTUS_MAJOR_VERSION > 3 || (SICSTUS_MAJOR_VERSION == 3 && SICSTUS_MINOR_VERSION > 9) || (SICSTUS_MAJOR_VERSION == 3 && SICSTUS_MINOR_VERSION == 9 && SICSTUS_REVISION_VERSION >= 1) + yes + #endif - ; - return 0; -} _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + sicstus_prolog="" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi +rm -f conftest* + +else + sicstus_prolog="" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + + CPPFLAGS="$ac_save_CPPFLAGS" fi - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath +if test x$sicstus_prolog != x +then + have_sicstus_prolog=yes +else + have_sicstus_prolog=no +fi - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes +fi - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" +if test x${sicstus_prolog_interface_enabled} = xyes \ +&& test x$have_sicstus_prolog = xyes +then + build_sicstus_prolog_interface=yes +fi + if test x$build_sicstus_prolog_interface = xyes; then + BUILD_SICSTUS_PROLOG_INTERFACE_TRUE= + BUILD_SICSTUS_PROLOG_INTERFACE_FALSE='#' +else + BUILD_SICSTUS_PROLOG_INTERFACE_TRUE='#' + BUILD_SICSTUS_PROLOG_INTERFACE_FALSE= +fi + + +# Checks for SWI-Prolog. +if test x${swi_prolog_interface_enabled} = xyes +then + + +# Extract the first word of "swipl$EXEEXT", so it can be a program name with args. +set dummy swipl$EXEEXT; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_swi_prolog+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $swi_prolog in + [\\/]* | ?:[\\/]*) + ac_cv_path_swi_prolog="$swi_prolog" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_swi_prolog="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' ;; +esac +fi +swi_prolog=$ac_cv_path_swi_prolog +if test -n "$swi_prolog"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog" >&5 +$as_echo "$swi_prolog" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes + +if test -z $swi_prolog +then + # Extract the first word of "swi-prolog$EXEEXT", so it can be a program name with args. +set dummy swi-prolog$EXEEXT; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_swi_prolog+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $swi_prolog in + [\\/]* | ?:[\\/]*) + ac_cv_path_swi_prolog="$swi_prolog" # Let the user override the test with a path. ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_swi_prolog="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes ;; +esac +fi +swi_prolog=$ac_cv_path_swi_prolog +if test -n "$swi_prolog"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog" >&5 +$as_echo "$swi_prolog" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi + if test -z $swi_prolog + then + # Extract the first word of "pl$EXEEXT", so it can be a program name with args. +set dummy pl$EXEEXT; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_swi_prolog+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $swi_prolog in + [\\/]* | ?:[\\/]*) + ac_cv_path_swi_prolog="$swi_prolog" # Let the user override the test with a path. ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_swi_prolog="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH ;; +esac +fi +swi_prolog=$ac_cv_path_swi_prolog +if test -n "$swi_prolog"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog" >&5 +$as_echo "$swi_prolog" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; -rdos*) - dynamic_linker=no + if test -z $swi_prolog + then + # Extract the first word of "plcon$EXEEXT", so it can be a program name with args. +set dummy plcon$EXEEXT; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_swi_prolog+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $swi_prolog in + [\\/]* | ?:[\\/]*) + ac_cv_path_swi_prolog="$swi_prolog" # Let the user override the test with a path. ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_swi_prolog="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' ;; +esac +fi +swi_prolog=$ac_cv_path_swi_prolog +if test -n "$swi_prolog"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog" >&5 +$as_echo "$swi_prolog" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no + + fi fi - need_version=yes - ;; +fi +if test x$swi_prolog != x +then + swi_prolog_base=`$swi_prolog -dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\([a-z]:\)\{0,1\}\(.*\)";.*/\2/'` + swi_prolog_version=`$swi_prolog -dump-runtime-variables | grep PLVERSION= | sed 's/PLVERSION="\(.*\)";.*/\1/'` + swi_prolog_arch=`$swi_prolog -dump-runtime-variables | grep PLARCH= | sed 's/PLARCH="\(.*\)";.*/\1/'` + swi_prolog_libs=`$swi_prolog -dump-runtime-variables | grep PLLIBS= | sed 's/PLLIBS="\(.*\)";.*/\1/'` + swi_prolog_lib=`$swi_prolog -dump-runtime-variables | grep PLLIB= | sed 's/PLLIB="\(.*\)";.*/\1/'` -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi + # Extract the first word of "swipl-ld$EXEEXT", so it can be a program name with args. +set dummy swipl-ld$EXEEXT; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_swi_prolog_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $swi_prolog_ld in + [\\/]* | ?:[\\/]*) + ac_cv_path_swi_prolog_ld="$swi_prolog_ld" # Let the user override the test with a path. ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_swi_prolog_ld="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; +done + done +IFS=$as_save_IFS -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes ;; +esac +fi +swi_prolog_ld=$ac_cv_path_swi_prolog_ld +if test -n "$swi_prolog_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog_ld" >&5 +$as_echo "$swi_prolog_ld" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH + + if test -z $swi_prolog_ld + then + # Extract the first word of "plld$EXEEXT", so it can be a program name with args. +set dummy plld$EXEEXT; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_swi_prolog_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $swi_prolog_ld in + [\\/]* | ?:[\\/]*) + ac_cv_path_swi_prolog_ld="$swi_prolog_ld" # Let the user override the test with a path. ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_swi_prolog_ld="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -*) - dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +swi_prolog_ld=$ac_cv_path_swi_prolog_ld +if test -n "$swi_prolog_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swi_prolog_ld" >&5 +$as_echo "$swi_prolog_ld" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" + + fi + + # In Fedora, SWI-Prolog.h is installed only in /usr/include/pl, which, + # IMHO, is a bug (https://bugzilla.redhat.com/show_bug.cgi?id=471071). + SWI_PROLOG_INCLUDE_OPTIONS="-I${swi_prolog_base}/include -I/usr/include/pl" + # If SWI-Prolog was configured with `--disable-libdirversion', then + # the files are not in the `${swi_prolog_arch}' subdirectory. Since + # currently there is no way to know that, we look in both places. + SWI_PROLOG_LD_OPTIONS="-L${swi_prolog_base}/lib/${swi_prolog_arch} -L${swi_prolog_base}/lib ${swi_prolog_lib} ${swi_prolog_libs}" + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $SWI_PROLOG_INCLUDE_OPTIONS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + + # We require SWI-Prolog 5.6.0 or later. + ac_fn_cxx_check_header_mongrel "$LINENO" "SWI-Prolog.h" "ac_cv_header_SWI_Prolog_h" "$ac_includes_default" +if test "x$ac_cv_header_SWI_Prolog_h" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SWI-Prolog version 5.6.0 or later" >&5 +$as_echo_n "checking for SWI-Prolog version 5.6.0 or later... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main() { +#if !defined(PLVERSION) || PLVERSION < 50600 + choke me +#endif + + ; + return 0; +} + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + swi_prolog="" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + swi_prolog="" fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + + CPPFLAGS="$ac_save_CPPFLAGS" + SWI_PROLOG="$swi_prolog" + SWI_PROLOG_LD="$swi_prolog_ld" + + + +fi +if test x$swi_prolog != x +then + have_swi_prolog=yes +else + have_swi_prolog=no +fi +fi +# Under Cygwin, SWI-Prolog does not work with foreign code: +# see http://www.cs.unipr.it/pipermail/ppl-devel/2006-January/007838.html +if test x${swi_prolog_interface_enabled} = xyes \ +&& test x$have_swi_prolog = xyes \ +&& test x"${host_os}" != xcygwin +then + build_swi_prolog_interface=yes +fi + if test x$build_swi_prolog_interface = xyes; then + BUILD_SWI_PROLOG_INTERFACE_TRUE= + BUILD_SWI_PROLOG_INTERFACE_FALSE='#' +else + BUILD_SWI_PROLOG_INTERFACE_TRUE='#' + BUILD_SWI_PROLOG_INTERFACE_FALSE= +fi +# Checks for XSB. +if test x${xsb_prolog_interface_enabled} = xyes +then +# Extract the first word of "xsb", so it can be a program name with args. +set dummy xsb; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_xsb_prolog+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $xsb_prolog in + [\\/]* | ?:[\\/]*) + ac_cv_path_xsb_prolog="$xsb_prolog" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_xsb_prolog="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +xsb_prolog=$ac_cv_path_xsb_prolog +if test -n "$xsb_prolog"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsb_prolog" >&5 +$as_echo "$xsb_prolog" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +if test x$xsb_prolog != x +then + xsb_emu_dir=`xsb --nobanner --quietload --noprompt \ + -e "write('emudir='), \ + xsb_configuration(emudir, X), write(X), nl, halt." \ + 2>/dev/null | sed "s/^emudir=//g"` + xsb_config_dir=`xsb --nobanner --quietload --noprompt \ + -e "write('config_dir='), \ + xsb_configuration(config_dir,X), write(X), nl, halt." \ + 2>/dev/null | sed "s/^config_dir=//g"` + XSB_PROLOG_INCLUDE_OPTIONS="-I${xsb_emu_dir} -I${xsb_config_dir}" +fi +if test x$xsb_prolog != x +then + have_xsb_prolog=yes +else + have_xsb_prolog=no +fi +fi +if test x${xsb_prolog_interface_enabled} = xyes \ +&& test x$have_xsb_prolog = xyes +then + build_xsb_prolog_interface=yes +fi + if test x$build_xsb_prolog_interface = xyes; then + BUILD_XSB_PROLOG_INTERFACE_TRUE= + BUILD_XSB_PROLOG_INTERFACE_FALSE='#' +else + BUILD_XSB_PROLOG_INTERFACE_TRUE='#' + BUILD_XSB_PROLOG_INTERFACE_FALSE= +fi +# Checks for YAP. +if test x${yap_prolog_interface_enabled} = xyes +then +# Extract the first word of "yap", so it can be a program name with args. +set dummy yap; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_yap_prolog+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $yap_prolog in + [\\/]* | ?:[\\/]*) + ac_cv_path_yap_prolog="$yap_prolog" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_yap_prolog="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +yap_prolog=$ac_cv_path_yap_prolog +if test -n "$yap_prolog"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $yap_prolog" >&5 +$as_echo "$yap_prolog" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +if test x$yap_prolog != x +then + YAP_PROLOG_INCLUDE_OPTIONS="" + YAP_PROLOG_LD_OPTIONS="-lYap" + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $YAP_PROLOG_INCLUDE_OPTIONS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + # Check for YAP's foreign language interface header file. + ac_fn_cxx_check_header_mongrel "$LINENO" "Yap/c_interface.h" "ac_cv_header_Yap_c_interface_h" "$ac_includes_default" +if test "x$ac_cv_header_Yap_c_interface_h" = xyes; then : +else + yap_prolog="" +fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + CPPFLAGS="$ac_save_CPPFLAGS" + YAP_PROLOG="$yap_prolog" +fi +if test x$yap_prolog != x +then + have_yap_prolog=yes +else + have_yap_prolog=no +fi +fi +if test x${yap_prolog_interface_enabled} = xyes \ +&& test x$have_yap_prolog = xyes +then + build_yap_prolog_interface=yes +fi + if test x$build_yap_prolog_interface = xyes; then + BUILD_YAP_PROLOG_INTERFACE_TRUE= + BUILD_YAP_PROLOG_INTERFACE_FALSE='#' +else + BUILD_YAP_PROLOG_INTERFACE_TRUE='#' + BUILD_YAP_PROLOG_INTERFACE_FALSE= +fi +# Test if some Prolog interfaces have to be built. +if test x$build_ciao_prolog_interface = xyes \ +|| test x$build_gnu_prolog_interface = xyes \ +|| test x$build_sicstus_prolog_interface = xyes \ +|| test x$build_swi_prolog_interface = xyes \ +|| test x$build_xsb_prolog_interface = xyes \ +|| test x$build_yap_prolog_interface = xyes +then + build_some_prolog_interfaces=yes +fi + if test x$build_some_prolog_interfaces = xyes; then + BUILD_SOME_PROLOG_INTERFACES_TRUE= + BUILD_SOME_PROLOG_INTERFACES_FALSE='#' +else + BUILD_SOME_PROLOG_INTERFACES_TRUE='#' + BUILD_SOME_PROLOG_INTERFACES_FALSE= +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || - test -n "$runpath_var_CXX" || - test "X$hardcode_automatic_CXX" = "Xyes" ; then +if test x$build_c_interface = xyes \ +|| test x$build_java_interface = xyes \ +|| test x$build_ocaml_interface = xyes \ +|| test x$build_some_prolog_interfaces = xyes +then + # Look for a recent enough version of GNU M4. - # We can hardcode non-existent directories. - if test "$hardcode_direct_CXX" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU M4 that supports accurate traces" >&5 +$as_echo_n "checking for GNU M4 that supports accurate traces... " >&6; } +if ${ac_cv_path_M4+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.m4f +if test -z "$M4"; then + ac_path_M4_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in m4 gm4 gnum4; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_M4="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_M4" || continue + # Root out GNU M4 1.4.4, as well as non-GNU m4 that ignore -t, -F. + ac_snippet=change'quote(<,>)in''dir(,mac,bug)d'nl + test -z "`$ac_path_M4 -F conftest.m4f &1`" \ + && test -z "`echo $ac_snippet | $ac_path_M4 --trace=mac 2>&1`" \ + && test -f conftest.m4f \ + && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=: + rm -f conftest.m4f + $ac_path_M4_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_M4"; then + as_fn_error $? "no acceptable m4 could be found in \$PATH. +GNU M4 1.4.5 or later is required; 1.4.11 or later is recommended" "$LINENO" 5 fi else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported + ac_cv_path_M4=$M4 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 -$as_echo "$hardcode_action_CXX" >&6; } -if test "$hardcode_action_CXX" = relink || - test "$inherit_rpath_CXX" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_M4" >&5 +$as_echo "$ac_cv_path_M4" >&6; } + M4=$ac_cv_path_M4 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how m4 supports trace files" >&5 +$as_echo_n "checking how m4 supports trace files... " >&6; } +if ${ac_cv_prog_gnu_m4_debugfile+:} false; then : + $as_echo_n "(cached) " >&6 +else + case `$M4 --help < /dev/null 2>&1` in + *debugfile*) ac_cv_prog_gnu_m4_debugfile=--debugfile ;; + *) ac_cv_prog_gnu_m4_debugfile=--error-output ;; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gnu_m4_debugfile" >&5 +$as_echo "$ac_cv_prog_gnu_m4_debugfile" >&6; } + M4_DEBUGFILE=$ac_cv_prog_gnu_m4_debugfile +fi +# Define the list of instantiations that are enabled by default. +# Different instantiations are separated by a '@' character. +di=" Polyhedron @ Grid" +di="${di} @ Rational_Box" +di="${di} @ BD_Shape @ BD_Shape" +di="${di} @ Octagonal_Shape @ Octagonal_Shape" +di="${di} @ Constraints_Product" +di="${di} @ Pointset_Powerset" +di="${di} @ Pointset_Powerset" +if test $ac_supported_double = 1 +then + di="${di} @ Double_Box @ BD_Shape @ Octagonal_Shape" +fi +default_instantiations="${di}" +# Define the list of all instantiations. +# Different instantiations are separated by a '@' character. +ai=" Int8_Box @ Int16_Box @ Int32_Box @ Int64_Box" +ai="${ai} @ Uint8_Box @ Uint16_Box @ Uint32_Box @ Uint64_Box" +ai="${ai} @ Z_Box @ Rational_Box" +ai="${ai} @ BD_Shape @ BD_Shape" +ai="${ai} @ BD_Shape @ BD_Shape" +ai="${ai} @ BD_Shape @ BD_Shape" +ai="${ai} @ Octagonal_Shape @ Octagonal_Shape" +ai="${ai} @ Octagonal_Shape @ Octagonal_Shape" +ai="${ai} @ Octagonal_Shape @ Octagonal_Shape" +ai="${ai} @ Polyhedron @ Grid" +ai="${ai} @ Pointset_Powerset @ Pointset_Powerset" +ai="${ai} @ Pointset_Powerset @ Pointset_Powerset" +ai="${ai} @ Pointset_Powerset @ Pointset_Powerset" +ai="${ai} @ Pointset_Powerset @ Pointset_Powerset" +ai="${ai} @ Pointset_Powerset @ Pointset_Powerset" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset >" +ai="${ai} @ Pointset_Powerset" +ai="${ai} @ Pointset_Powerset" +ai="${ai} @ Pointset_Powerset" +ai="${ai} @ Constraints_Product" +ai="${ai} @ Constraints_Product" +ai="${ai} @ Constraints_Product" +ai="${ai} @ Constraints_Product" +if test $ac_supported_float = 1 +then + ai="${ai} @ Float_Box @ BD_Shape" + ai="${ai} @ Octagonal_Shape" + ai="${ai} @ Pointset_Powerset" + ai="${ai} @ Pointset_Powerset >" + ai="${ai} @ Pointset_Powerset >" +fi +if test $ac_supported_double = 1 +then + ai="${ai} @ Double_Box @ BD_Shape" + ai="${ai} @ Octagonal_Shape" + ai="${ai} @ Pointset_Powerset" + ai="${ai} @ Pointset_Powerset >" + ai="${ai} @ Pointset_Powerset >" +fi +if test $ac_supported_long_double = 1 +then + ai="${ai} @ Long_Double_Box @ BD_Shape" + ai="${ai} @ Octagonal_Shape" + ai="${ai} @ Pointset_Powerset" + ai="${ai} @ Pointset_Powerset >" + ai="${ai} @ Pointset_Powerset >" +fi +available_instantiations=${ai} +enableval=not_specified +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which instantiations are enabled" >&5 +$as_echo_n "checking which instantiations are enabled... " >&6; } +# Check whether --enable-instantiations was given. +if test "${enable_instantiations+set}" = set; then : + enableval=$enable_instantiations; +fi +case x"${enableval}" in +xyes | x) + ai_one_per_line=`echo "${available_instantiations}" | sed -e 's/ *@ */\n/g' -e 's/ *\([A-Z]\)/\1/g'` + as_fn_error $? " +--enable-instantiations needs at least one argument chosen among none, +all, and an @-separated list of instantiation specifiers included +in the following list: +${ai_one_per_line}" "$LINENO" 5 + ;; +xno | xnone) + enableval= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } + ;; +*) + if test x"${enableval}" = xnot_specified + then + enableval=${default_instantiations} + elif test x"${enableval}" = xall + then + enableval=${available_instantiations} + fi + # Avoid extra blanks. + required_instantiations=`echo "${enableval}" | sed -e 's/[ ][ ]*/ /g' -e 's/[ ]*\([@<>,]\)/\1/g' -e 's/\([@<>,]\)[ ]*/\1/g' -e 's/>>/> >/g' -e 's/^[ ]//g' -e 's/[ ]$//g'` + # Check the specified instantiations for validity. + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I${srcdir} ${gmp_include_options}" + old_IFS="${IFS}" + IFS=@ + set -- ${required_instantiations} + IFS="${old_IFS}" + for instantiation + do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - - - +#include "instchk.hh" +using namespace Parma_Polyhedra_Library; +bool valid = ${instantiation}::valid_instantiation(); +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + valid_instantiation=yes +else + valid_instantiation=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test x${valid_instantiation} != xyes + then + as_fn_error $? "invalid instantiation ${instantiation}" "$LINENO" 5 + fi + done + CPPFLAGS="$ac_save_CPPFLAGS" + required_instantiations_canonical_names=`echo "${required_instantiations}" | sed -e 's/> //g' -e 's/>//g' -e 's/[< ,]/_/g'` + required_instantiations_c_source_names=`echo "${required_instantiations_canonical_names}" | sed -e 's/@Pointset_Powerset_Polyhedron/@Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g' -e 's/^Pointset_Powerset_Polyhedron/Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g'` + required_instantiations_c_cxx_objects=`echo "${required_instantiations_c_source_names}" | sed -e 's/@/.lo /g' -e 's/$/.lo/g' | sed -e 's/\([^. ]*\)\.lo/ppl_c_\1.lo/g'` + required_instantiations_c_cxx_sources=`echo "${required_instantiations_c_cxx_objects}" | sed -e 's/\([^. ]*\)\.lo/\1.cc/g'` + required_instantiations_c_cxx_headers=`echo "${required_instantiations_c_cxx_sources}" | sed -e 's/\.cc/.hh/g'` + required_instantiations_prolog_source_names=`echo "${required_instantiations_canonical_names}" | sed -e 's/@Pointset_Powerset_Polyhedron/@Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g' -e 's/^Pointset_Powerset_Polyhedron/Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g'` + required_instantiations_prolog_cxx_objects=`echo "${required_instantiations_prolog_source_names}" | sed -e 's/@/.lo /g' -e 's/$/.lo/g' | sed -e 's/\([^. ]*\)\.lo/ppl_prolog_\1.lo/g'` + required_instantiations_prolog_cxx_sources=`echo "${required_instantiations_prolog_cxx_objects}" | sed -e 's/\([^. ]*\)\.lo/\1.cc/g'` + required_instantiations_prolog_cxx_headers=`echo "${required_instantiations_prolog_cxx_sources}" | sed -e 's/\.cc/.hh/g'` + required_instantiations_prolog_generated_test_sources=`echo "${required_instantiations_prolog_source_names}" | sed -e 's/@/.pl /g' -e 's/$/.pl/g' | sed -e 's/\([^. ]*\)\.pl/ppl_prolog_generated_test_\1.pl/g'` + required_instantiations_java_source_names=`echo "${required_instantiations_canonical_names}" | sed -e 's/^Polyhedron/Polyhedron@C_Polyhedron@NNC_Polyhedron/g' -e 's/@Polyhedron/@Polyhedron@C_Polyhedron@NNC_Polyhedron/g' -e 's/@Pointset_Powerset_Polyhedron/@Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g' -e 's/^Pointset_Powerset_Polyhedron/Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g' | sed -e 's/Pointset_Powerset_[a-zA-Z0-9_]*/&@&_Iterator/g'` + required_instantiations_java_sources=`echo "${required_instantiations_java_source_names}" | sed -e 's/@/.java /g' -e 's/$/.java/g'` + required_instantiations_java_classes=`echo "${required_instantiations_java_sources}" | sed -e 's/\.java/.class/g'` + required_instantiations_java_cxx_headers=`echo "${required_instantiations_java_sources}" | sed -e 's/\([^. ]*\)\.java/parma_polyhedra_library.\1/g'` + required_instantiations_java_cxx_headers_sources=`echo "${required_instantiations_java_sources}" | sed -e 's/\([^. ]*\)\.java/parma_polyhedra_library_\1.h/g'` + required_instantiations_java_cxx_objects=`echo "${required_instantiations_canonical_names}" | sed -e 's/@/.lo /g' -e 's/$/.lo/g' | sed -e 's/\([^. ]*\)\.lo/ppl_java_\1.lo/g'` + required_instantiations_java_cxx_sources=`echo "${required_instantiations_java_cxx_objects}" | sed -e 's/\([^. ]*\)\.lo/\1.cc/g'` + required_instantiations_ocaml_source_names=`echo "${required_instantiations_canonical_names}" | sed -e 's/@Pointset_Powerset_Polyhedron/@Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g' -e 's/^Pointset_Powerset_Polyhedron/Pointset_Powerset_C_Polyhedron@Pointset_Powerset_NNC_Polyhedron/g'` + required_instantiations_ocaml_cxx_objects=`echo "${required_instantiations_ocaml_source_names}" | sed -e 's/@/.o /g' -e 's/$/.o/g' | sed -e 's/\([^. ]*\)\.o/ppl_ocaml_\1.o/g'` + required_instantiations_ocaml_cxx_sources=`echo "${required_instantiations_ocaml_cxx_objects}" | sed -e 's/\([^. ]*\)\.o/\1.cc/g'` + required_instantiations_ocaml_cxx_headers=`echo "${required_instantiations_ocaml_cxx_sources}" | sed -e 's/\.cc/.hh/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${required_instantiations}" >&5 +$as_echo "${required_instantiations}" >&6; } + ;; +esac - ac_config_commands="$ac_config_commands libtool" +enableval=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tests should be run under Valgrind" >&5 +$as_echo_n "checking whether tests should be run under Valgrind... " >&6; } +# Check whether --enable-valgrind-tests was given. +if test "${enable_valgrind_tests+set}" = set; then : + enableval=$enable_valgrind_tests; +fi +case "${enableval}" in +yes) + # Extract the first word of "valgrind", so it can be a program name with args. +set dummy valgrind; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_VALGRIND+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$VALGRIND"; then + ac_cv_prog_VALGRIND="$VALGRIND" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_VALGRIND="valgrind" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +VALGRIND=$ac_cv_prog_VALGRIND +if test -n "$VALGRIND"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VALGRIND" >&5 +$as_echo "$VALGRIND" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Only expand once: + if test x"$VALGRIND" = xvalgrind + then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + enable_valgrind_tests=yes + else + as_fn_error $? "bad value ${enableval} for --enable-valgrind-tests, cannot find Valgrind" "$LINENO" 5 + fi + ;; +no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + enable_valgrind_tests=no + ;; +*) + as_fn_error $? "bad value ${enableval} for --enable-valgrind-tests, needs yes or no" "$LINENO" 5 + ;; +esac + if test x"$enable_valgrind_tests" = xyes; then + VALGRIND_TESTS_ENABLED_TRUE= + VALGRIND_TESTS_ENABLED_FALSE='#' +else + VALGRIND_TESTS_ENABLED_TRUE='#' + VALGRIND_TESTS_ENABLED_FALSE= +fi - if test x"$enable_shared" = xyes; then - ENABLE_SHARED_TRUE= - ENABLE_SHARED_FALSE='#' -else - ENABLE_SHARED_TRUE='#' - ENABLE_SHARED_FALSE= +enableval=quick +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`make check' does a thorough or quick check" >&5 +$as_echo_n "checking whether \`make check' does a thorough or quick check... " >&6; } +# Check whether --enable-check was given. +if test "${enable_check+set}" = set; then : + enableval=$enable_check; fi - if test x"$enable_static" = xyes; then - ENABLE_STATIC_TRUE= - ENABLE_STATIC_FALSE='#' +case "${enableval}" in +thorough) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: thorough" >&5 +$as_echo "thorough" >&6; } + ;; +quick) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: quick" >&5 +$as_echo "quick" >&6; } + ;; +*) + as_fn_error $? "bad value ${enableval} for --enable-check, needs thorough or quick" "$LINENO" 5 + ;; +esac + if test x"$enableval" = xthorough; then + THOROUGH_MAKE_CHECK_TRUE= + THOROUGH_MAKE_CHECK_FALSE='#' else - ENABLE_STATIC_TRUE='#' - ENABLE_STATIC_FALSE= + THOROUGH_MAKE_CHECK_TRUE='#' + THOROUGH_MAKE_CHECK_FALSE= fi @@ -23715,6 +25370,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_link="./libtool --mode=link --tag=CC $ac_link" for ac_header in glpk.h glpk/glpk.h do : @@ -23797,6 +25453,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" # Checks for header declarations. @@ -23964,6 +25621,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can limit memory in C++ using setrlimit()" >&5 @@ -24077,6 +25735,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" @@ -24092,6 +25751,9 @@ if test x"$ICC" = xyes then CFLAGS="$CFLAGS -w2 -wd161,177,193,279,383,444,981,1098,1188,1418,1419,1572" + elif test x"$CLANG" = xyes + then + CFLAGS="$CFLAGS -Weverything -Wno-exit-time-destructors -Wno-global-constructors -Wno-documentation -Wno-missing-noreturn -Wno-covered-switch-default -Wno-unreachable-code -Wno-c++98-compat-pedantic -Wno-switch-enum -Wno-sign-conversion -Wno-c++98-compat -Wno-padded -Wno-disabled-macro-expansion -Wno-c++11-long-long -Wno-zero-length-array" else CFLAGS="$CFLAGS -W -Wall" fi @@ -24101,11 +25763,69 @@ if test x"$ICPC" = xyes then CXXFLAGS="$CXXFLAGS -w2 -wd161,177,193,279,383,444,981,1098,1188,1418,1419,1572" + elif test x"$CLANGXX" = xyes + then + CXXFLAGS="$CXXFLAGS -Weverything -Wno-exit-time-destructors -Wno-global-constructors -Wno-documentation -Wno-missing-noreturn -Wno-covered-switch-default -Wno-unreachable-code -Wno-c++98-compat-pedantic -Wno-switch-enum -Wno-sign-conversion -Wno-c++98-compat -Wno-padded -Wno-disabled-macro-expansion -Wno-c++11-long-long -Wno-zero-length-array" else CXXFLAGS="$CXXFLAGS -W -Wall" fi fi +# Check if the C++ compiler supports C++11 features. + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports C++11 features" >&5 +$as_echo_n "checking if the C++ compiler supports C++11 features... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +template +struct check final { + static constexpr T value{ __cplusplus }; +}; + +typedef check> right_angle_brackets; + +int a; +decltype(a) b; + +typedef check check_type; +check_type c{}; +check_type&& cr = static_cast(c); + +static_assert(check_type::value == 201103L, "C++11 compiler"); + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_cv_check_cxx11=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ac_cv_check_cx11=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_link="./libtool --mode=link --tag=CXX $ac_link" + +if test "$ac_cv_check_cxx11" = yes; then + +$as_echo "#define HAVE_CXX11 /**/" >>confdefs.h + +fi + LIBEXT=$libext @@ -24377,6 +26097,14 @@ as_fn_error $? "conditional \"SUPPORTED_SOME_FLOATING_POINT_TYPE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_SHARED_TRUE}" && test -z "${ENABLE_SHARED_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_SHARED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_PPL_LCDD_TRUE}" && test -z "${BUILD_PPL_LCDD_FALSE}"; then as_fn_error $? "conditional \"BUILD_PPL_LCDD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -24453,14 +26181,6 @@ as_fn_error $? "conditional \"THOROUGH_MAKE_CHECK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_SHARED_TRUE}" && test -z "${ENABLE_SHARED_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_SHARED\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_STATIC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${HAVE_MD5SUM_TRUE}" && test -z "${HAVE_MD5SUM_FALSE}"; then as_fn_error $? "conditional \"HAVE_MD5SUM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -24866,7 +26586,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by the Parma Polyhedra Library $as_me 1.1, which was +This file was extended by the Parma Polyhedra Library $as_me 1.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -24932,7 +26652,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -the Parma Polyhedra Library config.status 1.1 +the Parma Polyhedra Library config.status 1.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -25425,6 +27145,7 @@ +ac_aux_dir='$ac_aux_dir' diff -Nru ppl-1.1/configure.ac ppl-1.2/configure.ac --- ppl-1.1/configure.ac 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/configure.ac 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Autoconf source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -24,7 +24,7 @@ # Process this file with Autoconf to produce a configure script. # Every other copy of the package version number gets its value from here. -AC_INIT([the Parma Polyhedra Library], [1.1], [ppl-devel@cs.unipr.it], [ppl]) +AC_INIT([the Parma Polyhedra Library], [1.2], [ppl-devel@cs.unipr.it], [ppl]) # Minimum Autoconf version required. AC_PREREQ(2.61) @@ -280,7 +280,6 @@ AC_LANG_POP(C++) fi - AC_PROG_FGREP AC_PROG_EGREP AC_PROG_SED @@ -538,7 +537,7 @@ OPT_FLAGS="$OPT_FLAGS -fp-model strict -fp-speculation off" else # -frounding-math is not yet supported in clang++ or llvm-g++. - if test x"$CLANGXX" = xyes || x"$LLVM_GXX" = xyes + if test x"$CLANGXX" = xyes || test x"$LLVM_GXX" = xyes then if test x"$use_fpmath" = xyes then @@ -852,6 +851,17 @@ AC_TYPE_UINTPTR_T +# Libtool. +LT_PREREQ([1.5.24]) +LT_INIT([dlopen,win32-dll]) +AM_CONDITIONAL(ENABLE_SHARED, test x"$enable_shared" = xyes) +AM_CONDITIONAL(ENABLE_STATIC, test x"$enable_static" = xyes) + + +# Make sure libtool is used for linking. +AC_USE_LIBTOOL + + # Checks on the GMP library. AC_CHECK_GMP @@ -1491,12 +1501,6 @@ esac AM_CONDITIONAL(THOROUGH_MAKE_CHECK, test x"$enableval" = xthorough) -# Libtool. -LT_PREREQ([1.5.24]) -LT_INIT([dlopen,win32-dll]) -AM_CONDITIONAL(ENABLE_SHARED, test x"$enable_shared" = xyes) -AM_CONDITIONAL(ENABLE_STATIC, test x"$enable_static" = xyes) - # Checks for md5sum. AC_CHECK_PROG(MD5SUM, md5sum, md5sum) AM_CONDITIONAL(HAVE_MD5SUM, test x$MD5SUM = xmd5sum) @@ -1606,6 +1610,9 @@ if test x"$ICC" = xyes then CFLAGS="$CFLAGS -w2 -wd161,177,193,279,383,444,981,1098,1188,1418,1419,1572" + elif test x"$CLANG" = xyes + then + CFLAGS="$CFLAGS -Weverything -Wno-exit-time-destructors -Wno-global-constructors -Wno-documentation -Wno-missing-noreturn -Wno-covered-switch-default -Wno-unreachable-code -Wno-c++98-compat-pedantic -Wno-switch-enum -Wno-sign-conversion -Wno-c++98-compat -Wno-padded -Wno-disabled-macro-expansion -Wno-c++11-long-long -Wno-zero-length-array" else CFLAGS="$CFLAGS -W -Wall" fi @@ -1615,11 +1622,16 @@ if test x"$ICPC" = xyes then CXXFLAGS="$CXXFLAGS -w2 -wd161,177,193,279,383,444,981,1098,1188,1418,1419,1572" + elif test x"$CLANGXX" = xyes + then + CXXFLAGS="$CXXFLAGS -Weverything -Wno-exit-time-destructors -Wno-global-constructors -Wno-documentation -Wno-missing-noreturn -Wno-covered-switch-default -Wno-unreachable-code -Wno-c++98-compat-pedantic -Wno-switch-enum -Wno-sign-conversion -Wno-c++98-compat -Wno-padded -Wno-disabled-macro-expansion -Wno-c++11-long-long -Wno-zero-length-array" else CXXFLAGS="$CXXFLAGS -W -Wall" fi fi +# Check if the C++ compiler supports C++11 features. +AC_CHECK_CXX11 AC_SUBST(LIBEXT, [$libext]) AC_SUBST(SHREXT, [$shrext_cmds]) diff -Nru ppl-1.1/CREDITS ppl-1.2/CREDITS --- ppl-1.1/CREDITS 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/CREDITS 2016-02-11 12:31:26.000000000 +0000 @@ -12,8 +12,8 @@ Roberto Bagnara [1] (BUGSENG srl and University of Parma) Patricia M. Hill [2] (BUGSENG srl and University of Leeds) - Enea Zaffanella [3] (BUGSENG srl and University of Parma) Abramo Bagnara (BUGSENG srl) + Enea Zaffanella [3] (University of Parma) Former Members of the Core Development Team: @@ -29,29 +29,6 @@ Current Contributors: --------------------- - Massimo Benerecetti (University of Naples) is working on additional - operators on polyhedra. - - Andrea Cimino (former student of the University of Parma) - wrote most of the mixed integer programming - solver, and also most of the Java and OCaml - interfaces. He keeps helping us, especially - with the web site. - - Marco Faella (University of Naples) is working on additional - operators on polyhedra. - - Stefano Minopoli (University of Naples) is working on additional - operators on polyhedra. - - Marco Poletti (student of the University of Bologna) - implemented the sparse matrices that are used - in the MIP and PIP solvers of the PPL; he also - did experiments on the parallelization of the - sparse matrices' computations; he is now working - on improving the PPL's memory footprint and - on other improvements to the library. - Alessandro Zaccagnini [4] (University of Parma) has helped with the efficient implementation of GCD and LCM for checked numbers. He is now working on the @@ -59,6 +36,9 @@ Alessandro is always a very valuable source of mathematical advice. + Paulo Cesar Pereira de Andrade + Helps with Fedora packaging. + Past Contributors: ------------------ @@ -73,6 +53,9 @@ whether or not the set-union of two polyhedra is the same as their poly-hull. + Massimo Benerecetti (University of Naples) worked on the positive + time-elapse operator on polyhedra. + Fabio Biselli (student of the University of Parma) did some work on the PPL support for the approximation of floating point computations. @@ -93,11 +76,19 @@ one of the four students with which the PPL project started. + Andrea Cimino (former student of the University of Parma) + wrote most of the mixed integer programming + solver, and also most of the Java and OCaml + interfaces. He helped us a lot with the web site. + Katy Dobson (former student of the University of Leeds) worked on the formalization and definition of algorithms for rational grids and products of grids and polyhedra. + Marco Faella (University of Naples) worked on the positive + time-elapse operator on polyhedra. + Giordano Fracasso (former student of the University of Parma) wrote the initial version of the support for native and checked integer coefficients. @@ -121,6 +112,9 @@ with the generation of the library's documentation using Doxygen. + Stefano Minopoli (University of Naples) worked on the positive + time-elapse operator on polyhedra. + Matthew Mundell [6] (formerly at the University of Leeds) worked on the implementation of rational grids. He has also helped on other implementation issues. @@ -130,6 +124,14 @@ project started. Later, he helped a little with the library's documentation. + Marco Poletti (former student of the University of Bologna) + implemented the sparse matrices that are used + in the MIP and PIP solvers of the PPL; he also + did experiments on the parallelization of the + sparse matrices' computations; he also worked + on improving the PPL's memory footprint and + on other improvements to the library. + Barbara Quartieri (former student of the University of Parma) worked on our implementation of bounded differences and octagons. diff -Nru ppl-1.1/debian/changelog ppl-1.2/debian/changelog --- ppl-1.1/debian/changelog 2016-02-22 14:05:59.000000000 +0000 +++ ppl-1.2/debian/changelog 2016-11-12 16:47:39.000000000 +0000 @@ -1,8 +1,26 @@ -ppl (1:1.1-7.2build1) xenial; urgency=medium +ppl (1:1.2-1) unstable; urgency=medium - * No-change upload for swi-prolog update. + [ Andreas Tille ] + * Team upload + * Move package to Debian Science team Git + * cme fix dpkg-control + * Remove libppl6 breaks + * debhelper 9 - -- Matthias Klose Mon, 22 Feb 2016 15:05:30 +0100 + [ Tobias Hansen ] + * New upstream version. (Closes: #811825, #818957) + * Fix build-indep target (Closes: #806865) + * Rename package libppl13v5 -> libppl14, new soname. + * Remove patches that were applied upstream: + - 0001-Warnings-avoided.patch + - 0002-Adapted-to-SWI-Prolog-version-7.x.patch + - doxygen-update.diff + - latex-header.diff + * Do not use the fixdebugpath flag from dpkg-buildflags, + which breaks the build. + * Add myself to uploaders. + + -- Tobias Hansen Sat, 12 Nov 2016 16:47:39 +0000 ppl (1:1.1-7.2) unstable; urgency=medium diff -Nru ppl-1.1/debian/compat ppl-1.2/debian/compat --- ppl-1.1/debian/compat 2011-03-14 18:58:59.000000000 +0000 +++ ppl-1.2/debian/compat 2016-11-12 15:53:19.000000000 +0000 @@ -1 +1 @@ -5 +9 diff -Nru ppl-1.1/debian/control ppl-1.2/debian/control --- ppl-1.1/debian/control 2015-12-11 21:07:13.000000000 +0000 +++ ppl-1.2/debian/control 2016-11-12 16:20:10.000000000 +0000 @@ -1,21 +1,32 @@ Source: ppl +Maintainer: Debian Science Team +Uploaders: Tobias Hansen , Michael Tautschnig Section: libs Priority: optional -Maintainer: Michael Tautschnig -Standards-Version: 3.9.6 -Build-Depends: debhelper (>= 6.0.7~), dh-autoreconf, - libgmp-dev, swi-prolog [!hurd-i386], chrpath, - libncurses5-dev, libncursesw5-dev -Build-Depends-Indep: doxygen-latex, graphviz, poppler-utils, ghostscript, texlive-math-extra +Build-Depends: debhelper (>= 9), + dh-autoreconf, + dpkg-dev (>= 1.16.1~), + libgmp-dev, + swi-prolog [!hurd-i386], + chrpath, + libncurses5-dev, + libncursesw5-dev +Build-Depends-Indep: doxygen-latex, + graphviz, + poppler-utils, + ghostscript, + texlive-math-extra +Standards-Version: 3.9.8 +Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/ppl.git +Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/ppl.git Homepage: http://www.cs.unipr.it/ppl/ -Package: libppl13v5 +Package: libppl14 Architecture: any Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} -Depends: ${shlibs:Depends}, ${misc:Depends} -Conflicts: libppl13 -Replaces: libppl13 Description: Parma Polyhedra Library (runtime library) The Parma Polyhedra Library (PPL) is a C++ library for the manipulation of (not necessarily closed) convex polyhedra and other @@ -30,16 +41,24 @@ Package: libppl-dev Architecture: any Multi-Arch: same -Pre-Depends: ${misc:Pre-Depends} Section: libdevel -Depends: libppl13v5 (= ${binary:Version}), libppl-c4 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} -Provides: libppl-c-dev, libppl0.12-dev -Recommends: libgmp3-dev (>= 4.1.3) -# B+R: libppl6 can be removed after stretch was released -Replaces: libppl6, libppl7 (<< 0.10~pre27-4), libppl9, libppl0.12-dev -Breaks: libppl6, libppl7 (<< 0.10~pre27-4), libppl9 -Conflicts: libppl0.10-dev, libppl0.11-dev, libppl0.12-dev +Depends: libppl14 (= ${binary:Version}), + libppl-c4 (= ${binary:Version}), + ${shlibs:Depends}, + ${misc:Depends} +Recommends: libgmp3-dev Suggests: libppl-doc +Pre-Depends: ${misc:Pre-Depends} +Breaks: libppl7 (<< 0.10~pre27-4), + libppl9 +Conflicts: libppl0.10-dev, + libppl0.11-dev, + libppl0.12-dev +Provides: libppl-c-dev, + libppl0.12-dev +Replaces: libppl7 (<< 0.10~pre27-4), + libppl9, + libppl0.12-dev Description: Parma Polyhedra Library (development) The Parma Polyhedra Library (PPL) is a C++ library for the manipulation of (not necessarily closed) convex polyhedra and other @@ -56,9 +75,11 @@ Package: ppl-dev Architecture: any -Pre-Depends: ${misc:Pre-Depends} Section: devel -Depends: libppl-dev (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Depends: libppl-dev (= ${binary:Version}), + ${shlibs:Depends}, + ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} Replaces: libppl0.11-dev Description: Parma Polyhedra Library (development binaries) The Parma Polyhedra Library (PPL) is a C++ library for the @@ -76,8 +97,10 @@ Package: libppl-c4 Architecture: any Multi-Arch: same +Depends: libppl14 (= ${binary:Version}), + ${shlibs:Depends}, + ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} -Depends: libppl13v5 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Description: Parma Polyhedra Library (C interface) The Parma Polyhedra Library (PPL) is a C++ library for the manipulation of (not necessarily closed) convex polyhedra and other @@ -94,7 +117,8 @@ Package: libppl-doc Architecture: all Section: doc -Depends: ${misc:Depends}, libjs-jquery +Depends: ${misc:Depends}, + libjs-jquery Description: Parma Polyhedra Library: Documentation The Parma Polyhedra Library (PPL) is a C++ library for the manipulation of (not necessarily closed) convex polyhedra and other @@ -111,8 +135,11 @@ Package: libppl-swi Architecture: any Multi-Arch: same +Depends: libppl14 (= ${binary:Version}), + ${shlibs:Depends}, + ${misc:Depends}, + swi-prolog Pre-Depends: ${misc:Pre-Depends} -Depends: libppl13v5 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, swi-prolog Description: Parma Polyhedra Library (SWI Prolog interface) The Parma Polyhedra Library (PPL) is a C++ library for the manipulation of (not necessarily closed) convex polyhedra and other diff -Nru ppl-1.1/debian/libppl13v5.dirs ppl-1.2/debian/libppl13v5.dirs --- ppl-1.1/debian/libppl13v5.dirs 2015-09-21 11:26:56.000000000 +0000 +++ ppl-1.2/debian/libppl13v5.dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib diff -Nru ppl-1.1/debian/libppl13v5.docs ppl-1.2/debian/libppl13v5.docs --- ppl-1.1/debian/libppl13v5.docs 2015-09-21 11:26:56.000000000 +0000 +++ ppl-1.2/debian/libppl13v5.docs 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -BUGS -NEWS -README -CREDITS - -interfaces/Prolog/SWI/README.swiprolog diff -Nru ppl-1.1/debian/libppl13v5.install ppl-1.2/debian/libppl13v5.install --- ppl-1.1/debian/libppl13v5.install 2015-09-21 11:26:56.000000000 +0000 +++ ppl-1.2/debian/libppl13v5.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/*/libppl.so.* diff -Nru ppl-1.1/debian/libppl14.dirs ppl-1.2/debian/libppl14.dirs --- ppl-1.1/debian/libppl14.dirs 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/debian/libppl14.dirs 2016-11-12 16:11:21.000000000 +0000 @@ -0,0 +1 @@ +usr/lib diff -Nru ppl-1.1/debian/libppl14.docs ppl-1.2/debian/libppl14.docs --- ppl-1.1/debian/libppl14.docs 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/debian/libppl14.docs 2016-11-12 16:11:21.000000000 +0000 @@ -0,0 +1,6 @@ +BUGS +NEWS +README +CREDITS + +interfaces/Prolog/SWI/README.swiprolog diff -Nru ppl-1.1/debian/libppl14.install ppl-1.2/debian/libppl14.install --- ppl-1.1/debian/libppl14.install 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/debian/libppl14.install 2016-11-12 16:11:21.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/*/libppl.so.* diff -Nru ppl-1.1/debian/libppl-c4.links ppl-1.2/debian/libppl-c4.links --- ppl-1.1/debian/libppl-c4.links 2015-09-21 11:26:56.000000000 +0000 +++ ppl-1.2/debian/libppl-c4.links 2016-11-12 16:11:21.000000000 +0000 @@ -1 +1 @@ -usr/share/doc/libppl13v5 usr/share/doc/libppl-c4 +usr/share/doc/libppl14 usr/share/doc/libppl-c4 diff -Nru ppl-1.1/debian/libppl-dev.dirs ppl-1.2/debian/libppl-dev.dirs --- ppl-1.1/debian/libppl-dev.dirs 2009-10-16 09:46:58.000000000 +0000 +++ ppl-1.2/debian/libppl-dev.dirs 2016-11-12 16:47:39.000000000 +0000 @@ -1,3 +1 @@ usr/include -usr/bin -usr/share/man/man1 diff -Nru ppl-1.1/debian/libppl-swi.dirs ppl-1.2/debian/libppl-swi.dirs --- ppl-1.1/debian/libppl-swi.dirs 2012-07-22 10:02:06.000000000 +0000 +++ ppl-1.2/debian/libppl-swi.dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/ppl diff -Nru ppl-1.1/debian/libppl-swi.links ppl-1.2/debian/libppl-swi.links --- ppl-1.1/debian/libppl-swi.links 2015-09-21 11:26:56.000000000 +0000 +++ ppl-1.2/debian/libppl-swi.links 2016-11-12 16:11:21.000000000 +0000 @@ -1 +1 @@ -usr/share/doc/libppl13v5 usr/share/doc/libppl-swi +usr/share/doc/libppl14 usr/share/doc/libppl-swi diff -Nru ppl-1.1/debian/patches/0001-Warnings-avoided.patch ppl-1.2/debian/patches/0001-Warnings-avoided.patch --- ppl-1.1/debian/patches/0001-Warnings-avoided.patch 2015-12-07 20:58:53.000000000 +0000 +++ ppl-1.2/debian/patches/0001-Warnings-avoided.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From 142a58fa623e5b875efa4bd73f1071688a38f0ed Mon Sep 17 00:00:00 2001 -From: Roberto Bagnara -Date: Tue, 24 Nov 2015 10:05:15 +0100 -Subject: [PATCH 1/2] Warnings avoided. - ---- - .../tests/ppl_interface_generator_prolog_generated_test_pl_code.m4 | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl_code.m4 b/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl_code.m4 -index 7b553e3..b2f7c32 100644 ---- a/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl_code.m4 -+++ b/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl_code.m4 -@@ -947,7 +947,7 @@ ppl_@CLASS@_frequency_6_test :- - F_N == F_Nexptd, F_D == F_Dexptd, - V_N == V_Nexptd, V_D == V_Dexptd) - ; -- \+ ppl_@CLASS@_frequency(PS, LE, F_N, F_D, V_N, V_D) -+ \+ ppl_@CLASS@_frequency(PS, LE, _F_N, _F_D, _V_N, _V_D) - ), - ppl_@CLASS@_OK(PS), - ppl_delete_@CLASS@(PS) --- -2.1.4 - diff -Nru ppl-1.1/debian/patches/0002-Adapted-to-SWI-Prolog-version-7.x.patch ppl-1.2/debian/patches/0002-Adapted-to-SWI-Prolog-version-7.x.patch --- ppl-1.1/debian/patches/0002-Adapted-to-SWI-Prolog-version-7.x.patch 2015-12-07 20:59:11.000000000 +0000 +++ ppl-1.2/debian/patches/0002-Adapted-to-SWI-Prolog-version-7.x.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From c9b20bc27d2a9931f131b6c3350eadf3c7f33405 Mon Sep 17 00:00:00 2001 -From: Roberto Bagnara -Date: Tue, 24 Nov 2015 10:05:32 +0100 -Subject: [PATCH 2/2] Adapted to SWI-Prolog version 7.x. - ---- - interfaces/Prolog/SWI/pl_clpq.pl | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/interfaces/Prolog/SWI/pl_clpq.pl b/interfaces/Prolog/SWI/pl_clpq.pl -index 3b87de4..ca1854f 100644 ---- a/interfaces/Prolog/SWI/pl_clpq.pl -+++ b/interfaces/Prolog/SWI/pl_clpq.pl -@@ -21,7 +21,8 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. - For the most up-to-date information see the Parma Polyhedra Library - site: http://bugseng.com/products/ppl/ . */ - --eat_eol. -+eat_eol :- -+ get_code(user_input, _EOL). - - main :- - % FIXME: clearing the prompt as it is done here is a temporary workaround. --- -2.1.4 - diff -Nru ppl-1.1/debian/patches/doxygen-update.diff ppl-1.2/debian/patches/doxygen-update.diff --- ppl-1.1/debian/patches/doxygen-update.diff 2015-04-29 14:12:26.000000000 +0000 +++ ppl-1.2/debian/patches/doxygen-update.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -Index: b/doc/user-language-interface.tex -=================================================================== ---- a/doc/user-language-interface.tex -+++ b/doc/user-language-interface.tex -@@ -74,6 +74,10 @@ - - \newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} - -+\newcommand{\clearemptydoublepage}{% -+ \newpage{\pagestyle{empty}\cleardoublepage}% -+} -+ - \begin{document} - \title{ - \includegraphics[height=9cm]{ppl_logo.pdf} \\ diff -Nru ppl-1.1/debian/patches/latex-header.diff ppl-1.2/debian/patches/latex-header.diff --- ppl-1.1/debian/patches/latex-header.diff 2014-07-25 09:04:38.000000000 +0000 +++ ppl-1.2/debian/patches/latex-header.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -Index: b/doc/devref-language-interface.tex -=================================================================== ---- a/doc/devref-language-interface.tex -+++ b/doc/devref-language-interface.tex -@@ -72,6 +72,8 @@ - - \setlength{\headheight}{24pt} - -+\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} -+ - \begin{document} - \title{ - \includegraphics[height=9cm]{ppl_logo.pdf} \\ -Index: b/doc/user-language-interface.tex -=================================================================== ---- a/doc/user-language-interface.tex -+++ b/doc/user-language-interface.tex -@@ -72,6 +72,8 @@ - - \setlength{\headheight}{24pt} - -+\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} -+ - \begin{document} - \title{ - \includegraphics[height=9cm]{ppl_logo.pdf} \\ diff -Nru ppl-1.1/debian/patches/link-tests-with-libmpq.diff ppl-1.2/debian/patches/link-tests-with-libmpq.diff --- ppl-1.1/debian/patches/link-tests-with-libmpq.diff 2014-07-25 16:45:29.000000000 +0000 +++ ppl-1.2/debian/patches/link-tests-with-libmpq.diff 2016-11-10 19:33:35.000000000 +0000 @@ -1,8 +1,6 @@ -Index: b/tests/Makefile.am -=================================================================== --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -45,6 +45,9 @@ files.hh \ +@@ -45,6 +45,9 @@ files.cc \ ppl_test.cc @@ -12,17 +10,3 @@ LDADD = \ $(top_builddir)/src/libppl.la \ libppl_tests.a \ -Index: b/tests/Watchdog/Makefile.am -=================================================================== ---- a/tests/Watchdog/Makefile.am -+++ b/tests/Watchdog/Makefile.am -@@ -46,7 +46,8 @@ AM_CPPFLAGS = \ - - LDADD = \ - $(top_builddir)/tests/libppl_tests.a \ --$(top_builddir)/src/libppl.la -+$(top_builddir)/src/libppl.la \ -+@extra_libraries@ - - EXTRA_DIST = - diff -Nru ppl-1.1/debian/patches/series ppl-1.2/debian/patches/series --- ppl-1.1/debian/patches/series 2015-12-07 21:06:22.000000000 +0000 +++ ppl-1.2/debian/patches/series 2016-11-12 00:08:53.000000000 +0000 @@ -1,7 +1,3 @@ # empty -latex-header.diff link-tests-with-libmpq.diff -doxygen-update.diff reproducible_builds_gzip_n -0001-Warnings-avoided.patch -0002-Adapted-to-SWI-Prolog-version-7.x.patch diff -Nru ppl-1.1/debian/rules ppl-1.2/debian/rules --- ppl-1.1/debian/rules 2015-07-22 12:59:42.000000000 +0000 +++ ppl-1.2/debian/rules 2016-11-12 16:26:54.000000000 +0000 @@ -20,10 +20,12 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) -CFLAGS = $(dpkg-buildflags --get CFLAGS) -Wall -g -CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS) -Wall -g -fpermissive -LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) +# This flag breaks the build. +export DEB_BUILD_MAINT_OPTIONS=reproducible=-fixdebugpath +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk +CFLAGS += -Wall -g +CXXFLAGS += -Wall -g -fpermissive ifeq ($(DEB_HOST_MULTIARCH),arm-linux-gnueabihf) CFLAGS += -marm @@ -109,7 +111,7 @@ endif build-indep: build-indep-stamp -build-indep-stamp: configure-stamp +build-indep-stamp: configure-stamp build-arch-stamp export save_size=10000 ; $(MAKE) -C doc user-configured touch $@ @@ -132,6 +134,7 @@ dh_installdirs -i # Build all the documentation, then move it into debian/tmp # directories which have fixed names. + $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp mkdir -p $(DOC_DIR)/html || exit 1 mv $(DOC_DIR)/ppl-user-$(PPL_VERSION)-html $(DOC_DIR)/html/user-manual mv $(DOC_DIR)/ppl-user-$(PPL_VERSION).pdf $(DOC_DIR)/ppl-user-browse.pdf @@ -147,7 +150,7 @@ mkdir -p debian/tmp/usr/include/$(DEB_HOST_MULTIARCH) mv debian/tmp/usr/include/*.*h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/ -chrpath -d \ - debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libppl.so.13.0.0 \ + debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libppl.so.14.0.0 \ debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libppl_c.so.4.0.0 \ debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ppl/libppl_swiprolog.so diff -Nru ppl-1.1/demos/Makefile.am ppl-1.2/demos/Makefile.am --- ppl-1.1/demos/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/demos/Makefile.in ppl-1.2/demos/Makefile.in --- ppl-1.1/demos/Makefile.in 2013-10-28 12:44:51.000000000 +0000 +++ ppl-1.2/demos/Makefile.in 2016-02-11 12:31:41.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -105,6 +105,7 @@ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -124,7 +125,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/demos/ppl_lcdd/examples/Makefile.am ppl-1.2/demos/ppl_lcdd/examples/Makefile.am --- ppl-1.1/demos/ppl_lcdd/examples/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_lcdd/examples/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/demos/ppl_lcdd/examples/Makefile.in ppl-1.2/demos/ppl_lcdd/examples/Makefile.in --- ppl-1.1/demos/ppl_lcdd/examples/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/demos/ppl_lcdd/examples/Makefile.in 2016-02-11 12:31:41.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -106,6 +106,7 @@ $(top_srcdir)/mkinstalldirs $(dist_noinst_DATA) README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -125,7 +126,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/demos/ppl_lcdd/Makefile.am ppl-1.2/demos/ppl_lcdd/Makefile.am --- ppl-1.1/demos/ppl_lcdd/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_lcdd/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/demos/ppl_lcdd/Makefile.in ppl-1.2/demos/ppl_lcdd/Makefile.in --- ppl-1.1/demos/ppl_lcdd/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/demos/ppl_lcdd/Makefile.in 2016-02-11 12:31:41.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -108,6 +108,7 @@ $(dist_man_MANS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -127,7 +128,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/demos/ppl_lcdd/ppl_lcdd.1 ppl-1.2/demos/ppl_lcdd/ppl_lcdd.1 --- ppl-1.1/demos/ppl_lcdd/ppl_lcdd.1 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_lcdd/ppl_lcdd.1 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.11. -.TH PPL_LCDD "1" "October 2013" "ppl_lcdd 1.1" "User Commands" +.TH PPL_LCDD "1" "February 2016" "ppl_lcdd 1.2" "User Commands" .SH NAME ppl_lcdd \- a PPL-based program for vertex/facet enumeration of convex polyhedra .SH SYNOPSIS @@ -51,7 +51,7 @@ Report bugs to . .SH COPYRIGHT Copyright (C) 2001\-2010 Roberto Bagnara -Copyright (C) 2010\-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010\-2016 BUGSENG srl (http://bugseng.com) .br This is free software; see the file \fBCOPYING\fR in the source distribution or use the command \fBppl\-config \-\-copying\fR to diff -Nru ppl-1.1/demos/ppl_lcdd/ppl_lcdd.cc ppl-1.2/demos/ppl_lcdd/ppl_lcdd.cc --- ppl-1.1/demos/ppl_lcdd/ppl_lcdd.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_lcdd/ppl_lcdd.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* A sort of clone of the cddlib test program `lcdd'. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -21,8 +21,12 @@ For the most up-to-date information see the Parma Polyhedra Library site: http://bugseng.com/products/ppl/ . */ -//#define USE_POLKA 1 -//#define USE_POLYLIB 1 +#if 0 +#define USE_POLKA 1 +#endif +#if 0 +#define USE_POLYLIB 1 +#endif #if (!defined(USE_PPL) && !defined(USE_POLKA) && !defined(USE_POLYLIB)) #define USE_PPL 1 @@ -45,12 +49,6 @@ typedef PPL::C_Polyhedron POLYHEDRON_TYPE; -#if !PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK -extern "C" void -ppl_set_GMP_memory_allocation_functions(void) { -} -#endif - #elif defined(USE_POLKA) #include @@ -164,30 +162,35 @@ }; #endif -static const char* usage_string -= "Usage: %s [OPTION]... [FILE]\n" -"Reads an H-representation (resp., a V-representation) of a polyhedron\n" -"and generates a V-representation (resp., an H-representation) of\n" -"the same polyhedron.\n\n" -"Options:\n" +void +usage(const char* program) { + static const char* usage_string + = "Usage: %s [OPTION]... [FILE]\n" + "Reads an H-representation (resp., a V-representation) of a polyhedron\n" + "and generates a V-representation (resp., an H-representation) of\n" + "the same polyhedron.\n\n" + "Options:\n" #ifdef PPL_LCDD_SUPPORTS_LIMIT_ON_CPU_TIME -" -CSECS, --max-cpu=SECS limits CPU usage to SECS seconds\n" + " -CSECS, --max-cpu=SECS limits CPU usage to SECS seconds\n" #endif // defined(PPL_LCDD_SUPPORTS_LIMIT_ON_CPU_TIME) -" -RMB, --max-memory=MB limits memory usage to MB megabytes\n" -" -h, --help prints this help text to stdout\n" -" -oPATH, --output=PATH appends output to PATH\n" -" -t, --timings prints timings to stderr\n" -" -v, --verbose produces lots of output\n" + " -RMB, --max-memory=MB limits memory usage to MB megabytes\n" + " -h, --help prints this help text to stdout\n" + " -oPATH, --output=PATH appends output to PATH\n" + " -t, --timings prints timings to stderr\n" + " -v, --verbose produces lots of output\n" #if defined(USE_PPL) -" -V, --version prints version information to stdout\n" -" -cPATH, --check=PATH checks if the result is equal to what is in PATH\n" + " -V, --version prints version information to stdout\n" + " -cPATH, --check=PATH checks if result is equal to what is in PATH\n" #endif #ifndef PPL_HAVE_GETOPT_H -"\n" -"NOTE: this version does not support long options.\n" + "\n" + "NOTE: this version does not support long options.\n" #endif -"\n" -"Report bugs to .\n"; + "\n" + "Report bugs to .\n"; + + fprintf(stdout, usage_string, program); +} #if defined(USE_PPL) #define OPTION_LETTERS "C:R:ho:tvVc:" @@ -217,20 +220,21 @@ exit(1); } -namespace { const char* input_file_name = 0; std::istream* input_stream_p = 0; void set_input(const char* file_name) { - if (input_stream_p && *input_stream_p != std::cin) + if (input_stream_p && (input_stream_p != &std::cin)) { delete input_stream_p; + } if (file_name) { input_stream_p = new std::ifstream(file_name, std::ios_base::in); - if (!*input_stream_p) + if (!*input_stream_p) { fatal("cannot open input file `%s'", file_name); + } input_file_name = file_name; } else { @@ -250,15 +254,17 @@ void set_output(const char* file_name) { - if (output_stream_p && *output_stream_p != std::cout) + if (output_stream_p && (output_stream_p != &std::cout)) { delete output_stream_p; + } if (file_name) { output_stream_p = new std::ofstream(file_name, std::ios_base::out | std::ios_base::app); - if (!*output_stream_p) + if (!*output_stream_p) { fatal("cannot open output file `%s'", file_name); + } output_file_name = file_name; } else { @@ -273,8 +279,6 @@ return *output_stream_p; } -} // namespace - void error(const char* format, ...) { va_list ap; @@ -316,17 +320,19 @@ # error "Either SA_ONESHOT or SA_RESETHAND must be defined." #endif - if (sigaction(SIGXCPU, &s, 0) != 0) + if (sigaction(SIGXCPU, &s, 0) != 0) { fatal("sigaction failed: %s", strerror(errno)); + } struct rlimit t; - if (getrlimit(RLIMIT_CPU, &t) != 0) + if (getrlimit(RLIMIT_CPU, &t) != 0) { fatal("getrlimit failed: %s", strerror(errno)); - + } if (seconds < t.rlim_cur) { t.rlim_cur = seconds; - if (setrlimit(RLIMIT_CPU, &t) != 0) + if (setrlimit(RLIMIT_CPU, &t) != 0) { fatal("setrlimit failed: %s", strerror(errno)); + } } } @@ -338,13 +344,15 @@ limit_virtual_memory(const unsigned long bytes) { struct rlimit t; - if (getrlimit(RLIMIT_AS, &t) != 0) + if (getrlimit(RLIMIT_AS, &t) != 0) { fatal("getrlimit failed: %s", strerror(errno)); + } if (bytes < t.rlim_cur) { t.rlim_cur = bytes; - if (setrlimit(RLIMIT_AS, &t) != 0) + if (setrlimit(RLIMIT_AS, &t) != 0) { fatal("setrlimit failed: %s", strerror(errno)); + } } } @@ -366,9 +374,10 @@ } try { - if (output_file_name) + if (output_file_name) { output() << "TIMEOUT" << std::endl; + } } catch (...) { } @@ -387,8 +396,9 @@ const int c = getopt(argc, argv, OPTION_LETTERS); #endif - if (c == EOF) + if (c == EOF) { break; + } char* endptr; long l; @@ -398,7 +408,7 @@ case '?': case 'h': - fprintf(stdout, usage_string, argv[0]); + usage(argv[0]); exit(0); break; @@ -406,10 +416,12 @@ case 'C': l = strtol(optarg, &endptr, 10); - if (*endptr || l < 0) + if (*endptr || l < 0) { fatal("a non-negative integer must follow `-C'"); - else + } + else { max_seconds_of_cpu_time = static_cast(l); + } break; #endif // defined(PPL_LCDD_SUPPORTS_LIMIT_ON_CPU_TIME) @@ -418,12 +430,15 @@ { const unsigned long MEGA = 1024U*1024U; l = strtol(optarg, &endptr, 10); - if (*endptr || l < 0) + if (*endptr || l < 0) { fatal("a non-negative integer must follow `-R'"); - else if (static_cast(l) > ULONG_MAX/MEGA) + } + else if (static_cast(l) > ULONG_MAX/MEGA) { max_bytes_of_virtual_memory = ULONG_MAX; - else + } + else { max_bytes_of_virtual_memory = static_cast(l)*MEGA; + } } break; @@ -457,22 +472,25 @@ } } - if (argc - optind > 1) + if (argc - optind > 1) { // We have multiple input files. fatal("at most one input file is accepted"); - + } // We have one input files. - if (optind < argc) + if (optind < argc) { input_file_name = argv[optind]; - else + } + else { // If no input files have been specified: we will read from standard input. assert(input_file_name == 0); + } } void maybe_start_clock() { - if (print_timings) + if (print_timings) { start_clock(); + } } void @@ -492,12 +510,14 @@ typedef std::vector::size_type size_type; const size_type n = source.size(); denominator = 1; - for (size_type i = 0; i < n; ++i) + for (size_type i = 0; i < n; ++i) { mpz_lcm(denominator.get_mpz_t(), denominator.get_mpz_t(), source[i].get_den().get_mpz_t()); - for (size_type i = 0; i < n; ++i) + } + for (size_type i = 0; i < n; ++i) { dest[i] = denominator*source[i]; + } } template @@ -522,8 +542,9 @@ } catch (...) { } - if (!succeeded) + if (!succeeded) { fatal("cannot write to output file `%s'", output_file_name); + } } #if defined (USE_POLKA) @@ -553,18 +574,22 @@ switch (number_type) { case INTEGER: { - for (unsigned i = 0; i < num_coefficients; ++i) - if (!guarded_read(in, coefficients[i])) + for (unsigned i = 0; i < num_coefficients; ++i) { + if (!guarded_read(in, coefficients[i])) { error("missing or invalid integer coefficient"); + } + } denominator = 1; break; } case RATIONAL: { std::vector rational_coefficients(num_coefficients); - for (unsigned i = 0; i < num_coefficients; ++i) - if (!guarded_read(in, rational_coefficients[i])) + for (unsigned i = 0; i < num_coefficients; ++i) { + if (!guarded_read(in, rational_coefficients[i])) { error("missing or invalid rational coefficient"); + } + } normalize(rational_coefficients, coefficients, denominator); break; } @@ -573,8 +598,9 @@ std::vector rational_coefficients(num_coefficients); for (unsigned i = 0; i < num_coefficients; ++i) { double d; - if (!guarded_read(in, d)) + if (!guarded_read(in, d)) { error("missing or invalid real coefficient"); + } rational_coefficients[i] = mpq_class(d); } normalize(rational_coefficients, coefficients, denominator); @@ -589,12 +615,14 @@ const char* what) { assert(dest.empty()); unsigned num_elements; - if (!guarded_read(in, num_elements)) + if (!guarded_read(in, num_elements)) { error("missing or invalid number of set elements in `%s'", what); + } while (num_elements--) { unsigned i; - if (!guarded_read(in, i)) + if (!guarded_read(in, i)) { error("missing or invalid set element in `%s'", what); + } dest.insert(i); } } @@ -609,28 +637,33 @@ std::string s; std::set linearity; while (true) { - if (!guarded_read(in, s)) + if (!guarded_read(in, s)) { error("premature end of file while seeking for `begin'"); - - if (s == "V-representation") + } + if (s == "V-representation") { rep = V; - else if (s == "H-representation") + } + else if (s == "H-representation") { rep = H; + } else if (s == "linearity" || s == "equality" || s == "partial_enum") { read_indexes_set(in, linearity, "linearity"); if (verbose) { std::cerr << "Linearity: "; for (std::set::const_iterator j = linearity.begin(), - linearity_end = linearity.end(); j != linearity_end; ++j) + linearity_end = linearity.end(); j != linearity_end; ++j) { std::cerr << *j << " "; + } std::cerr << std::endl; } } - else if (s == "begin") + else if (s == "begin") { break; - else + } + else { // A comment: skip to end of line. in.ignore(std::numeric_limits::max(), '\n'); + } } // Tools such as `lrs' produce "*****" instead of the number of @@ -638,39 +671,49 @@ // of rows ourselves. bool has_num_rows = false; unsigned num_rows; - if (!guarded_read(in, s)) + if (!guarded_read(in, s)) { error("missing number of rows"); + } if (s != "*****") { std::istringstream iss(s); - if (!guarded_read(iss, num_rows)) + if (!guarded_read(iss, num_rows)) { error("illegal number of rows `%s' (\"*****\" would be accepted)", s.c_str()); + } has_num_rows = true; } unsigned num_columns; - if (!guarded_read(in, num_columns)) + if (!guarded_read(in, num_columns)) { error("illegal or missing number of columns"); + } const unsigned space_dim = num_columns - 1; - if (!guarded_read(in, s)) + if (!guarded_read(in, s)) { error("missing number type"); + } Number_Type number_type = INTEGER; - if (s == "integer") + if (s == "integer") { number_type = INTEGER; - else if (s == "rational") + } + else if (s == "rational") { number_type = RATIONAL; - else if (s == "real") + } + else if (s == "real") { number_type = REAL; - else + } + else { error("illegal number type `%s'", s.c_str()); + } if (verbose) { std::cerr << "Problem dimension: "; - if (has_num_rows) + if (has_num_rows) { std::cerr << num_rows; - else + } + else { std::cerr << '?'; + } std::cerr << " x " << num_columns << "; number type: " << s << std::endl; @@ -708,33 +751,40 @@ int vertex_marker; if (!has_num_rows) { // Must be prepared to read an "end" here. - if (!guarded_read(in, s)) + if (!guarded_read(in, s)) { error("missing vertex marker"); - if (s == "end") + } + if (s == "end") { break; + } std::istringstream iss(s); if (!guarded_read(iss, vertex_marker) - || vertex_marker < 0 || vertex_marker > 1) + || vertex_marker < 0 || vertex_marker > 1) { error("illegal vertex marker `%s'", s.c_str()); + } } else if (!guarded_read(in, vertex_marker) - || vertex_marker < 0 || vertex_marker > 1) + || vertex_marker < 0 || vertex_marker > 1) { error("illegal or missing vertex marker"); + } read_coefficients(in, number_type, coefficients, denominator); #if defined(USE_PPL) // PPL variables have indices 0, 1, ..., space_dim-1. PPL::Linear_Expression e; - for (unsigned j = space_dim; j-- > 0; ) + for (unsigned j = space_dim; j-- > 0; ) { e += coefficients[j] * PPL::Variable(j); + } #elif defined(USE_POLKA) // NewPolka variables have indices 2, 3, ..., space_dim+1. - for (unsigned j = space_dim; j-- > 0; ) + for (unsigned j = space_dim; j-- > 0; ) { pkint_set(mat->p[row][j+2], coefficients[j].get_mpz_t()); + } #elif defined(USE_POLYLIB) // PolyLib variables have indices 1, 2, ..., space_dim. - for (unsigned j = space_dim; j-- > 0; ) + for (unsigned j = space_dim; j-- > 0; ) { value_assign(mat->p[row][j+1], coefficients[j].get_mpz_t()); + } #endif if (vertex_marker == 1) { assert(linearity.find(row+1) == linearity_end); @@ -792,25 +842,27 @@ // Add the origin as a point. pkint_set_si(mat->p[num_rows][0], 1); pkint_set_si(mat->p[num_rows][1], 1); - for (unsigned j = space_dim; j-- > 0; ) + for (unsigned j = space_dim; j-- > 0; ) { pkint_set_si(mat->p[num_rows][j+2], 0); + } ++num_rows; #elif defined(USE_POLYLIB) // Add the origin as a point. value_set_si(mat->p[num_rows][0], 1); value_set_si(mat->p[num_rows][space_dim+1], 1); - for (unsigned j = space_dim; j-- > 0; ) + for (unsigned j = space_dim; j-- > 0; ) { value_set_si(mat->p[num_rows][j+1], 0); + } ++num_rows; #endif } if (verbose) { - if (!has_num_rows) + if (!has_num_rows) { std::cerr << "Problem dimension: " << row << " x " << num_columns << "; number type: " << s << std::endl; - + } #if defined(USE_PPL) using namespace PPL::IO_Operators; std::cerr << "Generator system:\n" << gs << std::endl; @@ -834,33 +886,38 @@ if (!has_num_rows) { // Must be prepared to read an "end" here. std::getline(in, s); - if (!in) + if (!in) { error("premature end of file while seeking " "for coefficients or `end'"); - if (s.substr(0, 2) == "end") + } + if (s.substr(0, 2) == "end") { break; + } std::istringstream iss(s); read_coefficients(iss, number_type, coefficients, denominator); } - else + else { read_coefficients(in, number_type, coefficients, denominator); - + } #if defined(USE_PPL) // PPL variables have indices 0, 1, ..., space_dim-1. PPL::Linear_Expression e; - for (unsigned j = num_columns; j-- > 1; ) + for (unsigned j = num_columns; j-- > 1; ) { e += coefficients[j] * PPL::Variable(j-1); + } e += coefficients[0]; #elif defined(USE_POLKA) // NewPolka variables have indices 2, 3, ..., space_dim+1. - for (unsigned j = num_columns; j-- > 1; ) + for (unsigned j = num_columns; j-- > 1; ) { pkint_set(mat->p[row][j+1], coefficients[j].get_mpz_t()); + } // NewPolka stores the inhomogeneous term at index 1. pkint_set(mat->p[row][1], coefficients[0].get_mpz_t()); #elif defined(USE_POLYLIB) // PolyLib variables have indices 1, 2, ..., space_dim. - for (unsigned j = num_columns; j-- > 1; ) + for (unsigned j = num_columns; j-- > 1; ) { value_assign(mat->p[row][j], coefficients[j].get_mpz_t()); + } // PolyLib stores the inhomogeneous term at index space_dim+1. value_assign(mat->p[row][space_dim+1], coefficients[0].get_mpz_t()); #endif @@ -890,11 +947,11 @@ } if (verbose) { - if (!has_num_rows) + if (!has_num_rows) { std::cerr << "Problem dimension: " << row << " x " << num_columns << "; number type: " << s << std::endl; - + } #if defined(USE_PPL) using namespace PPL::IO_Operators; std::cerr << "Constraint system:\n" << cs << std::endl; @@ -910,11 +967,13 @@ } if (has_num_rows) { - if (!guarded_read(in, s)) + if (!guarded_read(in, s)) { error("premature end of file while seeking for `end'"); + } - if (s != "end") + if (s != "end") { error("`%s' found while seeking for `end'", s.c_str()); + } } if (rep == H) { @@ -955,8 +1014,9 @@ write_polyhedron(std::ostream& out, const POLYHEDRON_TYPE& ph, const Representation rep) { - if (rep == H) + if (rep == H) { guarded_write(out, "H-representation\n"); + } else { assert(rep == V); guarded_write(out, "V-representation\n"); @@ -970,8 +1030,9 @@ for (PPL::Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { ++num_rows; - if (i->is_equality()) + if (i->is_equality()) { linearity.insert(linearity.end(), num_rows); + } } } else { @@ -979,8 +1040,9 @@ for (PPL::Generator_System::const_iterator i = gs.begin(), gs_end = gs.end(); i != gs_end; ++i) { ++num_rows; - if (i->is_line()) + if (i->is_line()) { linearity.insert(linearity.end(), num_rows); + } } } #elif defined(USE_POLKA) @@ -990,16 +1052,18 @@ : (poly_is_empty(ph) ? 0 : poly_frames(ph)); const unsigned num_rows = (rep == V && poly_is_empty(ph)) ? 0 : mat->nbrows; for (unsigned i = 0; i < num_rows; ++i) - if (pkint_sgn(mat->p[i][0]) == 0) + if (pkint_sgn(mat->p[i][0]) == 0) { linearity.insert(linearity.end(), i+1); + } #elif defined(USE_POLYLIB) const Matrix* mat = (rep == H) ? Polyhedron2Constraints(ph) : Polyhedron2Rays(ph); const unsigned num_rows = mat->NbRows; for (unsigned i = 0; i < num_rows; ++i) - if (value_sign(mat->p[i][0]) == 0) + if (value_sign(mat->p[i][0]) == 0) { linearity.insert(linearity.end(), i+1); + } #endif if (!linearity.empty()) { @@ -1026,11 +1090,12 @@ guarded_write(out, ' '); guarded_write(out, space_dim+1); guarded_write(out, ' '); - if (rep == H) + if (rep == H) { guarded_write(out, "integer\n"); - else + } + else { guarded_write(out, "rational\n"); - + } #if defined(USE_PPL) if (rep == H) { const PPL::Constraint_System& cs = ph.constraints(); @@ -1056,10 +1121,12 @@ const PPL::Coefficient& divisor = g.divisor(); for (PPL::dimension_type j = 0; j < space_dim; ++j) { guarded_write(out, ' '); - if (g.coefficient(PPL::Variable(j)) == 0) + if (g.coefficient(PPL::Variable(j)) == 0) { guarded_write(out, '0'); + } else { - mpz_class numer, denom; + mpz_class numer; + mpz_class denom; PPL::assign_r(numer, g.coefficient(PPL::Variable(j)), PPL::ROUND_NOT_NEEDED); @@ -1103,11 +1170,13 @@ // `g' is a point. for (unsigned j = 0; j < space_dim; ++j) { guarded_write(out, ' '); - if (pkint_sgn(g[j+2]) == 0) + if (pkint_sgn(g[j+2]) == 0) { guarded_write(out, '0'); - else + } + else { guarded_write(out, mpq_class(mpz_class(g[j+2].rep), mpz_class(divisor.rep))); + } } else // `g' is a ray or a line. @@ -1142,11 +1211,13 @@ // `g' is a point. for (unsigned j = 0; j < space_dim; ++j) { guarded_write(out, ' '); - if (value_sign(g[j+1]) == 0) + if (value_sign(g[j+1]) == 0) { guarded_write(out, '0'); - else + } + else { guarded_write(out, mpq_class(mpz_class(g[j+1]), mpz_class(divisor))); + } } else // `g' is a ray or a line. @@ -1168,8 +1239,9 @@ } catch (...) { } - if (!flush_succeeded) + if (!flush_succeeded) { fatal("cannot write to output file `%s'", output_file_name); + } } } // namespace @@ -1179,14 +1251,15 @@ program_name = argv[0]; #if defined(USE_PPL) - if (strcmp(PPL_VERSION, PPL::version()) != 0) + if (strcmp(PPL_VERSION, PPL::version()) != 0) { fatal("was compiled with PPL version %s, but linked with version %s", PPL_VERSION, PPL::version()); - - if (verbose) + } + if (verbose) { std::cerr << "Parma Polyhedra Library version:\n" << PPL::version() << "\n\nParma Polyhedra Library banner:\n" << PPL::banner() << std::endl; + } #endif // Process command line options. @@ -1194,14 +1267,14 @@ #ifdef PPL_LCDD_SUPPORTS_LIMIT_ON_CPU_TIME - if (max_seconds_of_cpu_time > 0) + if (max_seconds_of_cpu_time > 0) { set_alarm_on_cpu_time(max_seconds_of_cpu_time, &timeout); - + } #endif // defined(PPL_LCDD_SUPPORTS_LIMIT_ON_CPU_TIME) - if (max_bytes_of_virtual_memory > 0) + if (max_bytes_of_virtual_memory > 0) { limit_virtual_memory(max_bytes_of_virtual_memory); - + } // Set up the input and output streams. set_input(input_file_name); set_output(output_file_name); @@ -1215,8 +1288,9 @@ // Warn for misplaced linearity commands, and ignore all what follows. std::string s; while (guarded_read(input(), s)) { - if (s == "linearity" || s == "equality" || s == "partial_enum") + if (s == "linearity" || s == "equality" || s == "partial_enum") { error("the `linearity' command must occur before `begin'"); + } input().ignore(std::numeric_limits::max(), '\n'); } @@ -1248,10 +1322,12 @@ #endif // Write the result of the conversion. - if (rep == V) + if (rep == V) { write_polyhedron(output(), ph, H); - else + } + else{ write_polyhedron(output(), ph, V); + } #if defined(USE_PPL) // Check the result, if requested to do so. @@ -1264,70 +1340,74 @@ switch (command) { case H_to_V: { - if (e_rep == H) + if (e_rep == H) { warning("checking an H-to-V conversion with an H representation"); - + } // Count the number of generators of `ph'. unsigned ph_num_generators = 0; const PPL::Generator_System& ph_gs = ph.generators(); for (PPL::Generator_System::const_iterator i = ph_gs.begin(), - ph_gs_end = ph_gs.end(); i != ph_gs_end; ++i) + ph_gs_end = ph_gs.end(); i != ph_gs_end; ++i) { ++ph_num_generators; - + } // Count the number of generators of `e_ph'. unsigned e_ph_num_generators = 0; const PPL::Generator_System& e_ph_gs = e_ph.generators(); for (PPL::Generator_System::const_iterator i = e_ph_gs.begin(), - e_ph_gs_end = e_ph_gs.end(); i != e_ph_gs_end; ++i) + e_ph_gs_end = e_ph_gs.end(); i != e_ph_gs_end; ++i) { ++e_ph_num_generators; - + } // If the polyhedra differ, that is the problem. if (ph != e_ph) { - if (verbose) + if (verbose) { std::cerr << "Check failed: polyhedra differ" << std::endl; + } return 1; } - else if (ph_num_generators != e_ph_num_generators) + else if (ph_num_generators != e_ph_num_generators) { // If we have different number of generators, we fail. std::cerr << "Check failed: different number of generators:\n" << "expected " << e_ph_num_generators << ", obtained " << ph_num_generators << std::endl; + } break; } case V_to_H: { - if (e_rep == V) + if (e_rep == V) { warning("checking an V-to-H conversion with a V representation"); - + } // Count the number of constraints of `ph'. unsigned ph_num_constraints = 0; const PPL::Constraint_System& ph_cs = ph.constraints(); for (PPL::Constraint_System::const_iterator i = ph_cs.begin(), - ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) + ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) { ++ph_num_constraints; - + } // Count the number of constraints of `e_ph'. unsigned e_ph_num_constraints = 0; const PPL::Constraint_System& e_ph_cs = e_ph.constraints(); for (PPL::Constraint_System::const_iterator i = e_ph_cs.begin(), - e_ph_cs_end = e_ph_cs.end(); i != e_ph_cs_end; ++i) + e_ph_cs_end = e_ph_cs.end(); i != e_ph_cs_end; ++i) { ++e_ph_num_constraints; - + } // If the polyhedra differ, that is the problem. if (ph != e_ph) { - if (verbose) + if (verbose) { std::cerr << "Check failed: polyhedra differ" << std::endl; + } return 1; } - else if (ph_num_constraints != e_ph_num_constraints) + else if (ph_num_constraints != e_ph_num_constraints) { // If we have different number of constraints, we fail. std::cerr << "Check failed: different number of constraints:\n" << "expected " << e_ph_num_constraints << ", obtained " << ph_num_constraints << std::endl; + } break; } case None: diff -Nru ppl-1.1/demos/ppl_lpsol/dummy.cc ppl-1.2/demos/ppl_lpsol/dummy.cc --- ppl-1.1/demos/ppl_lpsol/dummy.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_lpsol/dummy.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without @@ -10,4 +10,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -// This file intentionally contains only this comment :-) +// This file intentionally contains only the following inclusion. +#include "ppl-config.h" + diff -Nru ppl-1.1/demos/ppl_lpsol/examples/Makefile.am ppl-1.2/demos/ppl_lpsol/examples/Makefile.am --- ppl-1.1/demos/ppl_lpsol/examples/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_lpsol/examples/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/demos/ppl_lpsol/examples/Makefile.in ppl-1.2/demos/ppl_lpsol/examples/Makefile.in --- ppl-1.1/demos/ppl_lpsol/examples/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/demos/ppl_lpsol/examples/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -106,6 +106,7 @@ $(top_srcdir)/mkinstalldirs $(dist_noinst_DATA) README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -125,7 +126,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/demos/ppl_lpsol/Makefile.am ppl-1.2/demos/ppl_lpsol/Makefile.am --- ppl-1.1/demos/ppl_lpsol/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_lpsol/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/demos/ppl_lpsol/Makefile.in ppl-1.2/demos/ppl_lpsol/Makefile.in --- ppl-1.1/demos/ppl_lpsol/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/demos/ppl_lpsol/Makefile.in 2016-02-11 12:31:41.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -110,6 +110,7 @@ $(dist_man_MANS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -129,7 +130,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/demos/ppl_lpsol/ppl_lpsol.1 ppl-1.2/demos/ppl_lpsol/ppl_lpsol.1 --- ppl-1.1/demos/ppl_lpsol/ppl_lpsol.1 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_lpsol/ppl_lpsol.1 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.11. -.TH PPL_LPSOL "1" "October 2013" "ppl_lpsol 1.1" "User Commands" +.TH PPL_LPSOL "1" "February 2016" "ppl_lpsol 1.2" "User Commands" .SH NAME ppl_lpsol \- a PPL-based mixed integer programming problem solver .SH SYNOPSIS @@ -86,7 +86,7 @@ \fBppl\-config \-\-credits\fR for a list of contributors. .SH COPYRIGHT Copyright (C) 2001\-2010 Roberto Bagnara -Copyright (C) 2010\-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010\-2016 BUGSENG srl (http://bugseng.com) .br This is free software; see the file \fBCOPYING\fR in the source distribution or use the command \fBppl\-config \-\-copying\fR to diff -Nru ppl-1.1/demos/ppl_lpsol/ppl_lpsol.c ppl-1.2/demos/ppl_lpsol/ppl_lpsol.c --- ppl-1.1/demos/ppl_lpsol/ppl_lpsol.c 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_lpsol/ppl_lpsol.c 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Solve linear programming problems by either vertex/point enumeration or the primal simplex algorithm. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -22,7 +22,7 @@ For the most up-to-date information see the Parma Polyhedra Library site: http://bugseng.com/products/ppl/ . */ -#include +#include "ppl-config.h" #include "ppl_c.h" #include #include @@ -1313,12 +1313,6 @@ fatal("PPL error code %d: %s", code, description); } -#if !PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK -void -ppl_set_GMP_memory_allocation_functions(void) { -} -#endif - #if defined(NDEBUG) #if !(defined(PPL_GLPK_HAS_GLP_TERM_OUT) && defined(GLP_OFF)) diff -Nru ppl-1.1/demos/ppl_pips/examples/Makefile.am ppl-1.2/demos/ppl_pips/examples/Makefile.am --- ppl-1.1/demos/ppl_pips/examples/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_pips/examples/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/demos/ppl_pips/examples/Makefile.in ppl-1.2/demos/ppl_pips/examples/Makefile.in --- ppl-1.1/demos/ppl_pips/examples/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/demos/ppl_pips/examples/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -106,6 +106,7 @@ $(top_srcdir)/mkinstalldirs $(dist_noinst_DATA) README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -125,7 +126,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/demos/ppl_pips/Makefile.am ppl-1.2/demos/ppl_pips/Makefile.am --- ppl-1.1/demos/ppl_pips/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_pips/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/demos/ppl_pips/Makefile.in ppl-1.2/demos/ppl_pips/Makefile.in --- ppl-1.1/demos/ppl_pips/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/demos/ppl_pips/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -108,6 +108,7 @@ $(dist_man_MANS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -127,7 +128,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/demos/ppl_pips/ppl_pips.1 ppl-1.2/demos/ppl_pips/ppl_pips.1 --- ppl-1.1/demos/ppl_pips/ppl_pips.1 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_pips/ppl_pips.1 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.11. -.TH PPL_PIPS "1" "October 2013" "ppl_pips 1.1" "User Commands" +.TH PPL_PIPS "1" "February 2016" "ppl_pips 1.2" "User Commands" .SH NAME ppl_pips \- a PPL-based parametric integer programming problem solver .SH SYNOPSIS @@ -118,7 +118,7 @@ Report bugs to . .SH COPYRIGHT Copyright (C) 2001\-2010 Roberto Bagnara -Copyright (C) 2010\-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010\-2016 BUGSENG srl (http://bugseng.com) .br This is free software; see the file \fBCOPYING\fR in the source distribution or use the command \fBppl\-config \-\-copying\fR to diff -Nru ppl-1.1/demos/ppl_pips/ppl_pips.cc ppl-1.2/demos/ppl_pips/ppl_pips.cc --- ppl-1.1/demos/ppl_pips/ppl_pips.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/demos/ppl_pips/ppl_pips.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* A sort of clone of the cddlib test program `lcdd'. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -21,7 +21,9 @@ For the most up-to-date information see the Parma Polyhedra Library site: http://bugseng.com/products/ppl/ . */ -//#define USE_PIPLIB 1 +#if 0 +#define USE_PIPLIB 1 +#endif #if (!defined(USE_PPL) && !defined(USE_PIPLIB)) #define USE_PPL 1 @@ -41,12 +43,6 @@ typedef PPL::C_Polyhedron POLYHEDRON_TYPE; -#if !PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK -extern "C" void -ppl_set_GMP_memory_allocation_functions(void) { -} -#endif - #elif defined(USE_PIPLIB) #error "PipLib not supported yet" @@ -122,53 +118,55 @@ const Parma_Polyhedra_Library::Variables_Set& vars, Parma_Polyhedra_Library::dimension_type space_dimension, int indent = 0) { - using namespace std; using namespace Parma_Polyhedra_Library::IO_Operators; + if (!pip) { - out << setw(indent*2) << "" << "_|_" << endl; + out << std::setw(indent*2) << "" << "_|_" << std::endl; } else { - for (PIP_Tree_Node::Artificial_Parameter_Sequence::const_iterator + for (PPL::PIP_Tree_Node::Artificial_Parameter_Sequence::const_iterator i = pip->art_parameter_begin(), i_end = pip->art_parameter_end(); i != i_end; ++i) { - out << setw(indent*2) << "" << "Parameter " - << Linear_Expression(Variable(space_dimension++)) - << " = " << *i << endl; + out << std::setw(indent*2) << "" << "Parameter " + << PPL::Linear_Expression(PPL::Variable(space_dimension++)) + << " = " << *i << std::endl; } - const Constraint_System &constraints = pip->constraints(); + const PPL::Constraint_System& constraints = pip->constraints(); const bool constraints_empty = constraints.empty(); if (!constraints_empty) { - out << setw(indent*2) << "" << "if "; - for (Constraint_System::const_iterator + out << std::setw(indent*2) << "" << "if "; + for (PPL::Constraint_System::const_iterator cs_begin = constraints.begin(), cs_end = constraints.end(), - i = cs_begin; i != cs_end; ++i) + i = cs_begin; i != cs_end; ++i) { out << ((i == cs_begin) ? "" : " and ") << *i; - out << " then" << endl; + } + out << " then" << std::endl; } - const PIP_Decision_Node* const decision_node_p = pip->as_decision(); + const PPL::PIP_Decision_Node* const decision_node_p = pip->as_decision(); if (decision_node_p) { pip_display_sol(out, decision_node_p->child_node(true), parameters, vars, space_dimension, indent+1); - out << setw(indent*2) << "" << "else" << endl; + out << std::setw(indent*2) << "" << "else" << std::endl; pip_display_sol(out, decision_node_p->child_node(false), parameters, vars, space_dimension, indent+1); } else { - const PIP_Solution_Node* const solution_node_p = pip->as_solution(); - out << setw(indent*2 + (constraints_empty ? 0 : 2)) << "" << "{"; - for (Variables_Set::const_iterator + const PPL::PIP_Solution_Node* const solution_node_p = pip->as_solution(); + out << std::setw(indent*2 + (constraints_empty ? 0 : 2)) << "" << "{"; + for (PPL::Variables_Set::const_iterator v_begin = vars.begin(), v_end = vars.end(), - i = v_begin; i != v_end; ++i) + i = v_begin; i != v_end; ++i) { out << ((i == v_begin) ? "" : " ; ") - << solution_node_p->parametric_values(Variable(*i)); - out << "}" << endl; + << solution_node_p->parametric_values(PPL::Variable(*i)); + } + out << "}" << std::endl; if (!constraints_empty) { - out << setw(indent*2) << "" << "else" << endl; - out << setw(indent*2 + 2) << "" << "_|_" << endl; + out << std::setw(indent*2) << "" << "else" << std::endl; + out << std::setw(indent*2 + 2) << "" << "_|_" << std::endl; } } } @@ -195,8 +193,9 @@ const PPL::Variables_Set& params = pip.parameter_space_dimensions(); PPL::Variables_Set vars; for (PPL::dimension_type i = 0; i < pip.space_dimension(); ++i) { - if (params.count(i) == 0) + if (params.count(i) == 0) { vars.insert(i); + } } const PPL::PIP_Tree solution = pip.solution(); pip_display_sol(out, solution, params, vars, pip.space_dimension()); @@ -217,28 +216,35 @@ pip.add_space_dimensions_and_embed(num_vars, num_params); for (PPL::dimension_type k = 0, i = 0; i < num_constraints; ++i) { PPL::Linear_Expression expr; - for (PPL::dimension_type j = 0; j < num_vars + num_params; ++j) + for (PPL::dimension_type j = 0; j < num_vars + num_params; ++j) { add_mul_assign(expr, constraints[k++], PPL::Variable(j)); + } expr += constraints[k++]; - if (constraint_type[i]) + if (constraint_type[i]) { pip.add_constraint(PPL::Constraint(expr >= 0)); - else + } + else { pip.add_constraint(PPL::Constraint(expr == 0)); + } } if (num_params > 0) { for (PPL::dimension_type k = 0, i = 0; i < num_ctx_rows; ++i) { PPL::Linear_Expression expr; - for (PPL::dimension_type j = 0; j < num_params; ++j) + for (PPL::dimension_type j = 0; j < num_params; ++j) { add_mul_assign(expr, context[k++], PPL::Variable(num_vars+j)); + } expr += context[k++]; - if (ctx_type[i]) + if (ctx_type[i]) { pip.add_constraint(PPL::Constraint(expr >= 0)); - else + } + else { pip.add_constraint(PPL::Constraint(expr == 0)); + } } } - if (bignum_column != PPL::not_a_dimension()) + if (bignum_column != PPL::not_a_dimension()) { pip.set_big_parameter_dimension(bignum_column); + } return true; } @@ -334,12 +340,15 @@ } bool read(std::istream& in) { - if (!expect(in, '(')) + if (!expect(in, '(')) { return false; - if (!expect(in, '(')) + } + if (!expect(in, '(')) { return false; - if (!read_comment(in)) + } + if (!read_comment(in)) { return false; + } PPL::dimension_type num_vars; PPL::dimension_type num_params; @@ -364,24 +373,31 @@ return false; } - if (!expect(in, '(')) + if (!expect(in, '(')) { return false; + } const PPL::dimension_type constraint_width = num_vars+num_params+1; Coeff_Vector constraints(num_constraints * constraint_width); Int_Vector constraint_type(num_constraints); - for (PPL::dimension_type i = 0; i < num_constraints; ++i) + for (PPL::dimension_type i = 0; i < num_constraints; ++i) { constraint_type[i] = 1; - for (PPL::dimension_type i = 0; i < num_constraints; ++i) - if (!read_vector(in, i, constraint_width, num_vars, constraints)) + } + for (PPL::dimension_type i = 0; i < num_constraints; ++i) { + if (!read_vector(in, i, constraint_width, num_vars, constraints)) { return false; + } + } Coeff_Vector context(num_ctx_rows * (1+num_params)); Int_Vector ctx_type(num_ctx_rows); - for (PPL::dimension_type i = 0; i < num_ctx_rows; ++i) + for (PPL::dimension_type i = 0; i < num_ctx_rows; ++i) { ctx_type[i] = 1; - for (PPL::dimension_type i = 0; i < num_ctx_rows; ++i) - if (!read_vector(in, i, num_params+1, num_params, context)) + } + for (PPL::dimension_type i = 0; i < num_ctx_rows; ++i) { + if (!read_vector(in, i, num_params+1, num_params, context)) { return false; + } + } const bool result = update_pip(num_vars, num_params, num_constraints, num_ctx_rows, @@ -397,14 +413,18 @@ int count = 1; do { char c; - if (!in.get(c)) + if (!in.get(c)) { return false; - if (c == '(') + } + if (c == '(') { ++count; - else if (c == ')') + } + else if (c == ')') { --count; - if (count > 0) + } + if (count > 0) { comment += c; + } } while (count > 0); return true; } @@ -422,29 +442,35 @@ PPL::dimension_type row_size, PPL::dimension_type cst_col, Coeff_Vector& tab) { - if (!expect(in, '#')) + if (!expect(in, '#')) { return false; - if (!expect(in, '[')) + } + if (!expect(in, '[')) { return false; + } std::string s; getline(in, s, ']'); - if (in.fail()) + if (in.fail()) { return false; + } std::istringstream iss(s); const PPL::dimension_type start_index = row_index * row_size; PPL::dimension_type k = start_index; for (PPL::dimension_type i = 0; i < cst_col; ++i, ++k) { iss >> tab[k]; - if (iss.fail()) + if (iss.fail()) { return false; + } } iss >> tab[start_index + row_size - 1]; - if (iss.fail()) + if (iss.fail()) { return false; + } for (PPL::dimension_type i = cst_col + 1; i < row_size; ++i, ++k) { iss >> tab[k]; - if (iss.fail()) + if (iss.fail()) { return false; + } } return true; } @@ -538,13 +564,14 @@ void set_input(const char* file_name) { - if (input_stream_p && *input_stream_p != std::cin) + if (input_stream_p && (input_stream_p != &std::cin)) { delete input_stream_p; - + } if (file_name) { input_stream_p = new std::ifstream(file_name, std::ios_base::in); - if (!*input_stream_p) + if (!*input_stream_p) { fatal("cannot open input file `%s'", file_name); + } input_file_name = file_name; } else { @@ -558,15 +585,16 @@ void set_output(const char* file_name) { - if (output_stream_p && *output_stream_p != std::cout) + if (output_stream_p && (output_stream_p != &std::cout)) { delete output_stream_p; - + } if (file_name) { output_stream_p = new std::ofstream(file_name, std::ios_base::out | std::ios_base::app); - if (!*output_stream_p) + if (!*output_stream_p) { fatal("cannot open output file `%s'", file_name); + } output_file_name = file_name; } else { @@ -606,13 +634,14 @@ limit_virtual_memory(const unsigned long bytes) { struct rlimit t; - if (getrlimit(RLIMIT_AS, &t) != 0) + if (getrlimit(RLIMIT_AS, &t) != 0) { fatal("getrlimit failed: %s", strerror(errno)); - + } if (bytes < t.rlim_cur) { t.rlim_cur = bytes; - if (setrlimit(RLIMIT_AS, &t) != 0) + if (setrlimit(RLIMIT_AS, &t) != 0) { fatal("setrlimit failed: %s", strerror(errno)); + } } } @@ -635,9 +664,9 @@ const int c = getopt(argc, argv, OPTION_LETTERS); #endif - if (c == EOF) + if (c == EOF) { break; - + } char* endptr; switch (c) { case 0: @@ -653,12 +682,15 @@ { const unsigned long MEGA = 1024U*1024U; const long l = strtol(optarg, &endptr, 10); - if (*endptr || l < 0) + if (*endptr || l < 0) { fatal("a non-negative integer must follow `-R'"); - else if (static_cast(l) > ULONG_MAX/MEGA) + } + else if (static_cast(l) > ULONG_MAX/MEGA) { max_bytes_of_virtual_memory = ULONG_MAX; - else + } + else { max_bytes_of_virtual_memory = static_cast(l)*MEGA; + } } break; @@ -684,8 +716,9 @@ case 'i': loop_iterations = strtol(optarg, &endptr, 10); - if (*endptr || loop_iterations < 1) + if (*endptr || loop_iterations < 1) { fatal("a positive integer must follow `-i'"); + } break; #if defined(USE_PPL) @@ -726,22 +759,25 @@ } } - if (argc - optind > 1) + if (argc - optind > 1) { // We have multiple input files. fatal("at most one input file is accepted"); - + } // We have one input files. - if (optind < argc) + if (optind < argc) { input_file_name = argv[optind]; - else + } + else { // If no input files have been specified: we will read from standard input. assert(input_file_name == 0); + } } void maybe_start_clock() { - if (print_timings) + if (print_timings) { start_clock(); + } } void @@ -758,22 +794,23 @@ program_name = argv[0]; #if defined(USE_PPL) - if (strcmp(PPL_VERSION, PPL::version()) != 0) + if (strcmp(PPL_VERSION, PPL::version()) != 0) { fatal("was compiled with PPL version %s, but linked with version %s", PPL_VERSION, PPL::version()); - - if (verbose) + } + if (verbose) { std::cerr << "Parma Polyhedra Library version:\n" << PPL::version() << "\n\nParma Polyhedra Library banner:\n" << PPL::banner() << std::endl; + } #endif // Process command line options. process_options(argc, argv); - if (max_bytes_of_virtual_memory > 0) + if (max_bytes_of_virtual_memory > 0) { limit_virtual_memory(max_bytes_of_virtual_memory); - + } // Set up the input and output streams. set_input(input_file_name); set_output(output_file_name); @@ -781,13 +818,15 @@ // POLYHEDRON_TYPE ph; // Representation rep = read_polyhedron(input(), ph); std::auto_ptr parser; - if (piplib_format) + if (piplib_format) { parser.reset(new PIP_PipLib_Parser); - else + } + else{ parser.reset(new PIP_PolyLib_Parser); - if (!parser->read(*input_stream_p)) + } + if (!parser->read(*input_stream_p)) { return 1; - + } maybe_start_clock(); const PPL::PIP_Problem& pip = parser->problem(); diff -Nru ppl-1.1/doc/definitions.dox ppl-1.2/doc/definitions.dox --- ppl-1.1/doc/definitions.dox 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/definitions.dox 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ // Copyright (C) 2001-2010 Roberto Bagnara -// Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +// Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) // // This document describes the Parma Polyhedra Library (PPL). // diff -Nru ppl-1.1/doc/devref.doxyconf-html.in ppl-1.2/doc/devref.doxyconf-html.in --- ppl-1.1/doc/devref.doxyconf-html.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/devref.doxyconf-html.in 2016-02-11 12:31:26.000000000 +0000 @@ -1,4 +1,4 @@ -# Doxyfile 1.8.4 +# Doxyfile 1.8.9.1 #--------------------------------------------------------------------------- # Project related configuration options @@ -10,6 +10,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES @@ -62,7 +63,9 @@ INTERNAL_DOCS = YES CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = YES @@ -84,7 +87,7 @@ LAYOUT_FILE = CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = YES WARNINGS = YES @@ -94,7 +97,7 @@ WARN_FORMAT = "$file:$line: $text " WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = @srcdir@/definitions.dox \ ../src/version.hh \ @@ -142,7 +145,7 @@ FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = YES @@ -150,16 +153,17 @@ REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = ppl-devref-@VERSION@-html @@ -217,7 +221,7 @@ EXTERNAL_SEARCH_ID = EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- -# configuration options related to the LaTeX output +# Configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = devref.latex-dir @@ -228,6 +232,7 @@ EXTRA_PACKAGES = ppl LATEX_HEADER = @srcdir@/devref.tex LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES USE_PDFLATEX = YES @@ -236,7 +241,7 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- -# configuration options related to the RTF output +# Configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf @@ -244,32 +249,33 @@ RTF_HYPERLINKS = YES RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +RTF_SOURCE_CODE = NO #--------------------------------------------------------------------------- -# configuration options related to the man page output +# Configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 +MAN_SUBDIR = MAN_LINKS = NO #--------------------------------------------------------------------------- -# configuration options related to the XML output +# Configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- -# configuration options related to the DOCBOOK output +# Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook +DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output +# Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- -# configuration options related to the Perl module output +# Configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO @@ -289,7 +295,7 @@ PPL_USE_SPARSE_MATRIX SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration options related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ppl-devref-@VERSION@-html.tag @@ -302,6 +308,7 @@ #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES MSCGEN_PATH = +DIA_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES DOT_NUM_THREADS = 0 @@ -325,6 +332,9 @@ DOT_PATH = DOTFILE_DIRS = MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_INCLUDE_PATH = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO diff -Nru ppl-1.1/doc/devref.doxyconf-latex.in ppl-1.2/doc/devref.doxyconf-latex.in --- ppl-1.1/doc/devref.doxyconf-latex.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/devref.doxyconf-latex.in 2016-02-11 12:31:26.000000000 +0000 @@ -1,4 +1,4 @@ -# Doxyfile 1.8.4 +# Doxyfile 1.8.9.1 #--------------------------------------------------------------------------- # Project related configuration options @@ -10,6 +10,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES @@ -62,7 +63,9 @@ INTERNAL_DOCS = YES CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = YES @@ -84,7 +87,7 @@ LAYOUT_FILE = CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = YES WARNINGS = YES @@ -94,7 +97,7 @@ WARN_FORMAT = "$file:$line: $text " WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = @srcdir@/definitions.dox \ ../src/version.hh \ @@ -141,7 +144,7 @@ FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO @@ -149,16 +152,17 @@ REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = NO HTML_OUTPUT = ppl-devref-@VERSION@-html @@ -216,7 +220,7 @@ EXTERNAL_SEARCH_ID = EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- -# configuration options related to the LaTeX output +# Configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = YES LATEX_OUTPUT = devref.latex-dir @@ -227,6 +231,7 @@ EXTRA_PACKAGES = ppl LATEX_HEADER = @srcdir@/devref.tex LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES USE_PDFLATEX = YES @@ -235,7 +240,7 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- -# configuration options related to the RTF output +# Configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf @@ -243,32 +248,33 @@ RTF_HYPERLINKS = YES RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +RTF_SOURCE_CODE = NO #--------------------------------------------------------------------------- -# configuration options related to the man page output +# Configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 +MAN_SUBDIR = MAN_LINKS = NO #--------------------------------------------------------------------------- -# configuration options related to the XML output +# Configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- -# configuration options related to the DOCBOOK output +# Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook +DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output +# Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- -# configuration options related to the Perl module output +# Configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO @@ -288,7 +294,7 @@ PPL_USE_SPARSE_MATRIX SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration options related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = @@ -301,6 +307,7 @@ #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES MSCGEN_PATH = +DIA_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES DOT_NUM_THREADS = 0 @@ -324,6 +331,9 @@ DOT_PATH = DOTFILE_DIRS = MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_INCLUDE_PATH = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO diff -Nru ppl-1.1/doc/devref-language-interface.doxyconf.in ppl-1.2/doc/devref-language-interface.doxyconf.in --- ppl-1.1/doc/devref-language-interface.doxyconf.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/devref-language-interface.doxyconf.in 2016-02-11 12:31:26.000000000 +0000 @@ -1,4 +1,4 @@ -# Doxyfile 1.8.4 +# Doxyfile 1.8.9.1 #--------------------------------------------------------------------------- # Project related configuration options @@ -10,6 +10,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES @@ -62,7 +63,9 @@ INTERNAL_DOCS = YES CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = YES @@ -84,7 +87,7 @@ LAYOUT_FILE = CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = YES WARNINGS = YES @@ -94,7 +97,7 @@ WARN_FORMAT = "$file:$line: $text " WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = INPUT_ENCODING = UTF-8 @@ -114,7 +117,7 @@ FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO @@ -122,16 +125,17 @@ REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = HTML_OUTPUT = ppl-devref--@VERSION@-html @@ -189,7 +193,7 @@ EXTERNAL_SEARCH_ID = EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- -# configuration options related to the LaTeX output +# Configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = LATEX_OUTPUT = devref-.latex-dir @@ -200,6 +204,7 @@ EXTRA_PACKAGES = ppl LATEX_HEADER = devref-.tex LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES USE_PDFLATEX = YES @@ -208,7 +213,7 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- -# configuration options related to the RTF output +# Configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf @@ -216,32 +221,33 @@ RTF_HYPERLINKS = YES RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +RTF_SOURCE_CODE = NO #--------------------------------------------------------------------------- -# configuration options related to the man page output +# Configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 +MAN_SUBDIR = MAN_LINKS = NO #--------------------------------------------------------------------------- -# configuration options related to the XML output +# Configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- -# configuration options related to the DOCBOOK output +# Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook +DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output +# Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- -# configuration options related to the Perl module output +# Configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO @@ -264,7 +270,7 @@ PPL_USE_SPARSE_MATRIX SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration options related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = @@ -277,6 +283,7 @@ #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES MSCGEN_PATH = +DIA_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES DOT_NUM_THREADS = 0 @@ -300,6 +307,9 @@ DOT_PATH = DOTFILE_DIRS = MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_INCLUDE_PATH = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO diff -Nru ppl-1.1/doc/devref-language-interface.tex ppl-1.2/doc/devref-language-interface.tex --- ppl-1.1/doc/devref-language-interface.tex 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/devref-language-interface.tex 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ % Copyright (C) 2001-2010 Roberto Bagnara -% Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +% Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) % % This document describes the Parma Polyhedra Library (PPL). % @@ -60,6 +60,7 @@ \fi \usepackage[utf8]{inputenc} \usepackage{doxygen} +\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} \usepackage{ppl} \makeindex @@ -72,6 +73,11 @@ \setlength{\headheight}{24pt} +% Custom commands +\newcommand{\clearemptydoublepage}{% + \newpage{\pagestyle{empty}\cleardoublepage}% +} + \begin{document} \title{ \includegraphics[height=9cm]{ppl_logo.pdf} \\ @@ -120,7 +126,7 @@ \newpage Copyright \copyright\ 2001--2010 Roberto Bagnara (bagnara@cs.unipr.it) \\ -Copyright \copyright\ 2010--2013 BUGSENG srl (http://bugseng.com) +Copyright \copyright\ 2010--2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/doc/devref.tex ppl-1.2/doc/devref.tex --- ppl-1.1/doc/devref.tex 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/devref.tex 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ % Copyright (C) 2001-2010 Roberto Bagnara -% Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +% Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) % % This document describes the Parma Polyhedra Library (PPL). % @@ -60,6 +60,7 @@ \fi \usepackage[utf8]{inputenc} \usepackage{doxygen} +\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} \usepackage{ppl} \makeindex \setcounter{tocdepth}{2} @@ -71,6 +72,11 @@ \setlength{\headheight}{24pt} +% Custom commands +\newcommand{\clearemptydoublepage}{% + \newpage{\pagestyle{empty}\cleardoublepage}% +} + \begin{document} \title{ \includegraphics[height=9cm]{ppl_logo.pdf} \\ @@ -118,7 +124,7 @@ \newpage Copyright \copyright\ 2001--2010 Roberto Bagnara (bagnara@cs.unipr.it) \\ -Copyright \copyright\ 2010--2013 BUGSENG srl (http://bugseng.com) +Copyright \copyright\ 2010--2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/fdl.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/fdl.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/fdl.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/fdl.ps.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/gpl.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/gpl.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/gpl.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/gpl.ps.gz differ diff -Nru ppl-1.1/doc/libppl.3 ppl-1.2/doc/libppl.3 --- ppl-1.1/doc/libppl.3 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/libppl.3 2016-02-11 12:31:26.000000000 +0000 @@ -1,4 +1,4 @@ -.TH libppl "3" "June 2012" "PPL 1.0" "libppl overview" +.TH libppl "3" "February 2016" "PPL 1.2" "libppl overview" .SH NAME libppl \- the C++ interface of the Parma Polyhedra Library @@ -15,7 +15,7 @@ of Prolog systems: look elsewhere for documentation on those. Note also that the present document does not describe the library functionality, its classes or its methods and functions: see -.IR "The Parma Polyhedra Library User's Manual (version 1.0)" +.IR "The Parma Polyhedra Library User's Manual (version 1.2)" for this kind of information. .SH "INCLUDING THE HEADER FILE" @@ -61,7 +61,7 @@ .SH "USING THE LIBRARY" Keeping in mind that there is no substitute for a careful reading of -.IR "The Parma Polyhedra Library User's Manual (version 1.0)", +.IR "The Parma Polyhedra Library User's Manual (version 1.2)", you can find many examples of use in the directories .B tests (see the @@ -196,7 +196,7 @@ .BR ppl-config(1) .sp Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. -.IR "The Parma Polyhedra Library User's Manual (version 1.0)", +.IR "The Parma Polyhedra Library User's Manual (version 1.2)", available (in several formats) at \fBhttp://bugseng.com/products/ppl/\fR . .sp @@ -218,7 +218,7 @@ .SH "COPYRIGHT AND NO WARRANTY" Copyright (C) 2001\-2010 Roberto Bagnara -Copyright (C) 2010\-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010\-2016 BUGSENG srl (http://bugseng.com) .br This is free software; see the file \fBCOPYING\fR in the source distribution or use the command \fBppl\-config \-\-copying\fR to diff -Nru ppl-1.1/doc/libppl_c.3 ppl-1.2/doc/libppl_c.3 --- ppl-1.1/doc/libppl_c.3 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/libppl_c.3 2016-02-11 12:31:26.000000000 +0000 @@ -1,4 +1,4 @@ -.TH libppl_c "3" "June 2012" "PPL 1.0" "libppl_c overview" +.TH libppl_c "3" "February 2016" "PPL 1.2" "libppl_c overview" .SH NAME libppl_c \- the C interface of the Parma Polyhedra Library @@ -15,9 +15,9 @@ of Prolog systems: look elsewhere for documentation on those. Note also that the present document does not describe the library functionality, its classes or its methods and functions: see -.IR "The Parma Polyhedra Library User's Manual (version 1.0)" +.IR "The Parma Polyhedra Library User's Manual (version 1.2)" and -.IR "The Parma Polyhedra Library C Language Interface User's Manual (version 1.0)" +.IR "The Parma Polyhedra Library C Language Interface User's Manual (version 1.2)" for this kind of information. .SH "INCLUDING THE HEADER FILE" @@ -48,9 +48,9 @@ .SH "USING THE LIBRARY" Keeping in mind that there is no substitute for a careful reading of -.IR "The Parma Polyhedra Library User's Manual (version 1.0)" +.IR "The Parma Polyhedra Library User's Manual (version 1.2)" and -.IR "The Parma Polyhedra Library C Language Interface User's Manual (version 1.0)" +.IR "The Parma Polyhedra Library C Language Interface User's Manual (version 1.2)" you can find examples of use in the directories .B interfaces/C/tests and @@ -81,7 +81,7 @@ .SH "RETURN VALUES" All the PPL C interface functions return an int: a negative value means that an error occurred. See -.IR "The Parma Polyhedra Library C Language Interface User's Manual (version 1.0)" +.IR "The Parma Polyhedra Library C Language Interface User's Manual (version 1.2)" for the error codes. .SH "IMPLEMENTING MEMORY-GUARDED COMPUTATIONS" @@ -127,12 +127,12 @@ .BR libppl(3) .sp Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. -.IR "The Parma Polyhedra Library User's Manual (version 1.0)", +.IR "The Parma Polyhedra Library User's Manual (version 1.2)", available (in several formats) at \fBhttp://bugseng.com/products/ppl/\fR . .sp Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. -.IR "The Parma Polyhedra Library C Language Interface User's Manual (version 1.0)", +.IR "The Parma Polyhedra Library C Language Interface User's Manual (version 1.2)", available (in several formats) at \fBhttp://bugseng.com/products/ppl/\fR . .sp @@ -154,7 +154,7 @@ .SH "COPYRIGHT AND NO WARRANTY" Copyright (C) 2001\-2010 Roberto Bagnara -Copyright (C) 2010\-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010\-2016 BUGSENG srl (http://bugseng.com) .br This is free software; see the file \fBCOPYING\fR in the source distribution or use the command \fBppl\-config \-\-copying\fR to diff -Nru ppl-1.1/doc/Makefile.am ppl-1.2/doc/Makefile.am --- ppl-1.1/doc/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -747,7 +747,7 @@ if BUILD_DOCUMENTATION -CONTINUE_IF_NO_DOC = true +CONTINUE_IF_NO_DOC = false else !BUILD_DOCUMENTATION diff -Nru ppl-1.1/doc/Makefile.in ppl-1.2/doc/Makefile.in --- ppl-1.1/doc/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/doc/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -111,6 +111,7 @@ $(dist_man_MANS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -130,7 +131,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ @@ -971,7 +973,7 @@ $(INSTALL_PROLOG_INTERFACE_PS_DOCS) @BUILD_DOCUMENTATION_FALSE@CONTINUE_IF_NO_DOC = continue -@BUILD_DOCUMENTATION_TRUE@CONTINUE_IF_NO_DOC = true +@BUILD_DOCUMENTATION_TRUE@CONTINUE_IF_NO_DOC = false PPL_SOURCE_FILES = $(wildcard $(srcdir)/../src/*.hh $(srcdir)/../src/*.cc) LATEX_DIRS = \ user.latex-dir \ diff -Nru ppl-1.1/doc/ppl.bib ppl-1.2/doc/ppl.bib --- ppl-1.1/doc/ppl.bib 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/ppl.bib 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ A bibliography of papers that were consulted and/or written for the design and implementation of the Parma Polyhedra Library. Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This BibTeX database is made available under the Open Data Commons Attribution License (ODC-By) v1.0, which is reproduced below for your @@ -744,8 +744,8 @@ and the Double Description Method", Journal = "Formal Aspects of Computing", Publisher = "Springer-Verlag, London", - Volume = "17", - Number = "2", + Volume = 17, + Number = 2, Pages = "222--257", Year = 2005, ISSN = "0934-5043", @@ -1670,8 +1670,9 @@ @InProceedings{GopanDMDRS04, Author = "D. Gopan and F. DiMaio and N. Dor and T. W. Reps and M. Sagiv", Title = "Numeric Domains with Summarized Dimensions", - Booktitle = "Tools and Algorithms for the Construction and Analysis - of Systems, 10th International Conference, TACAS 2004", + Booktitle = "Proceedings of the 10th International Conference + Tools and Algorithms for the Construction and Analysis + of Systems (TACAS 2004)", Address = "Barcelona, Spain", Editor = "K. Jensen and A. Podelski", Publisher = "Springer-Verlag, Berlin", diff -Nru ppl-1.1/doc/ppl_citations.bib ppl-1.2/doc/ppl_citations.bib --- ppl-1.1/doc/ppl_citations.bib 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/ppl_citations.bib 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ A bibliography of papers that cite the Parma Polyhedra Library and/or the works that defined the theory upon which it is based. Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This BibTeX database is made available under the Open Data Commons Attribution License (ODC-By) v1.0, which is reproduced below for your @@ -18,6 +18,49 @@ intact any notices on the original database. +@Inproceedings{AlbarghouthiG12, + Author = "A. Albarghouthi and A. Gurfinkel and M. Chechik", + Title = "Craig Interpretation", + Booktitle = "Static Analysis: + Proceedings of the 19th International Symposium (SAS 2012)", + Address = "Deauville, France", + Editor = "A. Min{\'e} and D. Schmidt", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7460, + Year = 2012, + ISBN = "978-3-642-33124-4 (Print) 978-3-642-33125-1 (Online)", + Pages = "300--316", + Abstract = "Abstract interpretation (AI) is one of the most scalable + automated approaches to program verification available + today. To achieve efficiency, many steps of the + analysis, e.g., joins and widening, lose precision. As a + result, AI often produces false alarms, coming from the + inability to find a safe inductive invariant even when + it exists in a chosen abstract domain. + + To tackle this problem, we present Vinta, an iterative + algorithm that uses Craig interpolants to refine and + guide AI away from false alarms. Vinta is based on a + novel refinement strategy that capitalizes on recent + advances in SMT and interpolation-based verification to + (a) find counterexamples to justify alarms produced by + AI, and (b) to strengthen an invariant to exclude alarms + that cannot be justified. The refinement process + continues until either a safe inductive invariant is + computed, a counterexample is found, or resources are + exhausted. This strategy allows Vinta to recover + precision lost in many AI steps, and even to compute + inductive invariants that are inexpressible in the + chosen abstract domain (e.g., by adding disjunctions and + new terms). + + We have implemented Vinta and compared it against top + verification tools from the recent software verification + competition. Our results show that Vinta outperforms + state-of-the-art verification tools." +} + @Inproceedings{AlbertACGPZ08, Author = "E. Albert and P. Arenas and M. Codish and S. Genaim and G. Puebla and D. Zanardini", @@ -166,6 +209,62 @@ object-oriented, bytecode programming language." } +@Inproceedings{AlbertAPCFGGMPRRZ13, + Author = "E. Albert and D. E. Alonso-Blas and A. Puri + and J. Correas and A. Flores-Montoya and S. Genaim + and M. G{\'o}mez-Zamalloa and A. N. Masud and G. Puebla + and J. M. Rojas and G. Rom{\'a}n-D{\'i}ez and D. Zanardini", + Title = "Automatic Inference of Bounds on Resource Consumption", + Booktitle = "Formal Methods for Components and Objects: + Proceedings of the 11th International Symposium (FMCO 2012)", + Address = "Bertinoro, Italy", + Editor = "E. Giachino and R. H{\"a}hnle and F. S. de Boer and M. M. Bonsangue", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7866, + Year = 2013, + Pages = "119--144", + ISBN = "978-3-642-40614-0 (Print) 978-3-642-40615-7 (Online)", + Abstract = "In this tutorial paper, we overview the techniques that + underlie the automatic inference of resource consumption + bounds. We first explain the basic techniques on a + Java-like sequential language. Then, we describe the + extensions that are required to apply our method on + concurrent ABS programs. Finally, we discuss some + advanced issues in resource analysis, including the + inference of non-cumulative resources and the treatment + of shared mutable data." +} + +@Article{AlbertGM13, + Author = "E. Albert and S. Genaim and A. N. Masud", + Title = "On the Inference of Resource Usage Upper and Lower Bounds", + Journal = "ACM Transactions on Computational Logic", + Volume = 14, + Number = 3, + Year = 2013, + Abstract = "Cost analysis aims at determining the amount of + resources required to run a program in terms of its + input data sizes. The most challenging step is to infer + the cost of executing the loops in the program. This + requires bounding the number of iterations of each loop + and findig tight bounds for the cost of each of its + iterations. This article presents a novel approach to + infer upper and lower bounds from cost relations. These + relations are an extended form of standard recurrence + equations that can be nondeterministic, contain inexact + size constraints and have multiple arguments that + increase and/or decrease. We propose novel techniques to + automatically transform cost relations into worst-case + and best-case deterministic one-argument recurrence + relations. The solution of each recursive relation + provides a precise upper-bound and lower-bound for + executing a corresponding loop in the + program. Importantly, since the approach is developed at + the level of the cost equations, our techniques are + programming language independent." +} + @Inproceedings{AlonsoAG11, Author = "D. Alonso and P. Arenas and S. Genaim", Title = "Handling Non-linear Operations in the Value Analysis of {COSTA}", @@ -204,6 +303,41 @@ before." } +@Inproceedings{AlthoffK12, + Author = "M. Althoff and B. H. Krogh", + Title = "Avoiding Geometric Intersection Operations + in Reachability Analysis of Hybrid Systems", + Booktitle = "Proceedings of the 15th ACM International Conference + on Hybrid Systems: Computation and Control (HSCC 2012)", + Year = 2012, + ISBN = "978-1-4503-1220-2", + Address = "Beijing, China", + Pages = "45--54", + Publisher = "ACM Press, New York, USA", + Abstract = "Although a growing number of dynamical systems studied + in various fields are hybrid in nature, the verification + of properties, such as stability, safety, etc., is still + a challenging problem. Reachability analysis is one of + the promising methods for hybrid system verification, + which together with all other verification techniques + faces the challenge of making the analysis scale with + respect to the number of continuous state variables. The + bottleneck of many reachability analysis techniques for + hybrid systems is the geometrically computed + intersection with guard sets. In this work, we replace + the intersection operation by a nonlinear mapping onto + the guard, which is not only numerically stable, but + also scalable, making it possible to verify systems + which were previously out of reach. The approach can be + applied to the fairly common class of hybrid systems + with piecewise continuous solutions, guard sets modeled + as halfspaces, and urgent semantics, i.e. discrete + transitions are immediately taken when enabled by guard + sets. We demonstrate the usefulness of the new approach + by a mechanical system with backlash which has 101 + continuous state variables." +} + @Inproceedings{Alur11, Author = "R. Alur", Title = "Formal Verification of Hybrid Systems", @@ -261,7 +395,7 @@ demo model from Mathworks." } -@Inproceedings {AmatoPS10, +@Inproceedings{AmatoPS10, Author = "G. Amato and M. Parton and F. Scozzari", Title = "A Tool Which Mines Partial Execution Traces to Improve Static Analysis", @@ -289,6 +423,7 @@ Author = "G. Amato and M. Parton and F. Scozzari", Title = "Discovering Invariants via Simple Component Analysis", Journal = "Journal of Symbolic Computation", + Publisher = "Elsevier Science B.V.", Volume = 47, Number = 12, Year = 2012, @@ -331,6 +466,29 @@ traces." } +@Inproceedings{AmatoS13, + Author = "G. Amato and F. Scozzari", + Title = "Localizing Widening and Narrowing", + Booktitle = "Static Analysis: + Proceedings of the 20th International Symposium (SAS 2013)", + Address = "Seattle, USA", + Series = "Lecture Notes in Computer Science", + Editor = "F. Logozzo and M. F{\"a}hndrich", + Publisher = "Springer-Verlag, Berlin", + ISBN = "978-3-642-38855-2 (Print) 978-3-642-38856-9 (Online)", + Pages = "25--42", + Volume = 7935, + Year = 2013, + Abstract = "We show two strategies which may be easily applied to + standard abstract interpretation-based static + analyzers. They consist in 1) restricting the scope of + widening, and 2) intertwining the computation of + ascending and descending chains. Using these + optimizations it is possible to improve the precision of + the analysis, without any change to the abstract + domains." +} + @Inproceedings{Andre10, Author = "{\'E}. Andr{\'e}", Title = "{IMITATOR~II}: @@ -385,12 +543,131 @@ shown by our experimental results." } +@Inproceedings{AndreFS12, + Author = "{\'E}. Andr{\'e} and L. Fribourg and R. Soulat", + Title = "Enhancing the Inverse Method with State Merging", + Booktitle = "NASA Formal Methods: + Proceedings of the 4th International Symposium (NFM 2012)", + Editor = "A. E. Goodloe and S. Person", + Address = "Norfolk, USA", + Pages = "381--396", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7226, + Year = 2012, + Abstract = "Keeping the state space small is essential when + verifying realtime systems using Timed Automata (TA). In + the model-checker Uppaal, the merging operation has been + used extensively in order to reduce the number of + states. Actually, Uppaal's merging technique applies + within the more general setting of Parametric Timed + Automata (PTA). The Inverse Method (IM) for a PTA A is a + procedure that synthesizes a zone around a given point + 0 (parameter valuation) over which A is guaranteed to + behave similarly. We show that the integration of + merging into IM leads to the synthesis of larger zones + around 0. It also often improves the performance of + IM, both in terms of computational space and time, as + shown by our experimental results." +} + + +@Inproceedings{AndreFS13, + Author = "{\'E}. Andr{\'e} and L. Fribourg and R. Soulat", + Title = "Merge and Conquer: State Merging in Parametric Timed Automata", + Booktitle = "Automated Technology for Verification and Analysis: + Proceedings of the 11th International Symposium (ATVA 2013)", + Address = "Hanoi, Vietnam", + Editor = "D. {Van Hung} and M. Ogawa", + Pages = "381--396", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 8172, + Year = 2013, + Abstract = "Parameter synthesis for real-time systems aims at + synthesizing dense sets of valuations for the timing + requirements, guaranteeing a good behavior. A popular + formalism for modeling parameterized real-time systems + is parametric timed automata (PTAs). Compacting the + state space of PTAs as much as possible is + fundamental. We present here a state merging reduction + based on convex union, that reduces the state space, but + yields an over-approximation of the executable + paths. However, we show that it preserves the sets of + reachable locations and executable actions. We also show + that our merging technique associated with the inverse + method, an algorithm for parameter synthesis, preserves + locations as well, and outputs larger sets of parameter + valuations." +} + +@Inproceedings{AndreLSDL13, + Author = "E. Andr{\'e} and Y. Liu and J. Sun and J. S. Dong and {S.-W}. Lin", + Title = "PSyHCoS: Parameter Synthesis for Hierarchical Concurrent + Real-Time Systems", + Booktitle = "Computer Aided Verification: + Proceedings of the 25th International Conference (CAV 2013)", + Year = 2013, + Pages = "984--989", + Editor = "N. Sharygina and H. Veith", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 8044, + ISBN = "978-3-642-39798-1", + Abstract = "Real-time systems are often hard to control, due to + their complicated structures, quantitative time factors + and even unknown delays. We present here PSyHCoS, a + tool for analyzing parametric real-time systems + specified using the hierarchical modeling language + PSTCSP. PSyHCoS supports several algorithms for + parameter synthesis and model checking, as well as state + space reduction techniques. Its architecture favors + reusability in terms of syntax, semantics, and + algorithms. It comes with a friendly user interface that + can be used to edit, simulate and verify PSTCSP + models. Experiments show its efficiency and + applicability." +} + +@Book{AndreS13, + Author = "{\'E}. Andr{\'e} and R. Soulat", + Title = "The Inverse + Method: Parametric Verification of Real-time Embedded Systems", + Publisher = "John Wiley and Sons.", + Series = "{FOCUS Series}", + ISBN = "9781118569405", + Year = 2013, + Abstract = "This book introduces state-of-the-art verification + techniques for real-time embedded systems, based on the + inverse method for parametric timed automata. It reviews + popular formalisms for the specification and + verification of timed concurrent systems and, in + particular, timed automata as well as several extensions + such as timed automata equipped with stopwatches, linear + hybrid automata and affine hybrid automata. The inverse + method is introduced, and its benefits for guaranteeing + robustness in real-time systems are shown. Then, it is + shown how an iteration of the inverse method can solve + the good parameters problem for parametric timed + automata by computing a behavioral cartography of the + system. Different extensions are proposed particularly + for hybrid systems and applications to scheduling + problems using timed automata with stopwatches. Various + examples, both from the literature and industry, + illustrate the techniques throughout the book. Various + parametric verifications are performed, in particular of + abstractions of a memory circuit sold by the chipset + manufacturer ST-Microelectronics, as well as of the + prospective flight control system of the next generation + of spacecraft designed by ASTRIUM Space Transportation." +} + @Inproceedings{ArmandoBM07, Author = "A. Armando and M. Benerecetti and J. Mantovani", Title = "Abstraction Refinement of Linear Programs with Arrays", - Booktitle = "Proceedings of the 13th International Conference on - Tools and Algorithms for the Construction and Analysis - of Systems (TACAS 2007)", + Booktitle = "Tools and Algorithms for the Construction and Analysis + of Systems: Proceedings of the 13th International Conference + (TACAS 2007)", Address = "Braga, Portugal", Editor = "O. Grumberg and M. Huth", Publisher = "Springer-Verlag, Berlin", @@ -452,6 +729,38 @@ analysis of systems previously beyond reach." } +@Techreport{AssarfGHJLPR14TR, + Author = "B. Assarf and E. Gawrilow and K. Herr and M. Joswig + and B. Lorenz and A. Paffenholz and T. Rehn", + Title = "{polymake} in Linear and Integer Programming", + Number = "arXiv:1408.4653 [math.CO]", + Note = "Available from \url{http://arxiv.org/}", + Year = 2014, + Month = aug, + URL = "http://arxiv.org/abs/1408.4653", + Abstract = "In integer and linear optimization the software + workhorses are solvers for linear programs as well as + generic frameworks for branch-and-bound or + branch-and-cut schemes. While today it is common to + solve linear programs with millions of rows and columns + and, moreover, mixed integer linear programs with + sometimes hundreds of thousands of rows and columns, big + challenges remain. A main purpose of this note is to + report on the state of the art of getting at the facets + of the integer hull in a brute force kind of way. And we + will do so by explaining how our software system + polymake can help. First, we explore how various convex + hull algorithms and implementations behave on various + kinds of input. Our input is chosen according to typical + scenarios which are motivated by computational tasks + arising in optimization. Second, we look into + enumerating lattice points in polytopes, which is + actually the first step for this integer hull + approach. We will sum up our experience in this area in + several ``rules of thumb'', all of which have to be taken + with a grain of salt." +} + @Inproceedings{Avery06, Author = "J. Avery", Title = "Size-Change Termination and Bound Analysis", @@ -568,6 +877,57 @@ field of using static analysis tools for verification." } +@Inproceedings{Ben-AmramG13, + Author = "A. M. Ben-Amram and S. Genaim", + Title = "On the Linear Ranking Problem for Integer Linear-Constraint Loops", + Booktitle = "Proceedings of the 40th Annual ACM SIGPLAN-SIGACT Symposium on + Principles of Programming Languages (POPL 2013)", + Year = 2013, + ISBN = "978-1-4503-1832-7", + Address = "Rome, Italy", + Pages = "51--62", + Publisher = "ACM Press", + Note = "Also published in ACM SIGPLAN Notices, POPL '13, Volume 48, Issue 1", + Abstract = "In this paper we study the complexity of the Linear + Ranking problem: given a loop, described by linear + constraints over a finite set of integer variables, is + there a linear ranking function for this loop? While + existence of such a function implies termination, this + problem is not equivalent to termination. When the + variables range over the rationals or reals, the Linear + Ranking problem is known to be PTIME decidable. However, + when they range over the integers, whether for + single-path or multipath loops, the complexity of the + Linear Ranking problem has not yet been determined. We + show that it is coNP-complete. However, we point out some + special cases of importance of PTIME complexity. We also + present complete algorithms for synthesizing linear + ranking functions, both for the general case and the + special PTIME cases." +} + +@Inproceedings{BenerecettiF13, + Author = "M. Benerecetti and M. Faella", + Title = "Tracking Differentiable Trajectories Across Polyhedra Boundaries", + Booktitle = "Proceedings of the 16th International Conference on + Hybrid Systems: Computation and Control (HSCC 2013)", + Year = 2013, + ISBN = "978-1-4503-1567-8", + Address = "Philadelphia, Pennsylvania, USA", + Pages = "193--202", + Publisher = "ACM Press", + Abstract = "We analyze the properties of differentiable trajectories + subject to a constant differential inclusion which + constrains the first derivative to belong to a given + convex polyhedron. We present the first exact algorithm + that computes the set of points from which there is a + trajectory that reaches a given polyhedron while avoiding + another (possibly non-convex) polyhedron. We discuss the + connection with (Linear) Hybrid Automata and in + particular the relationship with the classical algorithm + for reachability analysis for Linear Hybrid Automata." +} + @Inproceedings{BerendsenJV10, Author = "J. Berendsen and D. N. Jansen and F. W. Vaandrager", Title = "Fortuna: Model Checking Priced Probabilistic Timed Automata", @@ -702,15 +1062,15 @@ @Inproceedings{BozgaGI09, Author = "M. Bozga and C. G\^{\i}rlea and R. Iosif", Title = "Iterating Octagons", - Booktitle = "Proceedings of the 15th International Conference on - Tools and Algorithms for the Construction and Analysis - of Systems (TACAS 2009)", + Booktitle = "Tools and Algorithms for the Construction and Analysis + of Systems: Proceedings of the 15th International Conference + (TACAS 2009)", Address = "York, UK", Editor = "S. Kowalewski and A. Philippou", Publisher = "Springer-Verlag, Berlin", Series = "Lecture Notes in Computer Science", Volume = 5505, - Pages = "337-351", + Pages = "337--351", Year = 2009, ISBN = "978-3-642-00767-5", Abstract = "In this paper we prove that the transitive closure of a @@ -737,6 +1097,45 @@ number of test cases." } +@InProceedings{BozgaIK12, + Author = "M. Bozga and R. Iosif and F. Kone\v{c}n\'{y}", + Title = "Deciding Conditional Termination", + Booktitle = "Tools and Algorithms for the Construction and Analysis + of Systems: Proceedings of the 18th International Conference + (TACAS 2012)", + Address = "Tallinn, Estonia", + Editor = "C. Flanagan and B. K{\"o}nig", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7214, + ISBN = "978-3-642-28755-8 (Print) 978-3-642-28756-5 (Online)", + Pages = "252--266", + Year = 2012, + Abstract = "This paper addresses the problem of conditional + termination, which is that of defining the set of + initial configurations from which a given program + terminates. First we define the dual set, of initial + configurations, from which a non-terminating execution + exists, as the greatest fixpoint of the pre-image of the + transition relation. This definition enables the + representation of this set, whenever the closed form of + the relation of the loop is definable in a logic that + has quantifier elimination. This entails the + decidability of the termination problem for such + loops. Second, we present effective ways to compute the + weakest precondition for non-termination for difference + bounds and octagonal (non-deterministic) relations, by + avoiding complex quantifier eliminations. We also + investigate the existence of linear ranking functions + for such loops. Finally, we study the class of linear + affine relations and give a method of + under-approximating the termination precondition for a + non-trivial subclass of affine relations. We have + performed preliminary experiments on transition systems + modeling real-life systems, and have obtained + encouraging results." +} + @Inproceedings{BramanM08, Title = "Safety Verification of Fault Tolerant Goal-based Control Programs with Estimation Uncertainty", @@ -781,6 +1180,65 @@ hypersurfaces) are computed." } +@Article{BrauerKK13, + Author = "J. Brauer and A King. and S. Kowalewski", + Title = "Abstract Interpretation of Microcontroller Code: + Intervals Meet Congruences", + Journal = "Science of Computer Programming", + Volume = 78, + Number = 7, + Pages = "862--883", + Year = 2013, + Publisher = "Elsevier North-Holland, Inc.", + Address = "Amsterdam, The Netherlands", + ISSN = "0167-6423", + Abstract = "Bitwise instructions, loops and indirect data access + present challenges to the verification of + microcontroller programs. In particular, since registers + are often memory mapped, it is necessary to show that an + indirect store operation does not accidentally mutate a + register. To prove this and related properties, this + article advocates using the domain of bitwise linear + congruences in conjunction with intervals to derive + accurate range information. The paper argues that these + two domains complement one another when reasoning about + microcontroller code. The paper also explains how SAT + solving, which applied with dichotomic search, can be + used to recover branching conditions from binary code + which, in turn, further improves interval analysis." +} + +@Inproceedings{BrihayeDGQRW13, + Author = "T. Brihaye and L. Doyen and G. Geeraerts and J. Ouaknine + and J.-F. Raskin and J. Worrell", + Title = "Time-Bounded Reachability for Monotonic Hybrid Automata: + Complexity and Fixed Points", + Booktitle = "Automated Technology for Verification and Analysis: + Proceedings of the 11th International Symposium (ATVA 2013)", + Address = "Hanoi, Vietnam", + Editor = "D. {Van Hung} and M. Ogawa", + Year = 2013, + Pages = "55--70", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 8172, + ISBN = "978-3-319-02443-1", + Abstract = "We study the time-bounded reachability problem for + monotonic hybrid automata (MHA), i.e., rectangular + hybrid automata for which the rate of each variable is + either always non-negative or always non-positive. In + this paper, we revisit the decidability results + presented in [T.~Brihaye and L.~Doyen and G.~Geeraerts + and J.~Ouaknine. and J.-F.~Raskin and J.~Worrell: On + reachability for hybrid automata over bounded time. In: + ICALP 2011, Part II. LNCS, vol. 6756, + pp. 416-427. Springer, Heidelberg (2011)] and show that + the problem is NExpTime-complete. We also show that we + can effectively compute fixed points that characterise + the sets of states that are reachable + (resp. co-reachable) within T time units from a given + state." +} @Techreport{CacheraM-A05, Author = "D. Cachera and K. Morin-Allory", @@ -855,6 +1313,80 @@ representations." } +@Inproceedings{CarnevaliPSV13, + Author = "L. Carnevali and M. Paolieri and A. Santoni and E. Vicario", + Title = "Non-Markovian Analysis for Model Driven Engineering of Real-time Software", + Booktitle = "Proceedings of the 4th ACM/SPEC International Conference + on Performance Engineering (ICPE '13)", + Year = 2013, + ISBN = "978-1-4503-1636-1", + Address = "Prague, Czech Republic", + Pages = "113--124", + Publisher = "ACM, New York, USA", + Abstract = "Quantitative evaluation of models with stochastic timings + can decisively support schedulability analysis and + performance engineering of real-time concurrent + systems. These tasks require modeling formalisms and + solution techniques that can encompass stochastic + temporal parameters firmly constrained within a bounded + support, thus breaking the limits of Markovian + approaches. The problem is further exacerbated by the + need to represent suspension of timers, which results + from common patterns of real-time programming. This poses + relevant challenges both in the theoretical development + of non-Markovian solution techniques and in their + practical integration within a viable tailoring of + industrial processes. + + We address both issues by extending a method for + transient analysis of non-Markovian models to encompass + suspension of timers. The solution technique addresses + models that include timers with bounded and deterministic + support, which are essential to represent synchronous + task releases, timeouts, offsets, jitters, and + computations constrained by a Best Case Execution Time + (BCET) and a Worst Case Execution Time (WCET). As a + notable trait, the theory of analysis is amenable to the + integration within a Model Driven Development (MDD) + approach, providing specific evaluation capabilities in + support of performance engineering without disrupting the + flow of design and documentation of the consolidated + practice.", +} + + +@Inproceedings{ChakarovS13, + Author = "A. Chakarov and S. Sankaranarayanan", + Title = "Probabilistic Program Analysis with Martingales", + Booktitle = "Computer Aided Verification: + Proceedings of the 25th International Conference (CAV 2013)", + Year = 2013, + Pages = "511--526", + Editor = "N. Sharygina and H. Veith", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 8044, + ISBN = "978-3-642-39798-1", + Abstract = "We present techniques for the analysis of infinite state + probabilistic programs to synthesize probabilistic + invariants and prove almost-sure termination. Our + analysis is based on the notion of (super) martingales + from probability theory. First, we define the concept of + (super) martingales for loops in probabilistic + programs. Next, we present the use of concentration of + measure inequalities to bound the values of martingales + with high probability. This directly allows us to infer + probabilistic bounds on assertions involving the program + variables. Next, we present the notion of a super + martingale ranking function (SMRF) to prove almost sure + termination of probabilistic programs. Finally, we + extend constraint-based techniques to synthesize + martingales and super-martingale ranking functions for + probabilistic programs. We present some applications of + our approach to reason about invariance and termination + of small but complex probabilistic programs." +} + @Article{ChakrabortyMS06, Title = "Reasoning about Synchronization in {GALS} Systems", Author = "S. Chakraborty and J. Mekie and D. K. Sharma", @@ -916,6 +1448,36 @@ sound way." } +@Inproceedings{ChenKSW13, + Author = "T. Chen and M. Kwiatkowska and A. Simaitis and C. Wiltsche", + Title = "Synthesis for Multi-Objective Stochastic Games: + An Application to Autonomous Urban Driving", + Booktitle = "Quantitative Evaluation of Systems: + Proceedings of the 10th International Conference (QEST 2013)", + Address = "Buenos Aires, Argentina", + Editor = "K. Joshi and M. Siegle and M. Stoelinga and P. R. D'Argenio", + Year = 2013, + Pages = "322--337", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 8054, + ISBN = "978-3-642-40195-4 (Print) 978-3-642-40196-1 (Online)", + Abstract = "We study strategy synthesis for stochastic two-player + games with multiple objectives expressed as a + conjunction of LTL and expected total reward goals. For + stopping games, the strategies are constructed from the + Pareto frontiers that we compute via value + iteration. Since, in general, infinite memory is + required for deterministic winning strategies in such + games, our construction takes advantage of randomised + memory updates in order to provide compact + strategies. We implement our methods in PRISM-games, a + model checker for stochastic multi-player games, and + present a case study motivated by the DARPA Urban + Challenge, illustrating how our methods can be used to + synthesise strategies for high-level control of + autonomous vehicles." +} @Inproceedings{ColonS11, Author = "M. Col{\'o}n and S. Sankaranarayanan", @@ -962,6 +1524,45 @@ implementation over several benchmark systems." } +@Inproceedings{CostantiniFM13, + Author = "G. Costantini and P. Ferrara and G. Maggiore", + Title = "The Domain of Parametric Hypercubes + for Static Analysis of Computer Games Software", + Booktitle = "Formal Methods and Software Engineering: + Proceedings of 15th International Conference (ICFEM 2013)", + Address = "Queenstown, New Zealand", + Series = "Lecture Notes in Computer Science", + Editor = "L. Groves and J. Sun", + Publisher = "Springer-Verlag, Berlin", + ISBN = "978-3-642-41201-1 (Print) 978-3-642-41202-8 (Online)", + Pages = "447--463", + Volume = 8144, + Year = 2013, + Abstract = "Computer Games Software deeply relies on physics + simulations, which are particularly demanding to analyze + because they manipulate a large amount of interleaving + floating point variables. Therefore, this application + domain is an interesting workbench to stress the + trade-off between accuracy and efficiency of abstract + domains for static analysis. + + In this paper, we introduce Parametric Hypercubes, a + novel disjunctive non-relational abstract domain. Its + main features are: (i) it combines the low computational + cost of operations on (selected) multidimensional + intervals with the accuracy provided by lifting to a + power-set disjunctive domain, (ii) the compact + representation of its elements allows to limit the space + complexity of the analysis, and (iii) the parametric + nature of the domain provides a way to tune the + accuracy/efficiency of the analysis by just setting the + widths of the hypercubes sides. + + The first experimental results on a representative + Computer Games case study outline both the efficiency + and the precision of the proposal." +} + @Inproceedings{CovaFBV06, Author = "M. Cova and V. Felmetsger and G. Banks and G. Vigna", Title = "Static Detection of Vulnerabilities in x86 Executables", @@ -987,6 +1588,32 @@ approach is both practical and effective." } +@Article{DangT12, + Author = "T. Dang and R. Testylier", + Title = "Reachability Analysis for Polynomial Dynamical Systems Using the Bernstein Expansion", + Journal = "Reliable Computing", + Publisher = "Kluwer Academic Publishers", + Volume = 17, + Number = 2, + Year = 2012, + ISSN = "1573-1340", + Pages = "128--152", + Abstract = "This paper is concerned with the reachability + computation problem for polynomial discrete-time + dynamical systems. Such computations con- stitute a + crucial component in algorithmic verication tools for + hybrid systems and embedded software with polynomial + dynamics, which have found applications in many + engineering domains. We describe two meth- ods for + over-approximating the reachable sets of such systems; + these meth- ods are based on a combination of the + Bernstein expansion of polynomial functions and a + representation of reachable sets by template polyhedra. + Using a prototype implementation, the performance of the + methods was demonstrated on a number of examples of + control systems and biological systems." +} + @Inproceedings{DenmatGD07, Author = "T. Denmat and A. Gotlieb and M. Ducass{\'e}", Title = "An Abstract Interpretation Based Combinator for Modelling @@ -1209,6 +1836,33 @@ logic specifications." } +@Inproceedings{FangGZS12, + Author = "H. Fang and J. Guo and H. Zhu and J. Shi", + Title = "Formal Verification and Simulation: Co-verification for Subway Control Systems", + Booktitle = "Sixth International Symposium on Theoretical Aspects of Software Engineering (TASE)", + Editor = "T. Margaria and Z. Qiu and H. Yang", + Address = "Beijing", + Publisher = "IEEE Xplore Digital Library", + Pages = "145--152", + Year = 2012, + ISBN = "978-1-4673-2353-6", + Abstract = "For hybrid systems, hybrid automata based tools are + capable of verification while Matlab Simulink/Stateflow + is proficient in simulation. In this paper, a methodology + is developed in which the formal verification tool PHAVer + and simulation tool Matlab are integrated to analyze and + verify hybrid systems. For application of this + methodology, a Platform Screen Doors System (abbreviated + as PSDS), a subsystem of the subway, is modeled with + formal verification techniques based on hybrid automata + and Matlab Simulink/Stateflow charts, respectively. The + models of PSDS are simulated by Matlab and verified by + PHAVer. It is verified that the sandwich situation can be + avoided under time interval conditions. We conclude that + this integration methodology is competent in verifying + Platform Screen Doors System." +} + @Inproceedings{FenacciM11, Author = "D. Fenacci and K. MacKenzie", Title = "Static Resource Analysis for {Java} Bytecode Using Amortisation @@ -1231,6 +1885,78 @@ manipulate various heap-based data structures." } +@Inproceedings{FioravantiPPS12, + Author = "F. Fioravanti and A. Pettorossi and M. Proietti and V. Senni", + Title = "Using Real Relaxations during Program Specialization", + Booktitle = "Logic Program Synthesis and Transformation: + Proceedings of the 21st International Symposium", + Address = "Odense, Denmark", + Editor = "G. Vidal", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7225, + Pages = "106--122", + Year = 2012, + ISBN = "978-3-642-32210-5 (Print) 978-3-642-32211-2 (Online)", + Abstract = "We propose a program specialization technique for + locally stratified CLP(Z) programs, that is, logic + programs with linear constraints over the set Z of the + integer numbers. For reasons of efficiency our technique + makes use of a relaxation from integers to reals. We + reformulate the familiar unfold/fold transformation + rules for CLP programs so that: (i) the applicability + conditions of the rules are based on the satisfiability + or entailment of constraints over the set R of the real + numbers, and (ii) every application of the rules + transforms a given program into a new program with the + same perfect model constructed over Z. Then, we + introduce a strategy which applies the transformation + rules for specializing CLP(Z) programs with respect to a + given query. Finally, we show that our specialization + strategy can be applied for verifying properties of + infinite state reactive systems specified by constraints + over Z." +} + +@Article{FioravantiPPS12-FI, + Author = "F. Fioravanti and A. Pettorossi and M. Proietti and V. Senni", + Title = "Improving Reachability Analysis of Infinite State Systems by Specialization", + Journal = "Fundamenta Informaticae", + Publisher = "IOS Press", + Volume = 119, + Number = "3--4", + Pages = "281--300", + Year = 2012, + ISSN = "0169-2968 (Print) 1875-8681 (Online)", + Abstract = "We consider infinite state reactive systems specified by + using linear constraints over the integers, and we + address the problem of verifying safety properties of + these systems by applying reachability analysis + techniques. We propose a method based on program + specialization, which improves the effectiveness of the + backward and forward reachability analyses. For backward + reachability our method consists in: (i) specializing + the reactive system with respect to the initial states, + and then (ii) applying to the specialized system the + reachability analysis that works backwards from the + unsafe states. For reasons of efficiency, during + specialization we make use of a relaxation from integers + to reals. In particular, we test the satisfiability or + entailment of constraints over the real numbers, while + preserving the reachability properties of the reactive + systems when constraints are interpreted over the + integers. For forward reachability our method works as + for backward reachability, except that the role of the + initial states and the unsafe states are + interchanged. We have implemented our method using the + MAP transformation system and the ALV verification + system. Through various experiments performed on several + infinite state systems, we have shown that our + specialization-based verification technique considerably + increases the number of successful verifications without + a significant degradation of the time performance." +} + @MastersThesis{Flexeder05th, Author = "A. Flexeder", Title = "{Interprozedurale Analyse linearer Ungleichungen}", @@ -1266,6 +1992,34 @@ Prozeduraufrufen steht dabei im Vordergrund.}" } +@Inproceedings{FouiheMP13, + Author = "A. Fouilhe and D. Monniaux and M. P{\'e}rin", + Title = "Efficient Generation of Correctness Certificates + for the Abstract Domain of Polyhedra", + Booktitle = "Static Analysis: + Proceedings of the 20th International Symposium (SAS 2013)", + Address = "Seattle, USA", + Series = "Lecture Notes in Computer Science", + Editor = "F. Logozzo and M. F{\"a}hndrich", + Publisher = "Springer-Verlag, Berlin", + ISBN = "978-3-642-38855-2 (Print) 978-3-642-38856-9 (Online)", + Volume = 7935, + pages = "345--365", + Year = 2013, + Abstract = "Polyhedra form an established abstract domain for + inferring runtime properties of programs using abstract + interpretation. Computations on them need to be + certified for the whole static analysis results to be + trusted. In this work, we look at how far we can get + down the road of a posteriori verification to lower the + overhead of certification of the abstract domain of + polyhedra. We demonstrate methods for making the cost of + inclusion certificate generation negligible. From a + performance point of view, our single-representation, + constraints-based implementation compares with + state-of-the-art implementations." +} + @MastersThesis{FrankM02th, Author = "S. Frank and P. R. Mai", Title = "Strategies for Cooperating Constraint Solvers", @@ -1507,6 +2261,231 @@ system benchmark from the literature." } +@Article{FribourgK13, + Author = "L. Fribourg and U. K{\"u}hne", + Title = "Parametric Verification and Test Coverage for Hybrid Automata + Using the Inverse Method", + Journal = "International Journal of Foundations of Computer Science", + Publisher = "World Scientific publishing Co.", + Address = "Singapore", + ISSN = "0129-0541 (print) 1793-6373 (online)", + Pages = "233--249", + Volume = 24, + Number = 2, + Year = 2013, + Abstract = "Hybrid systems combine continuous and discrete + behavior. Hybrid Automata are a powerful formalism for + the modeling and verification of such systems. A common + problem in hybrid system verification is the good + parameters problem, which consists in identifying a set + of parameter valuations which guarantee a certain + behavior of a system. Recently, a method has been + presented for attacking this problem for Timed + Automata. In this paper, we show the extension of this + methodology for hybrid automata with linear and affine + dynamics. The method is demonstrated with a hybrid + system benchmark from the literature." +} + +@PhDThesis{Fu13th, + Title = "Static Analysis of Numerical Properties in the Presence of Pointers", + Author = "Z. Fu", + Type = "Th\`{e}se pour le grade de + {``Docteur de l'Universit\'e de Rennes 1''}", + School = "\'{E}cole doctorale MATISSE, Universit\'{e} de Rennes 1 + sous le sceau de l'Universit\'e Europ\'eenne de Bretagne", + Address = "Rennes, France", + Month = dec, + Year = 2013, + Abstract = "The fast and furious pace of change in computing + technology has become an article of faith for many. The + reliability of computer-based systems crucially + depends on the correctness of its computing. Can man, + who created the computer, be capable of preventing + machine-made misfortune? The theory of static analysis + strives to achieve this ambition. The analysis of + numerical properties of programs has been an essential + research topic for static analysis. These kinds of + properties are commonly modeled and handled by the + concept of numerical abstract domains. Unfortunately, + lifting these domains to heap-manipulating programs is + not obvious. On the other hand, points-to analyses have + been intensively studied to analyze pointer behaviors + and some scale to very large programs but without + inferring any numerical properties. We propose a + framework based on the theory of abstract interpretation + that is able to combine existing numerical domains and + points-to analyses in a modular way. The static + numerical analysis is prototyped using the SOOT + framework for pointer analyses and the PPL library for + numerical domains. The implementation is able to analyze + large Java program within several minutes. The second + part of this thesis consists of a theoretical study of + the combination of the points-to analysis with another + pointer analysis providing information called + must-alias. Two pointer variables must alias at some + program control point if they hold equal reference + whenever the control point is reached. We have developed + an algorithm of quadruple complexity that sharpens + points-to analysis using must-alias information. The + algorithm is proved correct following a semantics-based + formalization and the concept of bisimulation borrowed + from the game theory, model checking etc." +} + +@Inproceedings{Fu14a, + Author = "Z. Fu", + Title = "Modularly Combining Numeric Abstract Domains with Points-to Analysis, and a Scalable Static Numeric Analyzer for Java", + Booktitle = "Verification, Model Checking, and Abstract Interpretation: + Proceedings of the 15th International Conference (VMCAI 2014)", + Address = "San Diego, US", + Editor = "K. McMillan and X. Rival", + Publisher = "Springer-Verlag, Berlin", + Year = 2014, + Note = "To appear", + Abstract = "This paper contributes to a new abstract domain that + combines static numeric analysis and points-to + analysis. One particularity of this abstract domain lies + in its high degree of modularity, in the sense that the + domain is constructed by reusing its combined components + as black-boxes. This modularity dramatically eases the + proof of its soundness and renders its algorithm + intuitive. We have prototyped the abstract domain for + analyzing real-world Java programs. Our experimental + results show a tangible precision enhancement compared + to what is possible by traditional static numeric + analysis, and this at a cost that is comparable to the + cost of running the numeric and pointer analyses + separately." +} + +@Inproceedings{Fu14b, + Author = "Z. Fu", + Title = "Targeted Update -- Aggressive Memory Abstraction Beyond Common + Sense and its Application on Static Numeric Analysis", + Booktitle = "Proceedings of the 23rd European Symposium on Programming + (ESOP'14)", + Address = "Grenoble, France", + Editor = "Z. Shao", + Publisher = "Springer-Verlag, Berlin", + Year = 2014, + Note = "To appear", + Abstract = "Summarizing techniques are widely used in the reasoning + of unbounded data structures. These techniques prohibit + strong update unless certain restricted safety + conditions are satisfied. We find that by setting and + enforcing the analysis boundaries to a limited scope of + program identifiers, called targets in this paper, more + cases of strong update can be shown sound, not with + regard to the entire heap, but with regard to the + targets. We have implemented the analysis for inferring + numeric properties in Java programs. The experimental + results show a tangible precision enhancement compared + with classical approaches while preserving high + scalability." +} + +@Article{GallardoP13, + Author = "M.-d.-M. Gallardo and L. Panizo", + Title = "Extending Model Checkers for Hybrid System Verification: + The Case Study of {SPIN}", + Journal = "Software Testing, Verification and Reliability", + Publisher = "John Wiley & Sons, Ltd.", + DOI = "10.1002/stvr.1505", + ISSN ="1099-1689 (online)", + Year = 2013, + Note = "Early View (Online Version of Record published before inclusion in an issue)", + Abstract = "A hybrid system is a system that evolves following a + continuous dynamic, which may instantaneously change + when certain internal or external events occur. Because + of this combination of discrete and continuous dynamics, + the behaviour of a hybrid system is, in general, + difficult to model and analyse. Model checking + techniques have been proven to be an excellent approach + to analyse critical properties of complex systems. This + paper presents a new methodology to extend explicit + model checkers for hybrid systems analysis. The explicit + model checker is integrated, in a non-intrusive way, + with some external structures and existing abstraction + libraries, which store and manipulate the abstraction of + the continuous behaviour irrespective of the underlying + model checker. The methodology is applied to SPIN using + Parma Polyhedra Library. In addition, the authors are + currently working on the extension of other model + checkers." +} + +@Inproceedings{GarocheKT13, + Author = "P.-L. Garoche and T. Kahsai and C. Tinelli", + Title = "Incremental Invariant Generation Using Logic-Based Automatic Abstract Transformers", + Booktitle = "NASA Formal Methods: + Proceedings of the 5th International Symposium (NFM 2013)", + Editor = "G. Brat and N. Rungta and A. Venet", + Address = "Moffett Field, CA, USA", + Pages = "139--154", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7871, + Year = 2013, + Abstract = "Formal analysis tools for system models often require or + benefit from the availability of auxiliary system + invariants. Abstract interpretation is currently one of + the best approaches for discovering useful invariants, + in particular numerical ones. However, its application + is limited by two orthogonal issues: (i) developing an + abstract interpretation is often non-trivial; each + transfer function of the system has to be represented at + the abstract level, depending on the abstract domain + used; (ii) with precise but costly abstract domains, the + information computed by the abstract interpreter can be + used only once a post fix point has been reached; this + may take a long time for large systems or when widening + is delayed to improve precision. We propose a new, + completely automatic, method to build abstract + interpreters which, in addition, can provide sound + invariants of the system under analysis before reaching + the end of the post fix point computation. In effect, + such interpreters act as on-the-fly invariant generators + and can be used by other tools such as logic-based model + checkers. We present some experimental results that + provide initial evidence of the practical usefulness of + our method." +} + +@Inproceedings{GhorbalIBMG12, + Author = "K Ghorbal and F Ivan\v{c}i{\'c} and G Balakrishnan and N Maeda", + Title = "Donut Domains: + Efficient Non-convex Domains for Abstract Interpretation", + Booktitle = "Verification, Model Checking, and Abstract Interpretation: + Proceedings of the 13th International Conference (VMCAI 2012)", + Address = "Philadelphia, PA, USA", + Editor = "V. Kuncak and A. Rybalchenko", + Publisher = "Springer-Verlag, Berlin", + Volume = 7148, + Year = 2012, + Pages = "235--250", + ISBN = "978-3-642-27939-3 (Print) 978-3-642-27940-9 (Online)", + Abstract = "Program analysis using abstract interpretation has been + successfully applied in practice to find runtime bugs or + prove software correct. Most abstract domains that are + used widely rely on convexity for their + scalability. However, the ability to express non-convex + properties is sometimes required in order to achieve a + precise analysis of some numerical properties. This work + combines already known abstract domains in a novel way + in order to design new abstract domains that tackle some + non-convex invariants. The abstract objects of interest + are encoded as a pair of two convex abstract objects: + the first abstract object defines an over-approximation + of the possible reached values, as is done + customarily. The second abstract object + under-approximates the set of impossible values within + the state-space of the first abstract object. Therefore, + the geometrical concretization of our objects is defined + by a convex set minus another convex set (or hole). We + thus call these domains donut domains." +} + @PhdThesis{Gobert07th, Author = "F. Gobert", Title = "Towards putting abstract interpretation of {Prolog} into practice: @@ -1931,9 +2910,9 @@ @Inproceedings{GulavaniR06, Author = "B. S. Gulavani and S. K. Rajamani", Title = "Counterexample Driven Refinement for Abstract Interpretation", - Booktitle = "Proceedings of the 12th International Conference on - Tools and Algorithms for the Construction and Analysis - of Systems (TACAS 2006)", + Booktitle = "Tools and Algorithms for the Construction and Analysis + of Systems: Proceedings of the 12th International Conference + (TACAS 2006)", Address = "Vienna, Austria", Editor = "H. Hermanns and J. Palsberg", Pages = "474--488", @@ -2139,6 +3118,91 @@ been made available online for demonstration." } +@Inproceedings{HenryMM12a, + Author = "J. Henry and D. Monniaux and M. Moy", + Title = "Succinct Representations for Abstract Interpretation", + Booktitle = "Static Analysis: + Proceedings of the 19th International Symposium (SAS 2012)", + Address = "Deauville, France", + Editor = "A. Min{\'e} and D. Schmidt", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7460, + Year = 2012, + Pages = "283--299", + Abstract = "Abstract interpretation techniques can be made more + precise by distinguishing paths inside loops, at the + expense of possibly exponential complexity. SMT-solving + techniques and sparse representations of paths and sets + of paths avoid this pitfall. + + We improve previously proposed techniques for guided + static analysis and the generation of disjunctive + invariants by combining them with techniques for + succinct representations of paths and symbolic + representations for transitions based on static single + assignment. + + Because of the non-monotonicity of the results of + abstract interpretation with widening operators, it is + difficult to conclude that some abstraction is more + precise than another based on theoretical local + precision results. We thus conducted extensive + comparisons between our new techniques and previous + ones, on a variety of open-source packages." +} + +@Article{HenryMM12b, + Author = "J. Henry and D. Monniaux and M. Moy", + Title = "{PAGAI}: A Path Sensitive Static Analyzer", + Journal = "Electronic Notes in Theoretical Computer Science", + Publisher = "Elsevier Science Publishers B.V.", + Address = "Amsterdam, The Netherlands", + Volume = 289, + Year = 2012, + ISSN = "1571-0661", + Pages = "15--25", + Abstract = "We describe the design and the implementation of PAGAI, + a new static analyzer working over the LLVM compiler + infrastructure, which computes inductive invariants on + the numerical variables of the analyzed program. PAGAI + implements various state-of-the-art algorithms combining + abstract interpretation and decision procedures + (SMT-solving), focusing on distinction of paths inside + the control flow graph while avoiding systematic + exponential enumerations. It is parametric in the + abstract domain in use, the iteration algorithm, and the + decision procedure. We compared the time and precision + of various combinations of analysis algorithms and + abstract domains, with extensive experiments both on + personal benchmarks and widely available GNU programs." +} + +@Inproceedings{HoweK12, + Author = "J. M. Howe and A. King", + Title = "Polyhedral Analysis Using Parametric Objectives", + Booktitle = "Static Analysis: + Proceedings of the 19th International Symposium (SAS 2012)", + Address = "Deauville, France", + Editor = "A. Min{\'e} and D. Schmidt", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7460, + Year = 2012, + Pages = "41--57", + Abstract = "The abstract domain of polyhedra lies at the heart of + many program analysis techniques. However, its + operations can be expensive, precluding their + application to polyhedra that involve many + variables. This paper describes a new approach to + computing polyhedral domain operations. The core of this + approach is an algorithm to calculate variable + elimination (projection) based on parametric linear + programming. The algorithm enumerates only non-redundant + inequalities of the projection space, hence permits + anytime approximation of the output." +} + @Inproceedings{HymansU04, Author = "C. Hymans and E. Upton", Title = "Static Analysis of Gated Data Dependence Graphs", @@ -2165,6 +3229,36 @@ techniques." } +@Article{Jakubczy12k, + Author = "K. Jakubczyk", + Title = "Sweeping in Abstract Interpretation", + Journal = "Electronic Notes in Theoretical Computer Science", + Publisher = "Elsevier Science Publishers B. V.", + Address = "Amsterdam, The Netherlands", + Volume = 288, + Pages = "25--36", + Year = 2012, + ISSN = "1571-0661", + Abstract = "In this paper we present how sweeping line techniques, + which are very popular in computational geometry, can be + adapted for static analysis of computer software by + abstract interpretation. We expose how concept of the + sweeping line can be used to represent elements of a + numerical abstract domain of \emph{boxes}, which is a + disjunctive refinement of a well known domain of + \emph{intervals} that allows finite number of + disjunctions. We provide a detailed description of the + representation along with standard domain operations + algorithms. Furthermore we introduce very precise + widening operator for the domain. Additionally we show + that the presented idea of the representation based on + sweeping line technique is a generalisation of the + representation that uses Linear Decision Diagrams (LDD), + which is one of possible optimisations of our idea. We + also show that the presented widening operator is often + more precise than the previous one." +} + @Article{JhalaM09, Author = "R. Jhala and R. Majumdar", Title = "Software Model Checking", @@ -2222,11 +3316,11 @@ Author = "B. Jeannet and A. Min{\'e}", Title = "Apron: A Library of Numerical Abstract Domains for Static Analysis", - Booktitle = "Computer Aided Verification, + Booktitle = "Computer Aided Verification: Proceedings of the 21st International Conference (CAV 2009)", Address = "Grenoble, France", Editor = "A. Bouajjani and O. Maler", - Publisher = "Springer", + Publisher = "Springer-Verlag, Berlin", Series = "Lecture Notes in Computer Science", Volume = 5643, Pages = "661--667", @@ -2244,17 +3338,56 @@ interpretation." } -@Incollection {KhalilGP09, +@InCollection{KapurZHZLN13, + Author = "D. Kapur and Z. Zhang and M. Horbach and H. Zhao and Q. Lu + and T. Nguyen", + Title = "Geometric Quantifier Elimination Heuristics + for Automatically Generating Octagonal and Max-Plus Invariants", + Booktitle = "Automated Reasoning and Mathematics: + Essays in Memory of William W. McCune", + Editor = "M. P. Bonacina and M. E. Stickel", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7788, + Pages = "189--228", + Year = 2013, + ISBN = "978-3-642-36674-1 (Print) 978-3-642-36675-8 (Online)", + Abstract = "Geometric heuristics for the quantifier elimination + approach presented by Kapur (2004) are investigated to + automatically derive loop invariants expressing weakly + relational numerical properties (such as $l \leq x \leq h$ or + $l \leq \pm x \pm y \leq h)$ for imperative programs. + Such properties + have been successfully used to analyze commercial + software consisting of hundreds of thousands of lines of + code (using for example, the Astr\'ee tool based on + abstract interpretation framework proposed by Cousot and + his group). The main attraction of the proposed approach + is its much lower complexity in contrast to the abstract + interpretation approach ($O(n^2)$ in contrast to $O(n^4)$, + where $n$ is the number of variables) with the ability to + still generate invariants of comparable strength. This + approach has been generalized to consider disjunctive + invariants of the similar form, expressed using maximum + function (such as + $\max(x+a, y+b, z+c, d) \leq \max (x+e, y+f, z+g, h)$), + thus enabling automatic generation of a subclass of + disjunctive invariants for imperative programs as well." +} + +@Incollection{KhalilGP09, Author = "G. Khalil and E. Goubault and S. Putot", Title = "The Zonotope Abstract Domain {Taylor1+}", - Booktitle = "Computer Aided Verification", - Series = "Lecture Notes in Computer Science", + Booktitle = "Computer Aided Verification: + Proceedings of the 21st International Conference (CAV 2009)", + Address = "Grenoble, France", Editor = "A. Bouajjani and O. Maler", Publisher = "Springer-Verlag, Berlin", - ISBN = "978-3-642-02657-7", - Pages = "627--633", + Series = "Lecture Notes in Computer Science", Volume = 5643, + Pages = "627--633", Year = 2009, + ISBN = "978-3-642-02657-7", Abstract = "Static analysis by abstract interpretation [1] aims it automatically inferring properties on the behaviour of programs. We focus here on a specific kind of numerical @@ -2295,6 +3428,34 @@ these control signals." } +@Inproceedings{KopfE13, + Author = "B. K{\"o}pf and A. Rybalchenko ", + Title = "Automation of Quantitative Information-Flow Analysis", + Booktitle = "Formal Methods for Dynamical Systems: + 13th International School on Formal Methods for + the Design of Computer, Communication, and Software Systems + (SFM 2013)", + Address = "Bertinoro, Italy", + Series = "Lecture Notes in Computer Science", + Editor = "M. Bernardo and E. de Vink and A. Di Pierro and H. Wiklicky", + Publisher = "Springer-Verlag, Berlin", + ISBN = "7938", + Pages = "1--28", + Volume = 7938, + Year = 2013, + Abstract = "Quantitative information-flow analysis (QIF) is an + emerging technique for establishing + information-theoretic confidentiality + properties. Automation of QIF is an important step + towards ensuring its practical applicability, since + manual reasoning about program security has been shown + to be a tedious and expensive task. In this chapter we + describe a approximation and randomization techniques to + bear on the challenge of sufficiently precise, yet + efficient computation of quantitative information flow + properties." +} + @Inproceedings{KruegelKMRV05, Author = "C. Kruegel and E. Kirda and D. Mutz and W. Robertson and G. Vigna", Title = "Automating Mimicry Attacks Using Static Binary Analysis", @@ -2361,6 +3522,29 @@ analysis can not." } +@Article{LarsenLTW13, + Author = "K. G. Larsen and A. Legay and L.-M. Traonouez and A. Wasowski", + Title = "Robust Synthesis for Real-Time Systems", + Journal = "Theoretical Computer Science", + Publisher = "Elsevier", + Volume = 515, + Pages = "96--122", + Year = 2013, + Abstract = "Specification theories for real-time systems allow + reasoning about interfaces and their implementation + models, using a set of operators that includes + satisfaction, refinement, logical and parallel + composition. To make such theories applicable throughout + the entire design process from an abstract specification + to an implementation, we need to reason about the + possibility to effectively implement the theoretical + specifications on physical systems, despite their + limited precision. In the literature, this + implementation problem has been linked to the robustness + problem that analyzes the consequences of introducing + small perturbations into formal models." +} + @Inproceedings{LavironL09, Author = "V. Laviron and F. Logozzo", Title = "SubPolyhedra: A (More) Scalable Approach to Infer Linear @@ -2427,13 +3611,32 @@ \url{http://www.irisa.fr/manifestations/2006/CSTVA06/}." } +@Inproceedings{LegayT13, + Author = "A. Legay and L.-M. Traonouez", + Title = "{PyEcdar}: Towards Open Source Implementation for Timed Systems", + Booktitle = "Automated Technology for Verification and Analysis: + Proceedings of the 11th International Symposium (ATVA 2013)", + Address = "Hanoi, Vietnam", + Editor = "D. {Van Hung} and M. Ogawa", + Pages = "460--463", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 8172, + Year = 2013, + ISBN = "978-3-319-02443-1 (Print) 978-3-319-02444-8 (Online)", + Abstract = "PyEcdar is an open source implementation for reasoning + on timed systems. PyEcdar's main objective is not + efficiency, but rather flexibility to test and implement + new results on timed systems" +} + @Inproceedings{LimeRST09, Author = "D. Lime and O. H. Roux and C. Seidner and L.-M. Traonouez", Title = "Romeo: A Parametric Model-Checker for {Petri} Nets with Stopwatches", - Booktitle = "Proceedings of the 15th International Conference - Tools and Algorithms for the Construction and Analysis - of Systems (TACAS 2009)", + Booktitle = "Tools and Algorithms for the Construction and Analysis + of Systems: Proceedings of the 15th International Conference + (TACAS 2009)", Address = "York, UK", Editor = "S. Kowalewski and A. Philippou", Publisher = "Springer-Verlag, Berlin", @@ -2461,6 +3664,35 @@ these recent developments of Romeo." } +@Article{LimeMR13, + Author = "D. Lime and C. Martinez and O. H. Roux", + Title = "Shrinking of Time {Petri} Nets", + Journal = "Discrete Event Dynamic Systems", + Publisher = "Springer-Verlag, Berlin", + Volume = 23, + Number = 4, + Pages = "419--438", + Year = 2013, + ISSN = "0924-6703 (Print) 1573-7594 (Online)", + Abstract = "The problem of the synthesis of time bounds enforcing + good properties for reactive systems has been much + studied in the literature. These works mainly rely on + dioid algebra theory and require important restrictions + on the structure of the model (notably by restricting to + timed event graphs). In this paper, we address the + problems of existence and synthesis of shrinkings of the + bounds of the time intervals of a time Petri net, such + that a given property is verified. We show that this + problem is decidable for CTL properties on bounded time + Petri nets. We then propose a symbolic algorithm based + on the state class graph for a fragment of CTL. If the + desired property ``include'' k-boundedness, the proposed + algorithm terminates even if the net is unbounded. A + prototype has been implemented in our tool Romeo and the + method is illustrated on a small case study from the + literature." +} + @Inproceedings{LogozzoF08, Author = "F. Logozzo and M. F{\"a}hndrich", Title = "Pentagons: A Weakly Relational Abstract Domain for the @@ -2493,6 +3725,27 @@ than 8 minutes." } +@article{LuMMRFL12, + Author = "Q. Lu and M. Madsen and M. Milata and S. Ravn and U. Fahrenberg + and K. G. Larsen", + Title = "Reachability Analysis for Timed Automata using Max-Plus Algebra", + ISSN = "1567-8326", + Journal = "Journal of Logic and Algebraic Programming", + Volume = 81, + Number = 3, + Year = 2012, + Abstract = "We show that max-plus polyhedra are usable as a data + structure in reachability analysis of timed + automata. Drawing inspiration from the extensive work + that has been done on difference bound matrices, as well + as previous work on max-plus polyhedra in other areas, we + develop the algorithms needed to perform forward and + backward reachability analysis using max-plus + polyhedra. To show that the approach works in practice + and theory alike, we have created a proof-of-concept + implementation on top of the model checker \texttt{opaal}." +} + @Inproceedings{MakhloufK06, Author = "I. B. Makhlouf and S. Kowalewski", Title = "An Evaluation of Two Recent Reachability Analysis Tools @@ -2514,6 +3767,88 @@ for hybrid systems." } +@Article{MardzielMHS13, + Title = "Dynamic Enforcement of Knowledge-based Security Policies + using Probabilistic Abstract Interpretation", + Author = "P. Mardziel and S. Magill and M. Hicks and M. Srivatsa", + Year = 2013, + Journal = "Journal of Computer Security", + Volume = 21, + Number = 4, + Pages = "463--532", + ISSN = "0926-227X (Print) 1875-8924 (Online)", + Publisher = "IOS Press", + Abstract = "This paper explores the idea of knowledge-based security + policies, which are used to decide whether to answer + queries over secret data based on an estimation of the + querier's (possibly increased) knowledge given the + results. Limiting knowledge is the goal of existing + information release policies that employ mechanisms such + as noising, anonymization, and + redaction. Knowledge-based policies are more general: + they increase flexibility by not fixing the means to + restrict information flow. We enforce a knowledge-based + policy by explicitly tracking a model of a querier's + belief about secret data, represented as a probability + distribution, and denying any query that could increase + knowledge above a given threshold. We implement query + analysis and belief tracking via abstract + interpretation, which allows us to trade off precision + and performance through the use of abstraction. We have + developed an approach to augment standard abstract + domains to include probabilities, and thus define + distributions. We focus on developing probabilistic + polyhedra in particular, to support numeric + programs. While probabilistic abstract interpretation + has been considered before, our domain is the first + whose design supports sound conditioning, which is + required to ensure that estimates of a querier's + knowledge are accurate. Experiments with our + implementation show that several useful queries can be + handled efficiently, particularly compared to exact + (i.e., sound) inference involving sampling. We also show + that, for our benchmarks, restricting constraints to + octagons or intervals, rather than full polyhedra, can + dramatically improve performance while incurring little + to no loss in precision." +} + +@Inproceedings{MardzielMHS11, + Author = "P. Mardziel and S. Magill and M. Hicks and M. Srivatsa", + Title = "Dynamic Enforcement of Knowledge-based Security Policies", + Year = 2011, + Booktitle = "Proceedings of the 24th IEEE Computer Security + Foundations Symposium (CSF 2011)", + Publisher = "IEEE Xplore Digital Library", + Address = "Cernay-la-Ville, France", + Editor = "M. Backes and S. Zdancewic", + Pages = "114--128", + ISBN = "978-0-7695-4365-9", + Abstract = "This paper explores the idea of knowledge-based security + policies, which are used to decide whether to answer + queries over secret data based on an estimation of the + querier's (possibly increased) knowledge given the + results. Limiting knowledge is the goal of existing + information release policies that employ mechanisms such + as noising, anonymization, and + redaction. Knowledge-based policies are more general: + they increase flexibility by not fixing the means to + restrict information flow. We enforce a knowledge-based + policy by explicitly tracking a model of a querier's + belief about secret data, represented as a probability + distribution, and denying any query that could increase + knowledge above a given threshold. We implement query + analysis and belief tracking via abstract interpretation + using a novel probabilistic polyhedral domain, whose + design permits trading off precision with performance + while ensuring estimates of a querier's knowledge are + sound. Experiments with our implementation show that + several useful queries can be handled efficiently, and + performance scales far better than would more standard + implementations of probabilistic computation based on + sampling." +} + @Inproceedings{ManevichSRF04, Author = "R. Manevich and M. Sagiv and G. Ramalingam and J. Field", Title = "Partially Disjunctive Heap Abstraction", @@ -2656,6 +3991,45 @@ respectable size and complexity." } +@Inproceedings{MihailaSS13, + Author = "B. Mihaila and A. Sepp and A. Simon", + Title = "Widening as Abstract Domain", + Booktitle = "NASA Formal Methods: + Proceedings of the 5th International Symposium (NFM 2013)", + Editor = "G. Brat and N. Rungta and A. Venet", + Address = "Moffett Field, CA, USA", + Pages = "170--174", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7871, + Year = 2013, + Abstract = "Verification using static analysis often hinges on + precise numeric invariants. Numeric domains of infinite + height can infer these invariants, but require + widening/narrowing which complicates the fixpoint + computation and is often too imprecise. As a + consequence, several strategies have been proposed to + prevent a precision loss during widening or to narrow in + a smarter way. Most of these strategies are difficult to + retrofit into an existing analysis as they either + require a pre-analysis, an on-the-fly modification of + the CFG, or modifications to the fixpoint algorithm. We + propose to encode widening and its various refinements + from the literature as cofibered abstract domains that + wrap standard numeric domains, thereby providing a + modular way to add numeric analysis to any static + analysis, that is, without modifying the fixpoint + engine. Since these domains cannot make any assumptions + about the structure of the program, our approach is + suitable to the analysis of executables, where the + (potentially irreducible) CFG is re-constructed + on-the-fly. Moreover, our domain-based approach not only + mirrors the precision of more intrusive approaches in + the literature but also requires fewer iterations to + find a fixpoint of loops than many heuristics that + merely aim for precision." +} + @Inproceedings{MonniauxG11, Author = "D. Monniaux and J. {Le Guen}", Title = "Stratified Static Analysis Based on Variable Dependencies", @@ -2676,6 +4050,59 @@ } +@Article{MonniauxG12, + Author = "D. Monniaux and J. {Le Guen}", + Title = "Stratified Static Analysis Based on Variable Dependencies", + Journal = "Electronic Notes in Theoretical Computer Science ({ENTCS})", + Publisher = "Elsevier Science Publishers B. V.", + Address = "Amsterdam, The Netherlands", + Volume = 288, + Pages = "61--74", + Year = 2012, + ISSN = "1571-0661", + Abstract = "In static analysis by abstract interpretation, one often + uses widening operators in order to enforce convergence + within finite time to an inductive invariant. Certain + widening operators, including the classical one over + finite polyhedra, exhibit an unintuitive behavior: + analyzing the program over a subset of its variables may + lead a more precise result than analyzing the original + program! In this article, we present simple workarounds + for such behavior." + +} + +@Incollection{MontenegroSEP12, + Author = "M. Montenegro and O. Shkaravska and M. {van Eekelen} + and R. Pe\~{n}a", + Title = "Interpolation-Based Height Analysis for Improving + a Recurrence Solver", + Booktitle = "Foundational and Practical Aspects of Resource Analysis: + Second International Workshop (FOPARA 2011), + Revised Selected Papers", + Editor = "R. Pe\~{n}a and M. {van Eekelen} and O. Shkaravska", + Address = "Madrid, Spain", + Pages = "36--53", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7177, + Year = 2012, + ISBN = "978-3-642-32494-9 (Print) 978-3-642-32495-6 (Online)", + Abstract = "The COSTA system infers resource consumption bounds from + Java bytecode using an internal recurrence solver + PUBS. This paper suggests an improvement of the COSTA + system, such that it can solve a larger number of + recurrences. The idea is to replace one of its static + analyses, the ranking function analysis, by another kind + of analysis, height analysis, in such a way that + polynomial bounds of any degree may be inferred instead + of just linear expressions. The work can be seen as an + application of some polynomial interpolation techniques + used by some of the authors in prior analyses. Finding a + way to choose proper test nodes is the key to the + solution presented in this paper." +} + @Inproceedings{MoserKK07, Author = "A. Moser and C. Kr{\"u}gel and E. Kirda", Title = "Exploring Multiple Execution Paths for Malware Analysis", @@ -2759,6 +4186,81 @@ set of interesting resources." } +@Article{PanizoG12, + Author = "L. Panizo and M.-d.-M. Gallardo", + Title = "An extension of Java PathFinder for hybrid systems", + Journal = "ACM SIGSOFT Software Engineering Notes", + Volume = 37, + Number = 6, + Year = 2012, + ISSN = "0163-5948", + Pages = "1--5", + Publisher = "ACM New York, USA", + Abstract = "Hybrid systems are characterized by combining discrete + and continuous behaviors. Verification of hybrid systems + is, in general, a diffcult task due to the potential + complexity of the continuous dynamics. Currently, there + are different formalisms and tools which are able to + analyze specific types of hybrid systems, model checking + being one of the most used approaches. In this paper, we + describe an extension of Java PathFinder in order to + analyze hybrid systems. We apply a general methodology + which has been successfully used to extend Spin. This + methodology is non-intrusive, and uses external + libraries, such as the Parma Polyhedra Library, to + abstract the continuous behavior of the hybrid system." +} + +@Inproceedings{PartushY13, + Author = "N. Partush and E. Yahav", + Title = "Abstract Semantic Differencing for Numerical Programs", + Booktitle = "Static Analysis: + Proceedings of the 20th International Symposium (SAS 2013)", + Address = "Seattle, WA, USA", + Editor = "F. Logozzo and M. F{\"a}hndrich", + Publisher = "Springer-Verlag, Berlin", + Series = "Lecture Notes in Computer Science", + Volume = 7935, + Pages = "238--258", + Year = 2013, + ISBN = "978-3-642-38855-2 (Print) 978-3-642-38856-9 (Online)", + Abstract = "We address the problem of computing semantic differences + between a program and a patched version of the + program. Our goal is to obtain a precise + characterization of the difference between program + versions, or establish their equivalence when no + difference exists. + + We focus on computing semantic differences in numerical + programs where the values of variables have no a-priori + bounds, and use abstract interpretation to compute an + over-approximation of program differences. Computing + differences and establishing equivalence under + abstraction requires abstracting relationships between + variables in the two programs. Towards that end, we + first construct a correlating program in which these + relationships can be tracked, and then use a correlating + abstract domain to compute a sound approximation of + these relationships. To better establish equivalence + between correlated variables and precisely capture + differences, our domain has to represent non-convex + information using a partially-disjunctive abstract + domain. To balance precision and cost of this + representation, our domain over-approximates numerical + information while preserving equivalence between + correlated variables by dynamically partitioning the + disjunctive state according to equivalence criteria. + + We have implemented our approach in a tool called DIZY, + and applied it to a number of real-world examples, + including programs from the GNU core utilities, Mozilla + Firefox and the Linux Kernel. Our evaluation shows that + DIZY often manages to establish equivalence, describes + precise approximation of semantic differences when + difference exists, and reports only a few false + differences." +} + @Inproceedings{CuervoParrinoNVM12, Author = "B. {Cuervo Parrino} and J. Narboux and E. Violard and N. Magaud", Title = "Dealing with Arithmetic Overflows in the Polyhedral Model", @@ -2836,7 +4338,7 @@ @Inproceedings{PerezRS09, Author = "J. A. {Navarro P{\'e}rez} and A. Rybalchenko and A. Singh", Title = "Cardinality Abstraction for Declarative Networking Applications", - Booktitle = "Computer Aided Verification, + Booktitle = "Computer Aided Verification: Proceedings of the 21st International Conference (CAV 2009)", Address = "Grenoble, France", Editor = "A. Bouajjani and O. Maler", @@ -2876,8 +4378,8 @@ @Inproceedings{PhamTTC11, Author = "T.-H. Pham and M.-T. Trinh and A.-H. Truong and W.-N. Chin", Title = "{FixBag:} A Fixpoint Calculator for Quantified Bag Constraints", - Booktitle = "Proceedings of the 23rd International Conference on - Computer Aided Verification (CAV 2011)", + Booktitle = "Computer Aided Verification: + Proceedings of the 23rd International Conference (CAV 2011)", Address = "Snowbird, UT, USA", Series = "Lecture Notes in Computer Science", Editor = "G. Gopalakrishnan and S. Qadeer", @@ -2983,6 +4485,49 @@ can progressively enhance precision at a reasonable cost." } +@Inproceedings{RastogiMMH13, + Author = "A. Rastogi and P. Mardziel and M. Hammer and M. Hicks", + Title = "Knowledge Inference for Optimizing Secure Multi-Party Computation", + Year = 2013, + Booktitle = "Proceedings of the 2013 ACM SIGPLAN Workshop on + Programming Languages and Analysis for Security (PLAS'13)", + Editor = "P. Naldurg", + ISBN = "978-1-4503-2144-0", + Address = "Seattle, Washington, USA", + Publisher = "ACM Press, New York, USA", + Pages = "3--14", + Abstract = "In secure multi-party computation, mutually distrusting + parties cooperatively compute functions of their private + data; in the process, they only learn certain results as + per the protocol (e.g., the final output). The + realization of these protocols uses cryptographic + techniques to avoid leaking information between the + parties. A protocol for a secure computation can + sometimes be optimized without changing its security + guarantee: when the parties can use their private data + and the revealed output to infer the values of other + data, then this other data need not be concealed from + them via cryptography. + + In the context of automatically optimizing secure + multi-party computation, we define two related problems, + knowledge inference and constructive knowledge + inference. In both problems, we attempt to automatically + discover when and if intermediate variables used in a + protocol will (eventually) be known to the parties + involved in the computation. Provably-known variables + offer optimization opportunities. + + We formally state the problem of knowledge inference + (and its constructive variant); we describe our + solutions, which are built atop existing, standard + technology such as SMT solvers. We show that our + approach is sound, and further, we characterize the + completeness properties enjoyed by our approach. We have + implemented our approach, and present a preliminary + experimental evaluation." +} + @Article{RizkBFS09, Author = "A. Rizk and G. Batt and F. Fages and S. Soliman", @@ -2991,7 +4536,7 @@ Journal = "Bioinformatics", Publisher = "Oxford University Press", Volume = 25, - Number = "12", + Number = 12, Pages = "i169--i178", Year = 2009, Note = "Paper accepted for presentation at the 2009 ISMB/ECCB Conference, @@ -3264,6 +4809,60 @@ results." } +@Article{SchrammelJ12, + Author = "P. Schrammel and B. Jeannet", + Title = "Applying Abstract Acceleration to (Co-)Reachability Analysis of Reactive Programs", + Journal = "Journal of Symbolic Computation", + Publisher = "Elsevier Science B.V.", + Volume = 47, + Number = 12, + Year = 2012, + Pages = "1512--1532", + Abstract = "We propose a new technique combining dynamic and static + analysis of programs to find linear invariants. We use a + statistical tool, called simple component analysis, to + analyze partial execution traces of a given program. We + get a new coordinate system in the vector space of + program variables, which is used to specialize numerical + abstract domains. As an application, we instantiate our + technique to interval analysis of simple imperative + programs and show some experimental evaluations." +} + +@Inproceedings{SharmaGHAN13, + Author = "R. Sharma and S. Gupta and B. Hariharan and A. Aiken and A. V. Nori", + Title = "Verification as Learning Geometric Concepts", + Booktitle = "Static Analysis: + Proceedings of the 20th International Symposium (SAS 2013)", + Address = "Seattle, USA", + Series = "Lecture Notes in Computer Science", + Editor = "F. Logozzo and M. F{\"a}hndrich", + Publisher = "Springer-Verlag, Berlin", + ISBN = "978-3-642-38855-2 (Print) 978-3-642-38856-9 (Online)", + Pages = "388--411", + Volume = 7935, + Year = 2013, + Abstract = "We formalize the problem of program verification as a + learning problem, showing that invariants in program + verification can be regarded as geometric concepts in + machine learning. Safety properties define bad states: + states a program should not reach. Program verification + explains why a program's set of reachable states is + disjoint from the set of bad states. In Hoare Logic, + these explanations are predicates that form inductive + assertions. Using samples for reachable and bad states + and by applying well known machine learning algorithms + for classification, we are able to generate inductive + assertions. By relaxing the search for an exact proof to + classifiers, we obtain complexity theoretic + improvements. Further, we extend the learning algorithm + to obtain a sound procedure that can generate proofs + containing invariants that are arbitrary boolean + combinations of polynomial inequalities. We have + evaluated our approach on a number of challenging + benchmarks and the results are promising." +} + @Inproceedings{Simon10a, Author = "A. Simon", Title = "A Note on the Inversion Join for Polyhedral Analysis", @@ -3520,7 +5119,7 @@ @Article{TraonouezLR09, Author = "L.-M. Traonouez and D. Lime and O. H. Roux", - Title = "Parametric Model-Checking of Stopwatch Petri Nets", + Title = "Parametric Model-Checking of Stopwatch {Petri} Nets", Journal = "Journal of Universal Computer Science", Year = 2009, Volume = 15, @@ -3618,6 +5217,42 @@ be solved to optimality." } +@Inproceedings{UpadrastaC13, + Author = "R. Upadrasta and A. Cohen", + Title = "Sub-Polyhedral Scheduling Using (Unit-)Two-Variable-Per-Inequality + Polyhedra", + Booktitle = "Proceedings of the 40th Annual ACM SIGPLAN-SIGACT Symposium on + Principles of Programming Languages (POPL 2013)", + Year = 2013, + ISBN = "978-1-4503-1832-7", + Address = "Rome, Italy", + Pages = "483--496", + Publisher = "ACM Press, New York, USA", + Note = "Also published in SIGPLAN Notices, Volume 48, Number 1", + Abstract = "Polyhedral compilation has been successful in the design + and implementation of complex loop nest optimizers and + parallelizing compilers. The algorithmic complexity and + scalability limitations remain one important weakness. We + address it using sub-polyhedral under-aproximations of + the systems of constraints resulting from affine + scheduling problems. We propose a sub-polyhedral + scheduling technique using + (Unit-)Two-Variable-Per-Inequality or (U)TVPI + Polyhedra. This technique relies on simple polynomial + time algorithms to under-approximate a general polyhedron + into (U)TVPI polyhedra. We modify the state-of-the-art + PLuTo compiler using our scheduling technique, and show + that for a majority of the Polybench (2.0) kernels, the + above under-approximations yield polyhedra that are + non-empty. Solving the under-approximated system leads to + asymptotic gains in complexity, and shows practically + significant improvements when compared to a traditional + LP solver. We also verify that code generated by our + sub-polyhedral parallelization prototype matches the + performance of PLuTo-optimized code when the + under-approximation preserves feasibility." +} + @Inproceedings{vanHeeOSV06, Author = "K. {van Hee} and O. Oanea and N. Sidorova and M. Voorhoeve", Title = "Verifying Generalized Soundness for Workflow Nets", @@ -3840,6 +5475,71 @@ complexity of the abstract operators." } +@Inproceedings{ZanioliFC12, + Author = "M. Zanioli and P. Ferrara and A. Cortesi", + Title = "{SAILS}: Static Analysis of Information Leakage with Sample", + Booktitle = "Proceedings of the 27th Annual ACM Symposium + on Applied Computing", + Editor ="C.-C. Hung and J. Hong", + Year = 2012, + ISBN = "978-1-4503-0857-1", + Address = "Trento, Italy", + Pages = "1308--1313", + Publisher = "ACM New York, USA", + Abstract = "In this paper, we introduce Sails, a new tool that + combines Sample, a generic static analyzer, and a + sophisticated domain for leakage analysis. This tool does + not require to modify the original language, since it + works with mainstream languages like Java, and it does + not require any manual annotation. Sails can combine the + information leakage analysis with different heap + abstractions, inferring information leakage over programs + dealing with complex data structures. We applied Sails to + the analysis of the SecuriBench-micro suite. The + experimental results show the effectiveness of our + approach." +} + + +@Incollection{ZuffereyWH12, + Author = "D. Zufferey and T. Wies and T. A. Henzinger", + Title = "Ideal Abstractions for Well-Structured Transition Systems", + Booktitle = "Verification, Model Checking, and Abstract Interpretation: + Proceedings of 13th International Conference (VMCAI 2012)", + Series = "Lecture Notes in Computer Science", + Editor = "V. Kuncak and A. Rybalchenko", + Publisher = "Springer-Verlag, Berlin", + ISBN = "978-3-642-27939-3 (Print) 978-3-642-27940-9 (Online)", + Pages = "445--460", + Volume = 7148, + Year = 2012, + Abstract = "Many infinite state systems can be seen as + well-structured transition systems (WSTS), i.e., systems + equipped with a well-quasi-ordering on states that is + also a simulation relation. WSTS are an attractive + target for formal analysis because there exist generic + algorithms that decide interesting verification problems + for this class. Among the most popular algorithms are + acceleration-based forward analyses for computing the + covering set. Termination of these algorithms can only + be guaranteed for flattable WSTS. Yet, many WSTS of + practical interest are not flattable and the question + whether any given WSTS is flattable is itself + undecidable. We therefore propose an analysis that + computes the covering set and captures the essence of + acceleration-based algorithms, but sacrifices precision + for guaranteed termination. Our analysis is an abstract + interpretation whose abstract domain builds on the ideal + completion of the well-quasi-ordered state space, and a + widening operator that mimics acceleration and controls + the loss of precision of the analysis. We present + instances of our framework for various classes of + WSTS. Our experience with a prototype implementation + indicates that, despite the inherent precision loss, our + analysis often computes the precise covering set of the + analyzed system." +} + ==============================================================================

ODC Attribution License (ODC-By)

diff -Nru ppl-1.1/doc/ppl-config.1 ppl-1.2/doc/ppl-config.1 --- ppl-1.1/doc/ppl-config.1 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/ppl-config.1 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.11. -.TH PPL-CONFIG "1" "October 2013" "ppl-config 1.1" "User Commands" +.TH PPL-CONFIG "1" "February 2016" "ppl-config 1.2" "User Commands" .SH NAME ppl-config \- obtain information about an installation of the Parma Polyhedra Library .SH SYNOPSIS @@ -103,7 +103,7 @@ Report bugs to . .SH "COPYRIGHT AND NO WARRANTY" Copyright (C) 2001\-2010 Roberto Bagnara -Copyright (C) 2010\-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010\-2016 BUGSENG srl (http://bugseng.com) .br This is free software; see the file \fBCOPYING\fR in the source distribution or use the command \fBppl\-config \-\-copying\fR to @@ -117,26 +117,26 @@ .BR libppl_c(3) .sp Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. -.IR "The Parma Polyhedra Library User's Manual (version 1.0)", +.IR "The Parma Polyhedra Library User's Manual (version 1.2)", available (in several formats) at \fBhttp://bugseng.com/products/ppl/\fR . .sp Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. -.IR "The Parma Polyhedra Library C Language Interface User's Manual (version 1.0)", +.IR "The Parma Polyhedra Library C Language Interface User's Manual (version 1.2)", available (in several formats) at \fBhttp://bugseng.com/products/ppl/\fR . .sp Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. -.IR "The Parma Polyhedra Library Java Language Interface User's Manual (version 1.0)", +.IR "The Parma Polyhedra Library Java Language Interface User's Manual (version 1.2)", available (in several formats) at \fBhttp://bugseng.com/products/ppl/\fR . .sp Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. -.IR "The Parma Polyhedra Library OCaml Language Interface User's Manual (version 1.0)", +.IR "The Parma Polyhedra Library OCaml Language Interface User's Manual (version 1.2)", available (in several formats) at \fBhttp://bugseng.com/products/ppl/\fR . .sp Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. -.IR "The Parma Polyhedra Library Prolog Language Interface User's Manual (version 1.0)", +.IR "The Parma Polyhedra Library Prolog Language Interface User's Manual (version 1.2)", available (in several formats) at \fBhttp://bugseng.com/products/ppl/\fR . diff -Nru ppl-1.1/doc/ppl.sty ppl-1.2/doc/ppl.sty --- ppl-1.1/doc/ppl.sty 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/ppl.sty 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ %% LaTeX package providing macros for typesetting the PPL manuals. %% Copyright (C) 2001-2010 Roberto Bagnara -%% Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +%% Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) %% %% This file is part of the Parma Polyhedra Library (PPL). %% Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-1.1-html.tar.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-1.1-html.tar.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-1.1.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-1.1.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-1.1.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-1.1.ps.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-1.2-html.tar.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-1.2-html.tar.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-1.2.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-1.2.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-1.2.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-1.2.ps.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-c-interface-1.1-html.tar.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-c-interface-1.1-html.tar.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-c-interface-1.1.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-c-interface-1.1.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-c-interface-1.1.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-c-interface-1.1.ps.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-c-interface-1.2-html.tar.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-c-interface-1.2-html.tar.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-c-interface-1.2.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-c-interface-1.2.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-c-interface-1.2.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-c-interface-1.2.ps.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-java-interface-1.1-html.tar.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-java-interface-1.1-html.tar.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-java-interface-1.1.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-java-interface-1.1.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-java-interface-1.1.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-java-interface-1.1.ps.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-java-interface-1.2-html.tar.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-java-interface-1.2-html.tar.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-java-interface-1.2.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-java-interface-1.2.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-java-interface-1.2.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-java-interface-1.2.ps.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-ocaml-interface-1.1-html.tar.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-ocaml-interface-1.1-html.tar.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-ocaml-interface-1.1.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-ocaml-interface-1.1.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-ocaml-interface-1.1.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-ocaml-interface-1.1.ps.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-prolog-interface-1.1-html.tar.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-prolog-interface-1.1-html.tar.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-prolog-interface-1.1.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-prolog-interface-1.1.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-prolog-interface-1.1.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-prolog-interface-1.1.ps.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-prolog-interface-1.2-html.tar.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-prolog-interface-1.2-html.tar.gz differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-prolog-interface-1.2.pdf and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-prolog-interface-1.2.pdf differ Binary files /tmp/tmpky2Jy9/onHLb8gFx0/ppl-1.1/doc/ppl-user-prolog-interface-1.2.ps.gz and /tmp/tmpky2Jy9/R2SaWYN8WC/ppl-1.2/doc/ppl-user-prolog-interface-1.2.ps.gz differ diff -Nru ppl-1.1/doc/README.doc ppl-1.2/doc/README.doc --- ppl-1.1/doc/README.doc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/README.doc 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) See below for the copying conditions. @@ -136,7 +136,7 @@ -------- Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/doc/user.doxyconf-html.in ppl-1.2/doc/user.doxyconf-html.in --- ppl-1.1/doc/user.doxyconf-html.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/user.doxyconf-html.in 2016-02-11 12:31:26.000000000 +0000 @@ -1,4 +1,4 @@ -# Doxyfile 1.8.4 +# Doxyfile 1.8.9.1 #--------------------------------------------------------------------------- # Project related configuration options @@ -10,6 +10,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES @@ -62,7 +63,9 @@ INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = NO @@ -84,7 +87,7 @@ LAYOUT_FILE = CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = YES WARNINGS = YES @@ -94,7 +97,7 @@ WARN_FORMAT = "$file:$line: $text " WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = @srcdir@/definitions.dox \ ../src/ppl.hh \ @@ -117,7 +120,7 @@ FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO @@ -125,16 +128,17 @@ REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = ppl-user-@VERSION@-html @@ -192,7 +196,7 @@ EXTERNAL_SEARCH_ID = EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- -# configuration options related to the LaTeX output +# Configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = user.latex-dir @@ -203,6 +207,7 @@ EXTRA_PACKAGES = ppl LATEX_HEADER = @srcdir@/user.tex LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES USE_PDFLATEX = YES @@ -211,7 +216,7 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- -# configuration options related to the RTF output +# Configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf @@ -219,32 +224,33 @@ RTF_HYPERLINKS = YES RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +RTF_SOURCE_CODE = NO #--------------------------------------------------------------------------- -# configuration options related to the man page output +# Configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 +MAN_SUBDIR = MAN_LINKS = NO #--------------------------------------------------------------------------- -# configuration options related to the XML output +# Configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- -# configuration options related to the DOCBOOK output +# Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook +DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output +# Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- -# configuration options related to the Perl module output +# Configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO @@ -263,7 +269,7 @@ EXPAND_AS_DEFINED = PPL_OUTPUT_DECLARATIONS SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration options related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ppl-user-@VERSION@-html.tag @@ -276,6 +282,7 @@ #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO MSCGEN_PATH = +DIA_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES DOT_NUM_THREADS = 0 @@ -299,6 +306,9 @@ DOT_PATH = DOTFILE_DIRS = MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_INCLUDE_PATH = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO diff -Nru ppl-1.1/doc/user.doxyconf-latex.in ppl-1.2/doc/user.doxyconf-latex.in --- ppl-1.1/doc/user.doxyconf-latex.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/user.doxyconf-latex.in 2016-02-11 12:31:26.000000000 +0000 @@ -1,4 +1,4 @@ -# Doxyfile 1.8.4 +# Doxyfile 1.8.9.1 #--------------------------------------------------------------------------- # Project related configuration options @@ -10,6 +10,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES @@ -62,7 +63,9 @@ INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = NO @@ -84,7 +87,7 @@ LAYOUT_FILE = CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = YES WARNINGS = YES @@ -94,7 +97,7 @@ WARN_FORMAT = "$file:$line: $text " WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = @srcdir@/definitions.dox \ ../src/ppl.hh \ @@ -117,7 +120,7 @@ FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO @@ -125,16 +128,17 @@ REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = NO HTML_OUTPUT = ppl-user-@VERSION@-html @@ -192,7 +196,7 @@ EXTERNAL_SEARCH_ID = EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- -# configuration options related to the LaTeX output +# Configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = YES LATEX_OUTPUT = user.latex-dir @@ -203,6 +207,7 @@ EXTRA_PACKAGES = ppl LATEX_HEADER = @srcdir@/user.tex LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES USE_PDFLATEX = YES @@ -211,7 +216,7 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- -# configuration options related to the RTF output +# Configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf @@ -219,32 +224,33 @@ RTF_HYPERLINKS = YES RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +RTF_SOURCE_CODE = NO #--------------------------------------------------------------------------- -# configuration options related to the man page output +# Configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 +MAN_SUBDIR = MAN_LINKS = NO #--------------------------------------------------------------------------- -# configuration options related to the XML output +# Configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- -# configuration options related to the DOCBOOK output +# Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook +DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output +# Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- -# configuration options related to the Perl module output +# Configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO @@ -263,7 +269,7 @@ EXPAND_AS_DEFINED = PPL_OUTPUT_DECLARATIONS SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration options related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = @@ -276,6 +282,7 @@ #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO MSCGEN_PATH = +DIA_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES DOT_NUM_THREADS = 0 @@ -299,6 +306,9 @@ DOT_PATH = DOTFILE_DIRS = MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_INCLUDE_PATH = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO diff -Nru ppl-1.1/doc/user-language-interface.doxyconf.in ppl-1.2/doc/user-language-interface.doxyconf.in --- ppl-1.1/doc/user-language-interface.doxyconf.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/user-language-interface.doxyconf.in 2016-02-11 12:31:26.000000000 +0000 @@ -1,4 +1,4 @@ -# Doxyfile 1.8.4 +# Doxyfile 1.8.9.1 #--------------------------------------------------------------------------- # Project related configuration options @@ -10,6 +10,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES @@ -62,7 +63,9 @@ INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = NO @@ -84,7 +87,7 @@ LAYOUT_FILE = CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = YES WARNINGS = YES @@ -94,7 +97,7 @@ WARN_FORMAT = "$file:$line: $text " WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = INPUT_ENCODING = UTF-8 @@ -114,7 +117,7 @@ FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO @@ -122,16 +125,17 @@ REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = HTML_OUTPUT = ppl-user--@VERSION@-html @@ -189,7 +193,7 @@ EXTERNAL_SEARCH_ID = EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- -# configuration options related to the LaTeX output +# Configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = LATEX_OUTPUT = user-.latex-dir @@ -200,6 +204,7 @@ EXTRA_PACKAGES = ppl LATEX_HEADER = user-.tex LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES USE_PDFLATEX = YES @@ -208,7 +213,7 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- -# configuration options related to the RTF output +# Configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf @@ -216,32 +221,33 @@ RTF_HYPERLINKS = YES RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +RTF_SOURCE_CODE = NO #--------------------------------------------------------------------------- -# configuration options related to the man page output +# Configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 +MAN_SUBDIR = MAN_LINKS = NO #--------------------------------------------------------------------------- -# configuration options related to the XML output +# Configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- -# configuration options related to the DOCBOOK output +# Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook +DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output +# Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- -# configuration options related to the Perl module output +# Configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO @@ -267,7 +273,7 @@ PPL_DECLARE_AND_DOCUMENT_IO_FUNCTIONS SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration options related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = @@ -280,6 +286,7 @@ #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO MSCGEN_PATH = +DIA_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES DOT_NUM_THREADS = 0 @@ -303,6 +310,9 @@ DOT_PATH = DOTFILE_DIRS = MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_INCLUDE_PATH = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO diff -Nru ppl-1.1/doc/user-language-interface.tex ppl-1.2/doc/user-language-interface.tex --- ppl-1.1/doc/user-language-interface.tex 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/user-language-interface.tex 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ % Copyright (C) 2001-2010 Roberto Bagnara -% Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +% Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) % % This document describes the Parma Polyhedra Library (PPL). % @@ -60,6 +60,7 @@ \fi \usepackage[utf8]{inputenc} \usepackage{doxygen} +\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} \usepackage{ppl} \makeindex @@ -72,6 +73,11 @@ \setlength{\headheight}{24pt} +% Custom commands +\newcommand{\clearemptydoublepage}{% + \newpage{\pagestyle{empty}\cleardoublepage}% +} + \begin{document} \title{ \includegraphics[height=9cm]{ppl_logo.pdf} \\ @@ -119,7 +125,7 @@ \newpage Copyright \copyright\ 2001--2010 Roberto Bagnara (bagnara@cs.unipr.it) \\ -Copyright \copyright\ 2010--2013 BUGSENG srl (http://bugseng.com) +Copyright \copyright\ 2010--2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/doc/user.tex ppl-1.2/doc/user.tex --- ppl-1.1/doc/user.tex 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/doc/user.tex 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ % Copyright (C) 2001-2010 Roberto Bagnara -% Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +% Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) % % This document describes the Parma Polyhedra Library (PPL). % @@ -60,6 +60,7 @@ \fi \usepackage[utf8]{inputenc} \usepackage{doxygen} +\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} \usepackage{ppl} \makeindex \setcounter{tocdepth}{2} @@ -71,6 +72,11 @@ \setlength{\headheight}{24pt} +% Custom commands +\newcommand{\clearemptydoublepage}{% + \newpage{\pagestyle{empty}\cleardoublepage}% +} + \begin{document} \title{ \includegraphics[height=9cm]{ppl_logo.pdf} \\ @@ -118,7 +124,7 @@ \newpage Copyright \copyright\ 2001--2010 Roberto Bagnara (bagnara@cs.unipr.it) \\ -Copyright \copyright\ 2010--2013 BUGSENG srl (http://bugseng.com) +Copyright \copyright\ 2010--2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/instchk.hh ppl-1.2/instchk.hh --- ppl-1.1/instchk.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/instchk.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Fake declarations to test the validity of the arguments of the --enabled-instantiations option defined in configure.ac. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/C_interface.dox ppl-1.2/interfaces/C/C_interface.dox --- ppl-1.1/interfaces/C/C_interface.dox 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/C_interface.dox 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Doxumentation for the C language interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/Makefile.am ppl-1.2/interfaces/C/Makefile.am --- ppl-1.1/interfaces/C/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/C/Makefile.in ppl-1.2/interfaces/C/Makefile.in --- ppl-1.1/interfaces/C/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/interfaces/C/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -108,6 +108,7 @@ $(top_srcdir)/depcomp $(include_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -127,7 +128,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/C/ppl_c.h.dist ppl-1.2/interfaces/C/ppl_c.h.dist --- ppl-1.1/interfaces/C/ppl_c.h.dist 2013-10-28 12:47:31.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_c.h.dist 2016-02-11 12:40:50.000000000 +0000 @@ -1,6 +1,6 @@ /* This is the header file of the C interface of the Parma Polyhedra Library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -259,7 +259,7 @@ PPL_VERSION_BETA is zero, M "." m "." r "pre" b if neither PPL_VERSION_REVISION nor PPL_VERSION_BETA are zero. */ -#define PPL_VERSION "1.1" +#define PPL_VERSION "1.2" /*! \brief The major number of the PPL version. @@ -271,7 +271,7 @@ The minor number of the PPL version. \ingroup Version */ -#define PPL_VERSION_MINOR 1 +#define PPL_VERSION_MINOR 2 /*! \brief The revision number of the PPL version. diff -Nru ppl-1.1/interfaces/C/ppl_c_header.h ppl-1.2/interfaces/C/ppl_c_header.h --- ppl-1.1/interfaces/C/ppl_c_header.h 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_c_header.h 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* This is the header file of the C interface of the Parma Polyhedra Library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/ppl_c_implementation_common.cc ppl-1.2/interfaces/C/ppl_c_implementation_common.cc --- ppl-1.1/interfaces/C/ppl_c_implementation_common.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_c_implementation_common.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Implementation of the C interface: variables and non-inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/ppl_c_implementation_common_defs.hh ppl-1.2/interfaces/C/ppl_c_implementation_common_defs.hh --- ppl-1.1/interfaces/C/ppl_c_implementation_common_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_c_implementation_common_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Implementation of the C interface: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/ppl_c_implementation_common_inlines.hh ppl-1.2/interfaces/C/ppl_c_implementation_common_inlines.hh --- ppl-1.1/interfaces/C/ppl_c_implementation_common_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_c_implementation_common_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Implementation of the C interface: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/ppl_c_version.h.in ppl-1.2/interfaces/C/ppl_c_version.h.in --- ppl-1.1/interfaces/C/ppl_c_version.h.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_c_version.h.in 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Header file providing version information for the C interface. -*- C -*- Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/ppl_interface_generator_c_cc_code.m4 ppl-1.2/interfaces/C/ppl_interface_generator_c_cc_code.m4 --- ppl-1.1/interfaces/C/ppl_interface_generator_c_cc_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_interface_generator_c_cc_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -6,7 +6,7 @@ in ppl_interface instantiations.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/C/ppl_interface_generator_c_cc_files.m4 ppl-1.2/interfaces/C/ppl_interface_generator_c_cc_files.m4 --- ppl-1.1/interfaces/C/ppl_interface_generator_c_cc_files.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_interface_generator_c_cc_files.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl using the code in ppl_interface_generator_c_cc_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/C/ppl_interface_generator_c_h_code.m4 ppl-1.2/interfaces/C/ppl_interface_generator_c_h_code.m4 --- ppl-1.1/interfaces/C/ppl_interface_generator_c_h_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_interface_generator_c_h_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ files ppl_c_domains.h. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/C/ppl_interface_generator_c_hh_files.m4 ppl-1.2/interfaces/C/ppl_interface_generator_c_hh_files.m4 --- ppl-1.1/interfaces/C/ppl_interface_generator_c_hh_files.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_interface_generator_c_hh_files.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl using the code in ppl_interface_generator_c_h_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/C/ppl_interface_generator_c_h.m4 ppl-1.2/interfaces/C/ppl_interface_generator_c_h.m4 --- ppl-1.1/interfaces/C/ppl_interface_generator_c_h.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_interface_generator_c_h.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl using the code in ppl_interface_generator_c_h_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/C/ppl_interface_generator_c_procedure_generators.m4 ppl-1.2/interfaces/C/ppl_interface_generator_c_procedure_generators.m4 --- ppl-1.1/interfaces/C/ppl_interface_generator_c_procedure_generators.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/ppl_interface_generator_c_procedure_generators.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl - the list in the imported file and any C specific procedures. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/C/tests/formatted_output.c ppl-1.2/interfaces/C/tests/formatted_output.c --- ppl-1.1/interfaces/C/tests/formatted_output.c 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/tests/formatted_output.c 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the use of C++ output facilities from C code. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,6 +24,7 @@ #include "ppl_c_test.h" #include "print_to_buffer.h" +#include #include #define DIMENSION 100 @@ -58,7 +59,10 @@ else printf(" %s\n", p); } + free(p); ppl_delete_Constraint_System(cs); + ppl_delete_Coefficient(coeff); ppl_finalize(); + mpz_clear(z); return 0; } diff -Nru ppl-1.1/interfaces/C/tests/Makefile.am ppl-1.2/interfaces/C/tests/Makefile.am --- ppl-1.1/interfaces/C/tests/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/tests/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/C/tests/Makefile.in ppl-1.2/interfaces/C/tests/Makefile.in --- ppl-1.1/interfaces/C/tests/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/interfaces/C/tests/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -111,6 +111,7 @@ $(noinst_HEADERS) $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -130,7 +131,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/C/tests/pip_test.c ppl-1.2/interfaces/C/tests/pip_test.c --- ppl-1.1/interfaces/C/tests/pip_test.c 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/tests/pip_test.c 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the use of the PPL PIP solver from C code. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -112,6 +112,8 @@ ppl_io_print_Constraint(c); notfirst = 1; } + ppl_delete_Constraint_System_const_iterator(end); + ppl_delete_Constraint_System_const_iterator(i); printf(" then\n"); } ppl_PIP_Tree_Node_as_decision(node, &dn); @@ -175,6 +177,7 @@ int main(int argc, char **argv) { ppl_PIP_Problem_t pip; + ppl_Constraint_System_t cs; ppl_Constraint_t ct; ppl_Coefficient_t c; ppl_Linear_Expression_t le; @@ -220,6 +223,7 @@ ppl_new_PIP_Problem_from_space_dimension(&pip, N_VARS+N_PARAMETERS); ppl_PIP_Problem_add_to_parameter_space_dimensions(pip, parameter_dim, N_PARAMETERS); + ppl_new_Constraint_System(&cs); ppl_new_Coefficient(&c); for (i = 0; i < N_CONSTRAINTS; ++i) { ppl_new_Linear_Expression(&le); @@ -232,7 +236,9 @@ ppl_assign_Coefficient_from_mpz_t(c, mpc); ppl_Linear_Expression_add_to_inhomogeneous(le, c); ppl_new_Constraint(&ct, le, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL); + ppl_Constraint_System_insert_Constraint(cs, ct); ppl_PIP_Problem_add_constraint(pip, ct); + ppl_delete_Constraint(ct); ppl_delete_Linear_Expression(le); } ppl_delete_Coefficient(c); @@ -246,7 +252,6 @@ ppl_dimension_type dim; ppl_const_PIP_Tree_Node_t solution; ppl_PIP_Problem_t pip0; - ppl_Constraint_System_t constraints; ppl_Constraint_System_const_iterator_t begin, end; ppl_PIP_Problem_space_dimension(pip, &dim); @@ -255,18 +260,19 @@ display_solution(solution, N_VARS, N_PARAMETERS, parameter_dim); ppl_new_Constraint_System_const_iterator(&begin); ppl_new_Constraint_System_const_iterator(&end); - ppl_new_Constraint_System_from_Constraint(&constraints, ct); - ppl_Constraint_System_begin(constraints, begin); - ppl_Constraint_System_end(constraints, end); + ppl_Constraint_System_begin(cs, begin); + ppl_Constraint_System_end(cs, end); ppl_new_PIP_Problem_from_constraints(&pip0, N_VARS+N_PARAMETERS, begin, end, N_PARAMETERS, parameter_dim); ok = ppl_PIP_Problem_OK(pip0); - ppl_delete_Constraint(ct); - ppl_delete_Constraint_System(constraints); + ppl_delete_PIP_Problem(pip0); + ppl_delete_Constraint_System_const_iterator(end); + ppl_delete_Constraint_System_const_iterator(begin); } ppl_delete_PIP_Problem(pip); + ppl_delete_Constraint_System(cs); ppl_finalize(); return ok ? 0 : 1; } diff -Nru ppl-1.1/interfaces/C/tests/ppl_c_test.cc ppl-1.2/interfaces/C/tests/ppl_c_test.cc --- ppl-1.1/interfaces/C/tests/ppl_c_test.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/tests/ppl_c_test.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Implementation of utility functions used in test programs of the C interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/tests/ppl_c_test.h ppl-1.2/interfaces/C/tests/ppl_c_test.h --- ppl-1.1/interfaces/C/tests/ppl_c_test.h 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/tests/ppl_c_test.h 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Header file for C test programs. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/tests/print_to_buffer.c ppl-1.2/interfaces/C/tests/print_to_buffer.c --- ppl-1.1/interfaces/C/tests/print_to_buffer.c 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/tests/print_to_buffer.c 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Definitions of print_ppl_*_to_buffer() functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/tests/print_to_buffer.h ppl-1.2/interfaces/C/tests/print_to_buffer.h --- ppl-1.1/interfaces/C/tests/print_to_buffer.h 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/tests/print_to_buffer.h 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Declarations of print_ppl_*_to_buffer() functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/tests/watchdog1.c ppl-1.2/interfaces/C/tests/watchdog1.c --- ppl-1.1/interfaces/C/tests/watchdog1.c 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/tests/watchdog1.c 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the timeout facility of the PPL C interface library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/C/tests/weightwatch1.c ppl-1.2/interfaces/C/tests/weightwatch1.c --- ppl-1.1/interfaces/C/tests/weightwatch1.c 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/C/tests/weightwatch1.c 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the deterministic timeout facility of the PPL C interface library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/interfaced_boxes.hh ppl-1.2/interfaces/interfaced_boxes.hh --- ppl-1.1/interfaces/interfaced_boxes.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/interfaced_boxes.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declarations for the Box instantiations offered by the non-templatic language interfaces. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/jni/Makefile.am ppl-1.2/interfaces/Java/jni/Makefile.am --- ppl-1.1/interfaces/Java/jni/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/jni/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Java/jni/Makefile.in ppl-1.2/interfaces/Java/jni/Makefile.in --- ppl-1.1/interfaces/Java/jni/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/interfaces/Java/jni/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -106,6 +106,7 @@ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -125,7 +126,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Java/jni/ppl_interface_generator_java_classes_cc_code.m4 ppl-1.2/interfaces/Java/jni/ppl_interface_generator_java_classes_cc_code.m4 --- ppl-1.1/interfaces/Java/jni/ppl_interface_generator_java_classes_cc_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/jni/ppl_interface_generator_java_classes_cc_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ This m4 file contains the code for generating ppl_java_.cc Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/jni/ppl_interface_generator_java_classes_cc_files.m4 ppl-1.2/interfaces/Java/jni/ppl_interface_generator_java_classes_cc_files.m4 --- ppl-1.1/interfaces/Java/jni/ppl_interface_generator_java_classes_cc_files.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/jni/ppl_interface_generator_java_classes_cc_files.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl using the code in ppl_interface_generator_java_classes_cc_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Java/jni/ppl_java_common.cc ppl-1.2/interfaces/Java/jni/ppl_java_common.cc --- ppl-1.1/interfaces/Java/jni/ppl_java_common.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/jni/ppl_java_common.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PPL Java interface common routines implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/jni/ppl_java_common_defs.hh ppl-1.2/interfaces/Java/jni/ppl_java_common_defs.hh --- ppl-1.1/interfaces/Java/jni/ppl_java_common_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/jni/ppl_java_common_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Domain-independent part of the Java interface: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/jni/ppl_java_common_inlines.hh ppl-1.2/interfaces/Java/jni/ppl_java_common_inlines.hh --- ppl-1.1/interfaces/Java/jni/ppl_java_common_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/jni/ppl_java_common_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Domain-independent part of the Java interface: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/jni/ppl_java_globals.cc ppl-1.2/interfaces/Java/jni/ppl_java_globals.cc --- ppl-1.1/interfaces/Java/jni/ppl_java_globals.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/jni/ppl_java_globals.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PPL Java interface: domain-independent functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/Makefile.am ppl-1.2/interfaces/Java/Makefile.am --- ppl-1.1/interfaces/Java/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Java/Makefile.in ppl-1.2/interfaces/Java/Makefile.in --- ppl-1.1/interfaces/Java/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/interfaces/Java/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -106,6 +106,7 @@ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -125,7 +126,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Artificial_Parameter.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Artificial_Parameter.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Artificial_Parameter.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Artificial_Parameter.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Artificial_Parameter Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Artificial_Parameter_Sequence.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Artificial_Parameter_Sequence.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Artificial_Parameter_Sequence.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Artificial_Parameter_Sequence.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Artificial_Parameter_Sequence Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Overflow.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Overflow.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Overflow.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Overflow.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Bounded_Integer_Type_Overflow enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Representation.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Representation.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Representation.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Representation.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Bounded_Integer_Type_Representation enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Width.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Width.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Width.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Bounded_Integer_Type_Width.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Bounded_Integer_Type_Width enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/By_Reference.java ppl-1.2/interfaces/Java/parma_polyhedra_library/By_Reference.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/By_Reference.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/By_Reference.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* By_Reference Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Coefficient.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Coefficient.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Coefficient.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Coefficient.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Coefficient Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Complexity_Class.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Complexity_Class.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Complexity_Class.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Complexity_Class.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Complexity_Class enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Congruence.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Congruence.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Congruence.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Congruence.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Congruence Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Congruence_System.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Congruence_System.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Congruence_System.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Congruence_System.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Congruence_System Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Constraint.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Constraint.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Constraint.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Constraint.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Constraint Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -47,6 +47,8 @@ */ public Constraint(Linear_Expression le1, Relation_Symbol rel_sym, Linear_Expression le2) { + if (rel_sym == Relation_Symbol.NOT_EQUAL) + throw new Invalid_Argument_Exception("Invalid relation symbol"); lhs = le1.clone(); rhs = le2.clone(); kind = rel_sym; diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Constraint_System.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Constraint_System.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Constraint_System.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Constraint_System.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Constraint_System Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Control_Parameter_Name.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Control_Parameter_Name.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Control_Parameter_Name.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Control_Parameter_Name.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* MIP_Problem Control_Parameter_Name enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Control_Parameter_Value.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Control_Parameter_Value.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Control_Parameter_Value.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Control_Parameter_Value.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* MIP_Problem's Control_Parameter_Value enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Degenerate_Element.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Degenerate_Element.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Degenerate_Element.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Degenerate_Element.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Degenerate_Element enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Domain_Error_Exception.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Domain_Error_Exception.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Domain_Error_Exception.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Domain_Error_Exception.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Domain_Error_Exception Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Fake_Class_for_Doxygen.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Fake_Class_for_Doxygen.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Fake_Class_for_Doxygen.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Fake_Class_for_Doxygen.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Doxumentation for the Java interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Generator.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Generator.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Generator.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Generator.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Generator Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Generator_System.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Generator_System.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Generator_System.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Generator_System.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Generator_System Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Generator_Type.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Generator_Type.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Generator_Type.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Generator_Type.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Generator_Type enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Grid_Generator.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Grid_Generator.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Grid_Generator.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Grid_Generator.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid Generator Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Grid_Generator_System.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Grid_Generator_System.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Grid_Generator_System.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Grid_Generator_System.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid Generator_System Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Grid_Generator_Type.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Grid_Generator_Type.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Grid_Generator_Type.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Grid_Generator_Type.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid_Generator_Type enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Invalid_Argument_Exception.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Invalid_Argument_Exception.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Invalid_Argument_Exception.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Invalid_Argument_Exception.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Invalid_Argument_Exception Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/IO.java ppl-1.2/interfaces/Java/parma_polyhedra_library/IO.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/IO.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/IO.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* IO Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Length_Error_Exception.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Length_Error_Exception.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Length_Error_Exception.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Length_Error_Exception.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Length_Error_Exception Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Coefficient.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Coefficient.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Coefficient.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Coefficient.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Coefficient class definition and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Difference.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Difference.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Difference.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Difference.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Difference class definition and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression Java declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Sum.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Sum.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Sum.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Sum.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Sum class definition and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Times.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Times.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Times.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Times.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Times class definition and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Unary_Minus.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Unary_Minus.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Unary_Minus.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Unary_Minus.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Unary_Minus class definition and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Variable.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Variable.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Linear_Expression_Variable.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Linear_Expression_Variable.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Variable class definition and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Logic_Error_Exception.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Logic_Error_Exception.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Logic_Error_Exception.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Logic_Error_Exception.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Logic_Error_Exception Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Makefile.am ppl-1.2/interfaces/Java/parma_polyhedra_library/Makefile.am --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Makefile.in ppl-1.2/interfaces/Java/parma_polyhedra_library/Makefile.in --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -105,6 +105,7 @@ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -124,7 +125,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/MIP_Problem.java ppl-1.2/interfaces/Java/parma_polyhedra_library/MIP_Problem.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/MIP_Problem.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/MIP_Problem.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* MIP_Problem Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/MIP_Problem_Status.java ppl-1.2/interfaces/Java/parma_polyhedra_library/MIP_Problem_Status.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/MIP_Problem_Status.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/MIP_Problem_Status.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* MIP_Problem_Status enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Optimization_Mode.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Optimization_Mode.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Optimization_Mode.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Optimization_Mode.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Optimization_Mode enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Overflow_Error_Exception.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Overflow_Error_Exception.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Overflow_Error_Exception.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Overflow_Error_Exception.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Overflow_Error_Exception Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Pair.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Pair.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Pair.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Pair.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Pair Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Parma_Polyhedra_Library.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Parma_Polyhedra_Library.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Parma_Polyhedra_Library.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Parma_Polyhedra_Library.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Parma_Polyhedra_Library Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Partial_Function.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Partial_Function.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Partial_Function.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Partial_Function.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Partial_Function Java interface declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Decision_Node.java ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Decision_Node.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Decision_Node.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Decision_Node.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Decision_Node Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Parameter_Name.java ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Parameter_Name.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Parameter_Name.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Parameter_Name.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Problem PIP_Problem_Control_Parameter_Name enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Parameter_Value.java ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Parameter_Value.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Parameter_Value.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Problem_Control_Parameter_Value.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Problem PIP_Problem_Control_Parameter_Value enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Problem.java ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Problem.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Problem.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Problem.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Problem Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Problem_Status.java ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Problem_Status.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Problem_Status.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Problem_Status.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Problem_Status enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Solution_Node.java ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Solution_Node.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Solution_Node.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Solution_Node.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Solution_Node Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Tree_Node.java ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Tree_Node.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/PIP_Tree_Node.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/PIP_Tree_Node.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Tree_Node Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Poly_Con_Relation.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Poly_Con_Relation.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Poly_Con_Relation.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Poly_Con_Relation.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Poly_Con_Relation Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Poly_Gen_Relation.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Poly_Gen_Relation.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Poly_Gen_Relation.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Poly_Gen_Relation.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Poly_Gen_Relation Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java_code.m4 ppl-1.2/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java_code.m4 --- ppl-1.1/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ This m4 file contains the code for generating files .java Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java.m4 ppl-1.2/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java.m4 --- ppl-1.1/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl using the code in ppl_interface_generator_java_classes_java_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/PPL_Object.java ppl-1.2/interfaces/Java/parma_polyhedra_library/PPL_Object.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/PPL_Object.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/PPL_Object.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PPL_Object Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Relation_Symbol.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Relation_Symbol.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Relation_Symbol.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Relation_Symbol.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Relation_Symbol enum declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Timeout_Exception.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Timeout_Exception.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Timeout_Exception.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Timeout_Exception.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Timeout_Exception Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Variable.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Variable.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Variable.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Variable.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Variable Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Variables_Set.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Variables_Set.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Variables_Set.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Variables_Set.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Variables_Set Java class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/parma_polyhedra_library/Variable_Stringifier.java ppl-1.2/interfaces/Java/parma_polyhedra_library/Variable_Stringifier.java --- ppl-1.1/interfaces/Java/parma_polyhedra_library/Variable_Stringifier.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/parma_polyhedra_library/Variable_Stringifier.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Variable_Stringifier Java interface. - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/ppl_interface_generator_java_procedure_generators.m4 ppl-1.2/interfaces/Java/ppl_interface_generator_java_procedure_generators.m4 --- ppl-1.1/interfaces/Java/ppl_interface_generator_java_procedure_generators.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/ppl_interface_generator_java_procedure_generators.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl - the list in the imported file and any Java specific methods. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Java/README.java ppl-1.2/interfaces/Java/README.java --- ppl-1.1/interfaces/Java/README.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/README.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/interfaces/Java/tests/C_Polyhedron_test1.java ppl-1.2/interfaces/Java/tests/C_Polyhedron_test1.java --- ppl-1.1/interfaces/Java/tests/C_Polyhedron_test1.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/C_Polyhedron_test1.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test C_Polyhedron Java test class of the Parma Polyhedra Library Java interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/tests/Custom_Variable_Stringifier.java ppl-1.2/interfaces/Java/tests/Custom_Variable_Stringifier.java --- ppl-1.1/interfaces/Java/tests/Custom_Variable_Stringifier.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/Custom_Variable_Stringifier.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* A class providing customized variable output for Java. - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/tests/Makefile.am ppl-1.2/interfaces/Java/tests/Makefile.am --- ppl-1.1/interfaces/Java/tests/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Java/tests/Makefile.in ppl-1.2/interfaces/Java/tests/Makefile.in --- ppl-1.1/interfaces/Java/tests/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -105,6 +105,7 @@ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -124,7 +125,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Java/tests/MIP_Problem_test1.java ppl-1.2/interfaces/Java/tests/MIP_Problem_test1.java --- ppl-1.1/interfaces/Java/tests/MIP_Problem_test1.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/MIP_Problem_test1.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test MIP_Problem Java test class of the Parma Polyhedra Library Java interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/tests/NNC_Polyhedron_test1.java ppl-1.2/interfaces/Java/tests/NNC_Polyhedron_test1.java --- ppl-1.1/interfaces/Java/tests/NNC_Polyhedron_test1.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/NNC_Polyhedron_test1.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test NNC_Polyhedron Java test class of the Parma Polyhedra Library Java interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/tests/Parma_Polyhedra_Library_test1.java ppl-1.2/interfaces/Java/tests/Parma_Polyhedra_Library_test1.java --- ppl-1.1/interfaces/Java/tests/Parma_Polyhedra_Library_test1.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/Parma_Polyhedra_Library_test1.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Parma_Polyhedra_Library Java test class of the Parma Polyhedra Library Java interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/tests/Parma_Polyhedra_Library_test2.java ppl-1.2/interfaces/Java/tests/Parma_Polyhedra_Library_test2.java --- ppl-1.1/interfaces/Java/tests/Parma_Polyhedra_Library_test2.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/Parma_Polyhedra_Library_test2.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Parma_Polyhedra_Library Java test class of the Parma Polyhedra Library Java interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -51,6 +51,28 @@ max_dimension); } + public static boolean test03() { + Linear_Expression_Variable le_a + = new Linear_Expression_Variable(new Variable(0)); + Linear_Expression le_zero + = new Linear_Expression_Coefficient(new Coefficient("0")); + try { + Constraint c = new Constraint(le_a, + Relation_Symbol.NOT_EQUAL, + le_zero); + } + catch (Invalid_Argument_Exception e) { + PPL_Test.println_if_noisy("Expected invalid argument exception" + + " caught!"); + PPL_Test.println_if_noisy(e.getMessage()); + return true; + } + PPL_Test.println_if_noisy("Expected invalid argument exception" + + " NOT caught!"); + return false; + } + + public static void main(String[] args) { Parma_Polyhedra_Library.initialize_library(); boolean test_result_ok = diff -Nru ppl-1.1/interfaces/Java/tests/PIP_Problem_test1.java ppl-1.2/interfaces/Java/tests/PIP_Problem_test1.java --- ppl-1.1/interfaces/Java/tests/PIP_Problem_test1.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/PIP_Problem_test1.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test PIP_Problem Java test class of the Parma Polyhedra Library Java interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/tests/ppl_interface_generator_java_test_java_code.m4 ppl-1.2/interfaces/Java/tests/ppl_interface_generator_java_test_java_code.m4 --- ppl-1.1/interfaces/Java/tests/ppl_interface_generator_java_test_java_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/ppl_interface_generator_java_test_java_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ This m4 file contains the code for generating ppl_java_generated_tests.java Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/tests/ppl_interface_generator_java_test_java.m4 ppl-1.2/interfaces/Java/tests/ppl_interface_generator_java_test_java.m4 --- ppl-1.1/interfaces/Java/tests/ppl_interface_generator_java_test_java.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/ppl_interface_generator_java_test_java.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl using the code in ppl_interface_generator_java_test_code.m4. dnl dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Java/tests/ppl_java_tests_common ppl-1.2/interfaces/Java/tests/ppl_java_tests_common --- ppl-1.1/interfaces/Java/tests/ppl_java_tests_common 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/ppl_java_tests_common 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Common code for the PPL Java interface tests. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/tests/PPL_Test.java ppl-1.2/interfaces/Java/tests/PPL_Test.java --- ppl-1.1/interfaces/Java/tests/PPL_Test.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/PPL_Test.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test helper class of the Parma Polyhedra Library Java interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/tests/Test_Executor.java ppl-1.2/interfaces/Java/tests/Test_Executor.java --- ppl-1.1/interfaces/Java/tests/Test_Executor.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/Test_Executor.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test helper class of the Parma Polyhedra Library Java interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Java/tests/Variable_Output_test1.java ppl-1.2/interfaces/Java/tests/Variable_Output_test1.java --- ppl-1.1/interfaces/Java/tests/Variable_Output_test1.java 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Java/tests/Variable_Output_test1.java 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Test customization of variable output in Java. - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Makefile.am ppl-1.2/interfaces/Makefile.am --- ppl-1.1/interfaces/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Makefile.in ppl-1.2/interfaces/Makefile.in --- ppl-1.1/interfaces/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/interfaces/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -106,6 +106,7 @@ $(top_srcdir)/mkinstalldirs $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -125,7 +126,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/marked_pointers.hh ppl-1.2/interfaces/marked_pointers.hh --- ppl-1.1/interfaces/marked_pointers.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/marked_pointers.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Implementation of marked pointers for use in some PPL non-templatic language interfaces. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/OCaml/Makefile.am ppl-1.2/interfaces/OCaml/Makefile.am --- ppl-1.1/interfaces/OCaml/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/OCaml/Makefile.in ppl-1.2/interfaces/OCaml/Makefile.in --- ppl-1.1/interfaces/OCaml/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -107,6 +107,7 @@ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -126,7 +127,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/OCaml/OCaml_interface.dox ppl-1.2/interfaces/OCaml/OCaml_interface.dox --- ppl-1.1/interfaces/OCaml/OCaml_interface.dox 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/OCaml_interface.dox 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Documentation for the OCaml interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_cc_code.m4 ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_cc_code.m4 --- ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_cc_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_cc_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -6,7 +6,7 @@ in ppl_interface instantiations.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_cc_files.m4 ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_cc_files.m4 --- ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_cc_files.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_cc_files.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl using the code in ppl_interface_generator_ocaml_cc_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_hh_code.m4 ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_hh_code.m4 --- ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_hh_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_hh_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ dnl Used by ppl_interfaces_generator_ocaml_hh_files.m4 dnl for generating the access code for the OCaml interface. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_hh_files.m4 ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_hh_files.m4 --- ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_hh_files.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_hh_files.m4 2016-02-11 12:31:26.000000000 +0000 @@ -7,7 +7,7 @@ dnl ppl_interface_generator_ocaml_hh_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_ml_code.m4 ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_ml_code.m4 --- ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_ml_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_ml_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ This m4 file contains the program code for generating ppl_ocaml.ml dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_mli_code.m4 ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_mli_code.m4 --- ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_mli_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_mli_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ This m4 file contains the program code for generating ppl_ocaml.mli dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_mli.m4 ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_mli.m4 --- ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_mli.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_mli.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl using the code in ppl_interface_generator_ocaml_mli_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_ml.m4 ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_ml.m4 --- ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_ml.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_ml.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl using the code in ppl_interface_generator_ocaml_ml_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_procedure_generators.m4 ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_procedure_generators.m4 --- ppl-1.1/interfaces/OCaml/ppl_interface_generator_ocaml_procedure_generators.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_interface_generator_ocaml_procedure_generators.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl - the list in the imported file and any OCaml specific procedures. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/ppl_ocaml_common.cc ppl-1.2/interfaces/OCaml/ppl_ocaml_common.cc --- ppl-1.1/interfaces/OCaml/ppl_ocaml_common.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_ocaml_common.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Domain-independent part of the OCaml interface: non-inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/OCaml/ppl_ocaml_common_defs.hh ppl-1.2/interfaces/OCaml/ppl_ocaml_common_defs.hh --- ppl-1.1/interfaces/OCaml/ppl_ocaml_common_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_ocaml_common_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Domain-independent part of the OCaml interface: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/OCaml/ppl_ocaml_common_inlines.hh ppl-1.2/interfaces/OCaml/ppl_ocaml_common_inlines.hh --- ppl-1.1/interfaces/OCaml/ppl_ocaml_common_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_ocaml_common_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Domain-independent part of the OCaml interface: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/OCaml/ppl_ocaml_globals.ml ppl-1.2/interfaces/OCaml/ppl_ocaml_globals.ml --- ppl-1.1/interfaces/OCaml/ppl_ocaml_globals.ml 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_ocaml_globals.ml 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ (* OCaml interface: domain-independent functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/OCaml/ppl_ocaml_globals.mli ppl-1.2/interfaces/OCaml/ppl_ocaml_globals.mli --- ppl-1.1/interfaces/OCaml/ppl_ocaml_globals.mli 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/ppl_ocaml_globals.mli 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ (* OCaml interface: module inteface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/OCaml/README.ocaml ppl-1.2/interfaces/OCaml/README.ocaml --- ppl-1.1/interfaces/OCaml/README.ocaml 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/README.ocaml 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/interfaces/OCaml/tests/Makefile.am ppl-1.2/interfaces/OCaml/tests/Makefile.am --- ppl-1.1/interfaces/OCaml/tests/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/tests/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/OCaml/tests/Makefile.in ppl-1.2/interfaces/OCaml/tests/Makefile.in --- ppl-1.1/interfaces/OCaml/tests/Makefile.in 2013-10-28 12:44:52.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/tests/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -107,6 +107,7 @@ $(top_srcdir)/mkinstalldirs $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -126,7 +127,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml_code.m4 ppl-1.2/interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml_code.m4 --- ppl-1.1/interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml.m4 ppl-1.2/interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml.m4 --- ppl-1.1/interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/tests/ppl_interface_generator_ocaml_test_ml.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ m4_define(`dnl', `m4_dnl')`'dnl m4_divert(-1) dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/OCaml/tests/ppl_ocaml_tests_common ppl-1.2/interfaces/OCaml/tests/ppl_ocaml_tests_common --- ppl-1.1/interfaces/OCaml/tests/ppl_ocaml_tests_common 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/tests/ppl_ocaml_tests_common 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ (* Common part of the OCaml generated tests. -*- Tuareg -*- Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/OCaml/tests/test1.ml ppl-1.2/interfaces/OCaml/tests/test1.ml --- ppl-1.1/interfaces/OCaml/tests/test1.ml 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/OCaml/tests/test1.ml 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ (* Simple program testing the PPL OCaml interface on a few random things. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/ppl_interface_generator_common_dat.m4 ppl-1.2/interfaces/ppl_interface_generator_common_dat.m4 --- ppl-1.1/interfaces/ppl_interface_generator_common_dat.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/ppl_interface_generator_common_dat.m4 2016-02-11 12:31:26.000000000 +0000 @@ -6,7 +6,7 @@ dnl - the replacements for the patterns in the code files. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/ppl_interface_generator_common.m4 ppl-1.2/interfaces/ppl_interface_generator_common.m4 --- ppl-1.1/interfaces/ppl_interface_generator_common.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/ppl_interface_generator_common.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl - defining the main code generation macro m4_all_code. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/ppl_interface_generator_common_procedure_generators.m4 ppl-1.2/interfaces/ppl_interface_generator_common_procedure_generators.m4 --- ppl-1.1/interfaces/ppl_interface_generator_common_procedure_generators.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/ppl_interface_generator_common_procedure_generators.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ dnl that are independent of the interface being generated. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/ppl_interface_generator_copyright ppl-1.2/interfaces/ppl_interface_generator_copyright --- ppl-1.1/interfaces/ppl_interface_generator_copyright 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/ppl_interface_generator_copyright 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ ` Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Ciao/ciao_cfli.hh ppl-1.2/interfaces/Prolog/Ciao/ciao_cfli.hh --- ppl-1.1/interfaces/Prolog/Ciao/ciao_cfli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/ciao_cfli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Ciao Prolog Common Foreign Language Interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Ciao/ciao_clpq2.pl ppl-1.2/interfaces/Prolog/Ciao/ciao_clpq2.pl --- ppl-1.1/interfaces/Prolog/Ciao/ciao_clpq2.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/ciao_clpq2.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the 2nd toy PPL/CIAO-Prolog CLP(Q) interpreter. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Ciao/ciao_clpq.pl ppl-1.2/interfaces/Prolog/Ciao/ciao_clpq.pl --- ppl-1.1/interfaces/Prolog/Ciao/ciao_clpq.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/ciao_clpq.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the toy PPL/CIAO-Prolog CLP(Q) interpreter. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Ciao/ciao_efli.cc ppl-1.2/interfaces/Prolog/Ciao/ciao_efli.cc --- ppl-1.1/interfaces/Prolog/Ciao/ciao_efli.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/ciao_efli.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Ciao Prolog extended foreign language interface: definitions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Ciao/ciao_efli.hh ppl-1.2/interfaces/Prolog/Ciao/ciao_efli.hh --- ppl-1.1/interfaces/Prolog/Ciao/ciao_efli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/ciao_efli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Ciao Prolog extended foreign language interface: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Ciao/ciao_pl_check.pl ppl-1.2/interfaces/Prolog/Ciao/ciao_pl_check.pl --- ppl-1.1/interfaces/Prolog/Ciao/ciao_pl_check.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/ciao_pl_check.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the toy PPL/CIAO-Prolog predicate checker. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Ciao/Makefile.am ppl-1.2/interfaces/Prolog/Ciao/Makefile.am --- ppl-1.1/interfaces/Prolog/Ciao/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Prolog/Ciao/Makefile.in ppl-1.2/interfaces/Prolog/Ciao/Makefile.in --- ppl-1.1/interfaces/Prolog/Ciao/Makefile.in 2013-10-28 12:44:53.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -107,6 +107,7 @@ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -126,7 +127,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Prolog/Ciao/ppl_interface_generator_ciao_pl.m4 ppl-1.2/interfaces/Prolog/Ciao/ppl_interface_generator_ciao_pl.m4 --- ppl-1.1/interfaces/Prolog/Ciao/ppl_interface_generator_ciao_pl.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/ppl_interface_generator_ciao_pl.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ dnl This m4 file generates the file ppl_ciao.pl. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/Ciao/ppl_interface_generator_ciao_prolog_generated_test_pl.m4 ppl-1.2/interfaces/Prolog/Ciao/ppl_interface_generator_ciao_prolog_generated_test_pl.m4 --- ppl-1.1/interfaces/Prolog/Ciao/ppl_interface_generator_ciao_prolog_generated_test_pl.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/ppl_interface_generator_ciao_prolog_generated_test_pl.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl the Ciao dependent code for ciao_prolog_generated_test.pl. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/Ciao/ppl_prolog_sysdep.hh ppl-1.2/interfaces/Prolog/Ciao/ppl_prolog_sysdep.hh --- ppl-1.1/interfaces/Prolog/Ciao/ppl_prolog_sysdep.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/ppl_prolog_sysdep.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* System-dependent part of the Prolog interfaces: stub for Ciao Prolog. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Ciao/README.ciao ppl-1.2/interfaces/Prolog/Ciao/README.ciao --- ppl-1.1/interfaces/Prolog/Ciao/README.ciao 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Ciao/README.ciao 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/interfaces/Prolog/GNU/gnu_pl_check.pl ppl-1.2/interfaces/Prolog/GNU/gnu_pl_check.pl --- ppl-1.1/interfaces/Prolog/GNU/gnu_pl_check.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/gnu_pl_check.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the PPL/GNU-Prolog predicate checker. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/GNU/gnu_prolog_generated_test.pl ppl-1.2/interfaces/Prolog/GNU/gnu_prolog_generated_test.pl --- ppl-1.1/interfaces/Prolog/GNU/gnu_prolog_generated_test.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/gnu_prolog_generated_test.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the PPL/GNU-Prolog predicate checker. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/GNU/gp_clpq.pl ppl-1.2/interfaces/Prolog/GNU/gp_clpq.pl --- ppl-1.1/interfaces/Prolog/GNU/gp_clpq.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/gp_clpq.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Main program for the toy PPL/GNU-Prolog CLP(Q) interpreter. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/GNU/gprolog_cfli.hh ppl-1.2/interfaces/Prolog/GNU/gprolog_cfli.hh --- ppl-1.1/interfaces/Prolog/GNU/gprolog_cfli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/gprolog_cfli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Prolog Common Foreign Language Interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -252,6 +252,16 @@ } /*! + Assign to \p t the list terminator [] (which needs not + be an atom). +*/ +inline int +Prolog_put_nil(Prolog_term_ref& t) { + t = Mk_Atom(atom_nil); + return 1; +} + +/*! Assign to \p t a term representing the address contained in \p p. */ inline int @@ -432,6 +442,21 @@ } /*! + Succeeds if and only if \p t represents the list terminator [] + (which needs not be an atom). +*/ +inline int +Prolog_get_nil(Prolog_term_ref t) { + if (Blt_Atom(t) == FALSE) { + return 0; + } + else { + int a = atom_nil; + return Rd_Atom_Check(t) == a; + } +} + +/*! If \p c is a Prolog cons (list constructor), assign its head and tail to \p h and \p t, respectively. The behavior is undefined if \p c is not a Prolog cons. diff -Nru ppl-1.1/interfaces/Prolog/GNU/gprolog_efli.cc ppl-1.2/interfaces/Prolog/GNU/gprolog_efli.cc --- ppl-1.1/interfaces/Prolog/GNU/gprolog_efli.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/gprolog_efli.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Prolog extended foreign language interface: definitions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/GNU/gprolog_efli.hh ppl-1.2/interfaces/Prolog/GNU/gprolog_efli.hh --- ppl-1.1/interfaces/Prolog/GNU/gprolog_efli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/gprolog_efli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Prolog extended foreign language interface: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -45,14 +45,14 @@ integer value representable by a Prolog integer. Holds zero otherwise. */ -extern long Prolog_min_integer; +extern PlLong Prolog_min_integer; /*! If \p Prolog_has_unbounded_integers is false, holds the maximum integer value representable by a Prolog integer. Holds zero otherwise. */ -extern long Prolog_max_integer; +extern PlLong Prolog_max_integer; /*! Performs system-dependent initialization. diff -Nru ppl-1.1/interfaces/Prolog/GNU/Makefile.am ppl-1.2/interfaces/Prolog/GNU/Makefile.am --- ppl-1.1/interfaces/Prolog/GNU/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Prolog/GNU/Makefile.in ppl-1.2/interfaces/Prolog/GNU/Makefile.in --- ppl-1.1/interfaces/Prolog/GNU/Makefile.in 2013-10-28 12:44:53.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -109,6 +109,7 @@ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -128,7 +129,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Prolog/GNU/ppl_interface_generator_gprolog_pl.m4 ppl-1.2/interfaces/Prolog/GNU/ppl_interface_generator_gprolog_pl.m4 --- ppl-1.1/interfaces/Prolog/GNU/ppl_interface_generator_gprolog_pl.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/ppl_interface_generator_gprolog_pl.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ dnl This m4 file generates the file ppl_gprolog.pl. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/GNU/ppl_prolog_sysdep.hh ppl-1.2/interfaces/Prolog/GNU/ppl_prolog_sysdep.hh --- ppl-1.1/interfaces/Prolog/GNU/ppl_prolog_sysdep.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/ppl_prolog_sysdep.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* System-dependent part of the Prolog interfaces: stub for GNU Prolog. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/GNU/README.gprolog ppl-1.2/interfaces/Prolog/GNU/README.gprolog --- ppl-1.1/interfaces/Prolog/GNU/README.gprolog 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/GNU/README.gprolog 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/interfaces/Prolog/Makefile.am ppl-1.2/interfaces/Prolog/Makefile.am --- ppl-1.1/interfaces/Prolog/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Prolog/Makefile.in ppl-1.2/interfaces/Prolog/Makefile.in --- ppl-1.1/interfaces/Prolog/Makefile.in 2013-10-28 12:44:53.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Makefile.in 2016-02-11 12:31:42.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -106,6 +106,7 @@ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -125,7 +126,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4 ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4 --- ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -6,7 +6,7 @@ in ppl_interface instantiations.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl @@ -222,7 +222,7 @@ PPL_CHECK(ph); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); const @!CLASS_REPRESENT@_System& gs = ph->@CLASS_REPRESENT@s(); for (@!CLASS_REPRESENT@_System::const_iterator i = gs.begin(), gs_end = gs.end(); i != gs_end; ++i) @@ -247,7 +247,7 @@ PPL_CHECK(ph); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); const @!CLASS_REPRESENT@_System& gs = ph->minimized_@CLASS_REPRESENT@s(); for (@!CLASS_REPRESENT@_System::const_iterator i = gs.begin(), gs_end = gs.end(); i != gs_end; ++i) @@ -606,7 +606,7 @@ Poly_Con_Relation r = ph->relation_with(build_constraint(t_c, where)); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); while (r != Poly_Con_Relation::nothing()) { if (r.implies(Poly_Con_Relation::is_disjoint())) { Prolog_term_ref t_dis = Prolog_new_term_ref(); @@ -639,7 +639,7 @@ Poly_Con_Relation r = ph->relation_with(build_congruence(t_c, where)); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); while (r != Poly_Con_Relation::nothing()) { if (r.implies(Poly_Con_Relation::is_disjoint())) { Prolog_term_ref t_dis = Prolog_new_term_ref(); @@ -674,7 +674,7 @@ Poly_Gen_Relation r = ph->relation_with(build_generator(t_c, where)); Prolog_term_ref tail = Prolog_new_term_ref(); -Prolog_put_atom(tail, a_nil); +Prolog_put_nil(tail); while (r != Poly_Gen_Relation::nothing()) { if (r.implies(Poly_Gen_Relation::subsumes())) { Prolog_term_ref t_sub = Prolog_new_term_ref(); @@ -689,7 +689,7 @@ Poly_Gen_Relation r = ph->relation_with(build_grid_generator(t_c, where)); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); while (r != Poly_Gen_Relation::nothing()) { if (r.implies(Poly_Gen_Relation::subsumes())) { Prolog_term_ref t_sub = Prolog_new_term_ref(); diff -Nru ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_cc_files.m4 ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_cc_files.m4 --- ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_cc_files.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_cc_files.m4 2016-02-11 12:31:26.000000000 +0000 @@ -7,7 +7,7 @@ dnl ppl_interface_generator_prolog_cc_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl @@ -46,6 +46,7 @@ m4_include(`ppl_interface_generator_copyright')`'dnl */ +`#'include "ppl_prolog_`'m4_current_interface.hh" #include "ppl_prolog_sysdep.hh" #include "ppl_prolog_common_defs.hh" diff -Nru ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_dox_code.m4 ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_dox_code.m4 --- ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_dox_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_dox_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -3,7 +3,7 @@ dnl This m4 file contains the program code for generating Prolog_interface.dox dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_dox.m4 ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_dox.m4 --- ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_dox.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_dox.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ dnl This m4 file generates the file Prolog_configured_domains.dox dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_hh_code.m4 ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_hh_code.m4 --- ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_hh_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_hh_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -6,7 +6,7 @@ dnl in ppl_interface instantiations.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_hh_files.m4 ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_hh_files.m4 --- ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_hh_files.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_hh_files.m4 2016-02-11 12:31:26.000000000 +0000 @@ -7,7 +7,7 @@ dnl ppl_interface_generator_prolog_hh_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl @@ -56,6 +56,8 @@ m4_include(`ppl_interface_generator_copyright')`'dnl */ +`#'include "ppl_prolog_common_defs.hh"`'dnl + m4_undefine(`m4_current_interface')`'dnl ') diff -Nru ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_procedure_generators.m4 ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_procedure_generators.m4 --- ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_procedure_generators.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_procedure_generators.m4 2016-02-11 12:31:26.000000000 +0000 @@ -7,7 +7,7 @@ dnl - the list of library predicates needed for the system dependent files. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_systems.m4 ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_systems.m4 --- ppl-1.1/interfaces/Prolog/ppl_interface_generator_prolog_systems.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_interface_generator_prolog_systems.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl the Prolog system-dependent code files. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/ppl_prolog_common.cc ppl-1.2/interfaces/Prolog/ppl_prolog_common.cc --- ppl-1.1/interfaces/Prolog/ppl_prolog_common.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_prolog_common.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Common part of the Prolog interfaces: variables and non-inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -57,9 +57,6 @@ // For the out-of-memory exception. Prolog_atom out_of_memory_exception_atom; -// For Prolog lists. -Prolog_atom a_nil; - // For variables. Prolog_atom a_dollar_VAR; @@ -193,8 +190,6 @@ Prolog_atom a_where; const Prolog_Interface_Atom prolog_interface_atoms[] = { - { &a_nil, "[]" }, - { &a_dollar_VAR, "$VAR" }, { &a_plus, "+" }, @@ -436,7 +431,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("max"), expected); Prolog_construct_cons(expected, @@ -458,7 +453,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("polynomial"), expected); Prolog_construct_cons(expected, @@ -482,7 +477,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("pricing"), expected); @@ -501,7 +496,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("pricing_steepest_edge_float"), expected); @@ -527,7 +522,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("cutting_strategy"), expected); @@ -550,7 +545,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("cutting_strategy_first"), expected); @@ -581,7 +576,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("universe"), expected); Prolog_construct_cons(expected, @@ -603,7 +598,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("true"), expected); Prolog_construct_cons(expected, @@ -625,7 +620,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("bits_8"), expected); Prolog_construct_cons(expected, @@ -653,7 +648,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("unsigned"), expected); Prolog_construct_cons(expected, @@ -676,7 +671,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("overflow_wraps"), expected); @@ -703,7 +698,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string("="), expected); Prolog_construct_cons(expected, @@ -731,7 +726,7 @@ Prolog_construct_compound(found, a_found, e.term()); Prolog_term_ref expected = Prolog_new_term_ref(); - Prolog_put_atom(expected, a_nil); + Prolog_put_nil(expected); Prolog_construct_cons(expected, Prolog_atom_term_from_string ("Prolog_list"), expected); @@ -1538,12 +1533,8 @@ void check_nil_terminating(Prolog_term_ref t, const char* where) { - if (Prolog_is_atom(t)) { - Prolog_atom a; - Prolog_get_atom_name(t, &a); - if (a == a_nil) - return; - } + if (Prolog_get_nil(t)) + return; throw not_a_nil_terminated_list(t, where); } @@ -2126,7 +2117,7 @@ PPL_CHECK(mip); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); const Variables_Set& i_vars = mip->integer_space_dimensions(); for (Variables_Set::const_iterator i = i_vars.begin(), @@ -2148,7 +2139,7 @@ PPL_CHECK(mip); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); for (MIP_Problem::const_iterator i = mip->constraints_begin(), i_end = mip->constraints_end(); i != i_end; ++i) Prolog_construct_cons(tail, constraint_term(*i), tail); @@ -2627,7 +2618,7 @@ PPL_CHECK(pip); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); const Variables_Set& params = pip->parameter_space_dimensions(); for (Variables_Set::const_iterator i = params.begin(), @@ -2649,7 +2640,7 @@ PPL_CHECK(pip); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); for (PIP_Problem::const_iterator i = pip->constraints_begin(), i_end = pip->constraints_end(); i != i_end; ++i) Prolog_construct_cons(tail, constraint_term(*i), tail); @@ -2969,7 +2960,7 @@ PPL_CHECK(pip); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); const Constraint_System& ppl_cs = pip->constraints(); for (Constraint_System::const_iterator i = ppl_cs.begin(), ppl_cs_end = ppl_cs.end(); i != ppl_cs_end; ++i) @@ -3034,7 +3025,7 @@ PPL_CHECK(node); Prolog_term_ref tail = Prolog_new_term_ref(); - Prolog_put_atom(tail, a_nil); + Prolog_put_nil(tail); for (PIP_Tree_Node::Artificial_Parameter_Sequence::const_iterator i = node->art_parameter_begin(), arts_end = node->art_parameter_end(); i != arts_end; ++i) diff -Nru ppl-1.1/interfaces/Prolog/ppl_prolog_common_defs.hh ppl-1.2/interfaces/Prolog/ppl_prolog_common_defs.hh --- ppl-1.1/interfaces/Prolog/ppl_prolog_common_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_prolog_common_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Common part of the Prolog interfaces: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -324,9 +324,6 @@ } }; -// For Prolog lists. -extern Prolog_atom a_nil; - // For variables. extern Prolog_atom a_dollar_VAR; diff -Nru ppl-1.1/interfaces/Prolog/ppl_prolog_common_inlines.hh ppl-1.2/interfaces/Prolog/ppl_prolog_common_inlines.hh --- ppl-1.1/interfaces/Prolog/ppl_prolog_common_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/ppl_prolog_common_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Common part of the Prolog interfaces: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Prolog_configured_interface.dox ppl-1.2/interfaces/Prolog/Prolog_configured_interface.dox --- ppl-1.1/interfaces/Prolog/Prolog_configured_interface.dox 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Prolog_configured_interface.dox 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Configuration Dependent Documentation for Prolog. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Prolog_interface_compilation.dox ppl-1.2/interfaces/Prolog/Prolog_interface_compilation.dox --- ppl-1.1/interfaces/Prolog/Prolog_interface_compilation.dox 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Prolog_interface_compilation.dox 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ // Copyright (C) 2001-2010 Roberto Bagnara -// Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +// Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) // // This document describes the Parma Polyhedra Library (PPL). // diff -Nru ppl-1.1/interfaces/Prolog/Prolog_interface.dox ppl-1.2/interfaces/Prolog/Prolog_interface.dox --- ppl-1.1/interfaces/Prolog/Prolog_interface.dox 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Prolog_interface.dox 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Configuration Independent Documentation for Prolog. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Prolog_interface_sysdep.dox ppl-1.2/interfaces/Prolog/Prolog_interface_sysdep.dox --- ppl-1.1/interfaces/Prolog/Prolog_interface_sysdep.dox 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Prolog_interface_sysdep.dox 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* System-Dependent Documentation for Prolog. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Prolog_interface_sysindep_domains.dox ppl-1.2/interfaces/Prolog/Prolog_interface_sysindep_domains.dox --- ppl-1.1/interfaces/Prolog/Prolog_interface_sysindep_domains.dox 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Prolog_interface_sysindep_domains.dox 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Configuration Independent Documentation for Prolog. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/Prolog_interface_sysindep.dox ppl-1.2/interfaces/Prolog/Prolog_interface_sysindep.dox --- ppl-1.1/interfaces/Prolog/Prolog_interface_sysindep.dox 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/Prolog_interface_sysindep.dox 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Configuration Independent Documentation for Prolog. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SICStus/Makefile.am ppl-1.2/interfaces/Prolog/SICStus/Makefile.am --- ppl-1.1/interfaces/Prolog/SICStus/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Prolog/SICStus/Makefile.in ppl-1.2/interfaces/Prolog/SICStus/Makefile.in --- ppl-1.1/interfaces/Prolog/SICStus/Makefile.in 2013-10-28 12:44:53.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/Makefile.in 2016-02-11 12:31:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -109,6 +109,7 @@ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -128,7 +129,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Prolog/SICStus/ppl_interface_generator_sicstus_sd_cc.m4 ppl-1.2/interfaces/Prolog/SICStus/ppl_interface_generator_sicstus_sd_cc.m4 --- ppl-1.1/interfaces/Prolog/SICStus/ppl_interface_generator_sicstus_sd_cc.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/ppl_interface_generator_sicstus_sd_cc.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ dnl This m4 file generates the file ppl_sicstus_sd.cc. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/SICStus/ppl_prolog_sysdep.hh ppl-1.2/interfaces/Prolog/SICStus/ppl_prolog_sysdep.hh --- ppl-1.1/interfaces/Prolog/SICStus/ppl_prolog_sysdep.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/ppl_prolog_sysdep.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* System-dependent part of the Prolog interfaces: stub for SICStus Prolog. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SICStus/ppl_sicstus.pl ppl-1.2/interfaces/Prolog/SICStus/ppl_sicstus.pl --- ppl-1.1/interfaces/Prolog/SICStus/ppl_sicstus.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/ppl_sicstus.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Loader for the SICStus Prolog interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SICStus/sicstus_cfli.cc ppl-1.2/interfaces/Prolog/SICStus/sicstus_cfli.cc --- ppl-1.1/interfaces/Prolog/SICStus/sicstus_cfli.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/sicstus_cfli.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* SICStus Prolog Common Foreign Language Interface: implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SICStus/sicstus_cfli.h ppl-1.2/interfaces/Prolog/SICStus/sicstus_cfli.h --- ppl-1.1/interfaces/Prolog/SICStus/sicstus_cfli.h 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/sicstus_cfli.h 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* SICStus Prolog Common Foreign Language Interface: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SICStus/sicstus_cfli.ic ppl-1.2/interfaces/Prolog/SICStus/sicstus_cfli.ic --- ppl-1.1/interfaces/Prolog/SICStus/sicstus_cfli.ic 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/sicstus_cfli.ic 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* SICStus Common Foreign Language Interface: definitions. -*- C -*- Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SICStus/sicstus_efli.cc ppl-1.2/interfaces/Prolog/SICStus/sicstus_efli.cc --- ppl-1.1/interfaces/Prolog/SICStus/sicstus_efli.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/sicstus_efli.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* SICStus Prolog extended foreign language interface: definitions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SICStus/sicstus_efli.hh ppl-1.2/interfaces/Prolog/SICStus/sicstus_efli.hh --- ppl-1.1/interfaces/Prolog/SICStus/sicstus_efli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/sicstus_efli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* SICStus Prolog extended foreign language interface: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SICStus/sp_clpq.pl ppl-1.2/interfaces/Prolog/SICStus/sp_clpq.pl --- ppl-1.1/interfaces/Prolog/SICStus/sp_clpq.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/sp_clpq.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Main program for the toy PPL/SICStus-Prolog CLP(Q) interpreter. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SICStus/sp_pl_check.pl ppl-1.2/interfaces/Prolog/SICStus/sp_pl_check.pl --- ppl-1.1/interfaces/Prolog/SICStus/sp_pl_check.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/sp_pl_check.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Main program for the toy PPL/SICStus-Prolog CLP(Q) predicate checker. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SICStus/sp_prolog_generated_test.pl ppl-1.2/interfaces/Prolog/SICStus/sp_prolog_generated_test.pl --- ppl-1.1/interfaces/Prolog/SICStus/sp_prolog_generated_test.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SICStus/sp_prolog_generated_test.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Main program for the PPL/SICStus-Prolog generated tests. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SWI/Makefile.am ppl-1.2/interfaces/Prolog/SWI/Makefile.am --- ppl-1.1/interfaces/Prolog/SWI/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -74,6 +74,7 @@ libppl_swiprolog_la_SOURCES = \ ppl_prolog_sysdep.hh \ +ppl_swiprolog.hh \ swi_efli.hh \ swi_efli.cc diff -Nru ppl-1.1/interfaces/Prolog/SWI/Makefile.in ppl-1.2/interfaces/Prolog/SWI/Makefile.in --- ppl-1.1/interfaces/Prolog/SWI/Makefile.in 2013-10-28 12:44:53.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/Makefile.in 2016-02-11 12:31:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -110,6 +110,7 @@ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -129,7 +130,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ @@ -509,6 +511,7 @@ pkglib_LTLIBRARIES = libppl_swiprolog.la libppl_swiprolog_la_SOURCES = \ ppl_prolog_sysdep.hh \ +ppl_swiprolog.hh \ swi_efli.hh \ swi_efli.cc diff -Nru ppl-1.1/interfaces/Prolog/SWI/pl_clpq.cc ppl-1.2/interfaces/Prolog/SWI/pl_clpq.cc --- ppl-1.1/interfaces/Prolog/SWI/pl_clpq.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/pl_clpq.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* C++ main program for the toy PPL/SWI-Prolog CLP(Q) interpreter. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -21,10 +21,8 @@ For the most up-to-date information see the Parma Polyhedra Library site: http://bugseng.com/products/ppl/ . */ -#include - -extern "C" install_t install(); -extern "C" install_t uninstall(); +#include "ppl_swiprolog.hh" +#include "swi_cfli.hh" int main(int, char** argv) { @@ -39,10 +37,10 @@ if (!PL_initialise(1, pl_args)) PL_halt(1); - install(); + install_libppl_swiprolog(); predicate_t pred = PL_predicate("main", 0, "user"); term_t h0 = PL_new_term_refs(0); int ret_val = PL_call_predicate(0, PL_Q_NORMAL, pred, h0); - uninstall(); + uninstall_libppl_swiprolog(); PL_halt(ret_val ? 0 : 1); } diff -Nru ppl-1.1/interfaces/Prolog/SWI/pl_clpq.pl ppl-1.2/interfaces/Prolog/SWI/pl_clpq.pl --- ppl-1.1/interfaces/Prolog/SWI/pl_clpq.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/pl_clpq.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the toy PPL/SWI-Prolog CLP(Q) interpreter. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -21,7 +21,8 @@ For the most up-to-date information see the Parma Polyhedra Library site: http://bugseng.com/products/ppl/ . */ -eat_eol. +eat_eol :- + get_code(user_input, _EOL). main :- % FIXME: clearing the prompt as it is done here is a temporary workaround. diff -Nru ppl-1.1/interfaces/Prolog/SWI/ppl_interface_generator_swiprolog_cc.m4 ppl-1.2/interfaces/Prolog/SWI/ppl_interface_generator_swiprolog_cc.m4 --- ppl-1.1/interfaces/Prolog/SWI/ppl_interface_generator_swiprolog_cc.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/ppl_interface_generator_swiprolog_cc.m4 2016-02-11 12:31:26.000000000 +0000 @@ -3,7 +3,7 @@ dnl This m4 file generates the file ppl_swiprolog.cc. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl @@ -32,8 +32,10 @@ */ #include "../ppl_prolog_domains.hh" +#include "ppl_swiprolog.hh" -#define PL_EXTENSION_ENTRY(name, arity) { #name, arity, (void*) name, 0 }, +#define PL_EXTENSION_ENTRY(name, arity) \ + { #name, arity, reinterpret_cast(name), 0 }, namespace { @@ -45,13 +47,13 @@ } // namespace extern "C" install_t -install() { +install_libppl_swiprolog() { ppl_initialize(); PL_register_extensions(predicates); } extern "C" install_t -uninstall() { +uninstall_libppl_swiprolog() { ppl_finalize(); } m4_divert(-1) diff -Nru ppl-1.1/interfaces/Prolog/SWI/ppl_pl.cc ppl-1.2/interfaces/Prolog/SWI/ppl_pl.cc --- ppl-1.1/interfaces/Prolog/SWI/ppl_pl.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/ppl_pl.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Main program for SWI-Prolog with the PPL statically linked. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -21,10 +21,8 @@ For the most up-to-date information see the Parma Polyhedra Library site: http://bugseng.com/products/ppl/ . */ -#include - -extern "C" install_t install(); -extern "C" install_t uninstall(); +#include "ppl_swiprolog.hh" +#include "swi_cfli.hh" int main(int argc, char **argv) { @@ -37,8 +35,8 @@ PL_halt(1); PL_install_readline(); - install(); + install_libppl_swiprolog(); int ret_val = PL_toplevel(); - uninstall(); + uninstall_libppl_swiprolog(); PL_halt(ret_val ? 0 : 1); } diff -Nru ppl-1.1/interfaces/Prolog/SWI/ppl_prolog_sysdep.hh ppl-1.2/interfaces/Prolog/SWI/ppl_prolog_sysdep.hh --- ppl-1.1/interfaces/Prolog/SWI/ppl_prolog_sysdep.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/ppl_prolog_sysdep.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* System-dependent part of the Prolog interfaces: stub for SWI Prolog. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SWI/ppl_swiprolog.hh ppl-1.2/interfaces/Prolog/SWI/ppl_swiprolog.hh --- ppl-1.1/interfaces/Prolog/SWI/ppl_swiprolog.hh 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/ppl_swiprolog.hh 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,22 @@ +/* Copyright (C) 2001-2010 Roberto Bagnara + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) + +This file is free software; as a special exception the author gives +unlimited permission to copy and/or distribute it, with or without +modifications, as long as this notice is preserved. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. */ + +#ifndef PPL_ppl_swiprolog_hh +#define PPL_ppl_swiprolog_hh 1 + +#include "swi_cfli.hh" + +extern "C" install_t install_libppl_swiprolog(); + +extern "C" install_t uninstall_libppl_swiprolog(); + +#endif // !defined(PPL_ppl_swiprolog_hh) diff -Nru ppl-1.1/interfaces/Prolog/SWI/ppl_swiprolog.pl ppl-1.2/interfaces/Prolog/SWI/ppl_swiprolog.pl --- ppl-1.1/interfaces/Prolog/SWI/ppl_swiprolog.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/ppl_swiprolog.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Loader for the SWI-Prolog interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SWI/README.swiprolog ppl-1.2/interfaces/Prolog/SWI/README.swiprolog --- ppl-1.1/interfaces/Prolog/SWI/README.swiprolog 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/README.swiprolog 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/interfaces/Prolog/SWI/swi_cfli.hh ppl-1.2/interfaces/Prolog/SWI/swi_cfli.hh --- ppl-1.1/interfaces/Prolog/SWI/swi_cfli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/swi_cfli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* SWI-Prolog Common Foreign Language Interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -145,6 +145,16 @@ } /*! + Assign to \p t the list terminator [] (which needs not + be an atom). +*/ +inline int +Prolog_put_nil(Prolog_term_ref t) { + PL_put_nil(t); + return 1; +} + +/*! Assign to \p t a term representing the address contained in \p p. */ inline int @@ -294,7 +304,7 @@ */ inline int Prolog_is_cons(Prolog_term_ref t) { - return (!PL_is_atom(t) && PL_is_list(t)) ? 1 : 0; + return PL_is_pair(t); } /*! @@ -354,6 +364,15 @@ } /*! + Succeeds if and only if \p t represents the list terminator [] + (which needs not be an atom). +*/ +inline int +Prolog_get_nil(Prolog_term_ref t) { + return PL_get_nil(t); +} + +/*! If \p c is a Prolog cons (list constructor), assign its head and tail to \p h and \p t, respectively. The behavior is undefined if \p c is not a Prolog cons. diff -Nru ppl-1.1/interfaces/Prolog/SWI/swi_efli.cc ppl-1.2/interfaces/Prolog/SWI/swi_efli.cc --- ppl-1.1/interfaces/Prolog/SWI/swi_efli.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/swi_efli.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* SWI-Prolog extended foreign language interface: definitions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SWI/swi_efli.hh ppl-1.2/interfaces/Prolog/SWI/swi_efli.hh --- ppl-1.1/interfaces/Prolog/SWI/swi_efli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/swi_efli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* SWI-Prolog extended foreign language interface: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SWI/swi_pl_check.pl ppl-1.2/interfaces/Prolog/SWI/swi_pl_check.pl --- ppl-1.1/interfaces/Prolog/SWI/swi_pl_check.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/swi_pl_check.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Main program for the PPL/SWI-Prolog checker. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/SWI/swi_prolog_generated_test.pl ppl-1.2/interfaces/Prolog/SWI/swi_prolog_generated_test.pl --- ppl-1.1/interfaces/Prolog/SWI/swi_prolog_generated_test.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/SWI/swi_prolog_generated_test.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Main program for the PPL/SWI-Prolog generated tests. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/tests/clpq2.pl ppl-1.2/interfaces/Prolog/tests/clpq2.pl --- ppl-1.1/interfaces/Prolog/tests/clpq2.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/clpq2.pl 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ % for testing the Parma Polyhedra Library and its Prolog interface. % % Copyright (C) 2001-2010 Roberto Bagnara -% Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +% Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) % % This file is part of the Parma Polyhedra Library (PPL). % @@ -1112,7 +1112,7 @@ common_main :- write('\ Copyright (C) 2001-2010 Roberto Bagnara \n\ -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com)\n\ +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)\n\ this program is free software, covered by the GNU General Public License,\n\ and you are welcome to change it and/or distribute copies of it\n\ under certain conditions.\n\ diff -Nru ppl-1.1/interfaces/Prolog/tests/clpq.pl ppl-1.2/interfaces/Prolog/tests/clpq.pl --- ppl-1.1/interfaces/Prolog/tests/clpq.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/clpq.pl 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ % for testing the Parma Polyhedra Library and its Prolog interface. % % Copyright (C) 2001-2010 Roberto Bagnara -% Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +% Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) % % This file is part of the Parma Polyhedra Library (PPL). % @@ -795,7 +795,7 @@ common_main :- write('\ Copyright (C) 2001-2010 Roberto Bagnara \n\ -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com)\n\ +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)\n\ this program is free software, covered by the GNU General Public License,\n\ and you are welcome to change it and/or distribute copies of it\n\ under certain conditions.\n\ diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int16 ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int16 --- ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int16 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int16 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int16_a ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int16_a --- ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int16_a 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int16_a 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int32 ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int32 --- ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int32 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int32 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int32_a ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int32_a --- ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int32_a 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int32_a 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int64 ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int64 --- ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int64 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int64 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int64_a ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int64_a --- ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int64_a 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int64_a 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int8 ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int8 --- ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int8 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int8 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int8_a ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int8_a --- ppl-1.1/interfaces/Prolog/tests/expected_clpq2_int8_a 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq2_int8_a 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq2_mpz ppl-1.2/interfaces/Prolog/tests/expected_clpq2_mpz --- ppl-1.1/interfaces/Prolog/tests/expected_clpq2_mpz 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq2_mpz 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq2_mpz_a ppl-1.2/interfaces/Prolog/tests/expected_clpq2_mpz_a --- ppl-1.1/interfaces/Prolog/tests/expected_clpq2_mpz_a 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq2_mpz_a 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq_int16 ppl-1.2/interfaces/Prolog/tests/expected_clpq_int16 --- ppl-1.1/interfaces/Prolog/tests/expected_clpq_int16 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq_int16 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq_int16_a ppl-1.2/interfaces/Prolog/tests/expected_clpq_int16_a --- ppl-1.1/interfaces/Prolog/tests/expected_clpq_int16_a 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq_int16_a 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq_int32 ppl-1.2/interfaces/Prolog/tests/expected_clpq_int32 --- ppl-1.1/interfaces/Prolog/tests/expected_clpq_int32 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq_int32 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq_int32_a ppl-1.2/interfaces/Prolog/tests/expected_clpq_int32_a --- ppl-1.1/interfaces/Prolog/tests/expected_clpq_int32_a 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq_int32_a 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq_int64 ppl-1.2/interfaces/Prolog/tests/expected_clpq_int64 --- ppl-1.1/interfaces/Prolog/tests/expected_clpq_int64 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq_int64 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq_int64_a ppl-1.2/interfaces/Prolog/tests/expected_clpq_int64_a --- ppl-1.1/interfaces/Prolog/tests/expected_clpq_int64_a 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq_int64_a 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq_int8 ppl-1.2/interfaces/Prolog/tests/expected_clpq_int8 --- ppl-1.1/interfaces/Prolog/tests/expected_clpq_int8 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq_int8 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq_int8_a ppl-1.2/interfaces/Prolog/tests/expected_clpq_int8_a --- ppl-1.1/interfaces/Prolog/tests/expected_clpq_int8_a 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq_int8_a 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq_mpz ppl-1.2/interfaces/Prolog/tests/expected_clpq_mpz --- ppl-1.1/interfaces/Prolog/tests/expected_clpq_mpz 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq_mpz 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/expected_clpq_mpz_a ppl-1.2/interfaces/Prolog/tests/expected_clpq_mpz_a --- ppl-1.1/interfaces/Prolog/tests/expected_clpq_mpz_a 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/expected_clpq_mpz_a 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) this program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. diff -Nru ppl-1.1/interfaces/Prolog/tests/Makefile.am ppl-1.2/interfaces/Prolog/tests/Makefile.am --- ppl-1.1/interfaces/Prolog/tests/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Prolog/tests/Makefile.in ppl-1.2/interfaces/Prolog/tests/Makefile.in --- ppl-1.1/interfaces/Prolog/tests/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/Makefile.in 2016-02-11 12:31:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -105,6 +105,7 @@ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -124,7 +125,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Prolog/tests/pl_check.pl ppl-1.2/interfaces/Prolog/tests/pl_check.pl --- ppl-1.1/interfaces/Prolog/tests/pl_check.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/pl_check.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Various tests on the Prolog interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl_code.m4 ppl-1.2/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl_code.m4 --- ppl-1.1/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl_code.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl_code.m4 2016-02-11 12:31:26.000000000 +0000 @@ -6,7 +6,7 @@ dnl and the main file ppl_prolog_generated_test_main.pl. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl @@ -947,7 +947,7 @@ F_N == F_Nexptd, F_D == F_Dexptd, V_N == V_Nexptd, V_D == V_Dexptd) ; - \+ ppl_@CLASS@_frequency(PS, LE, F_N, F_D, V_N, V_D) + \+ ppl_@CLASS@_frequency(PS, LE, _F_N, _F_D, _V_N, _V_D) ), ppl_@CLASS@_OK(PS), ppl_delete_@CLASS@(PS) diff -Nru ppl-1.1/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl.m4 ppl-1.2/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl.m4 --- ppl-1.1/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/ppl_interface_generator_prolog_generated_test_pl.m4 2016-02-11 12:31:26.000000000 +0000 @@ -6,7 +6,7 @@ dnl ppl_interface_generator_prolog_generated_test_pl_code.m4. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/tests/ppl_prolog_generated_test_common.pl ppl-1.2/interfaces/Prolog/tests/ppl_prolog_generated_test_common.pl --- ppl-1.1/interfaces/Prolog/tests/ppl_prolog_generated_test_common.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/tests/ppl_prolog_generated_test_common.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ % Extra test code for the generated tests for the Prolog interfaces. % Copyright (C) 2001-2010 Roberto Bagnara -% Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +% Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) % % This file is part of the Parma Polyhedra Library (PPL). % diff -Nru ppl-1.1/interfaces/Prolog/XSB/Makefile.am ppl-1.2/interfaces/Prolog/XSB/Makefile.am --- ppl-1.1/interfaces/Prolog/XSB/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Prolog/XSB/Makefile.in ppl-1.2/interfaces/Prolog/XSB/Makefile.in --- ppl-1.1/interfaces/Prolog/XSB/Makefile.in 2013-10-28 12:44:53.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/Makefile.in 2016-02-11 12:31:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -107,6 +107,7 @@ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -126,7 +127,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Prolog/XSB/ppl_interface_generator_xsb_cc.m4 ppl-1.2/interfaces/Prolog/XSB/ppl_interface_generator_xsb_cc.m4 --- ppl-1.1/interfaces/Prolog/XSB/ppl_interface_generator_xsb_cc.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/ppl_interface_generator_xsb_cc.m4 2016-02-11 12:31:26.000000000 +0000 @@ -3,7 +3,7 @@ dnl This m4 file generates the file ppl_xsb.cc. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/XSB/ppl_interface_generator_xsb_hh.m4 ppl-1.2/interfaces/Prolog/XSB/ppl_interface_generator_xsb_hh.m4 --- ppl-1.1/interfaces/Prolog/XSB/ppl_interface_generator_xsb_hh.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/ppl_interface_generator_xsb_hh.m4 2016-02-11 12:31:26.000000000 +0000 @@ -3,7 +3,7 @@ dnl This m4 file generates the file ppl_xsb.cc. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/XSB/ppl_interface_generator_xsb_H.m4 ppl-1.2/interfaces/Prolog/XSB/ppl_interface_generator_xsb_H.m4 --- ppl-1.1/interfaces/Prolog/XSB/ppl_interface_generator_xsb_H.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/ppl_interface_generator_xsb_H.m4 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ dnl This m4 file generates the file ppl_xsb.H. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/XSB/ppl_interface_generator_xsb_prolog_generated_test_P.m4 ppl-1.2/interfaces/Prolog/XSB/ppl_interface_generator_xsb_prolog_generated_test_P.m4 --- ppl-1.1/interfaces/Prolog/XSB/ppl_interface_generator_xsb_prolog_generated_test_P.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/ppl_interface_generator_xsb_prolog_generated_test_P.m4 2016-02-11 12:31:26.000000000 +0000 @@ -5,7 +5,7 @@ dnl the XSB dependent code for xsb_prolog_generated_test.pl. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/XSB/ppl_prolog_sysdep.hh ppl-1.2/interfaces/Prolog/XSB/ppl_prolog_sysdep.hh --- ppl-1.1/interfaces/Prolog/XSB/ppl_prolog_sysdep.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/ppl_prolog_sysdep.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* System-dependent part of the Prolog interfaces: stub for XSB. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/XSB/xsb_cfli.hh ppl-1.2/interfaces/Prolog/XSB/xsb_cfli.hh --- ppl-1.1/interfaces/Prolog/XSB/xsb_cfli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/xsb_cfli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* XSB Prolog Common Foreign Language Interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -93,6 +93,16 @@ } /*! + Assign to \p t the list terminator [] (which needs not + be an atom). +*/ +inline int +Prolog_put_nil(Prolog_term_ref& t) { + assert(is_var(t) == TRUE); + return c2p_nil(t) != FALSE; +} + +/*! Assign to \p t an atom whose name is given by the null-terminated string \p s. */ @@ -325,6 +335,15 @@ } /*! + Succeeds if and only if \p t represents the list terminator [] + (which needs not be an atom). +*/ +inline int +Prolog_get_nil(Prolog_term_ref t) { + return is_nil(t) != FALSE; +} + +/*! If \p c is a Prolog cons (list constructor), assign its head and tail to \p h and \p t, respectively. The behavior is undefined if \p c is not a Prolog cons. diff -Nru ppl-1.1/interfaces/Prolog/XSB/xsb_clpq2.P ppl-1.2/interfaces/Prolog/XSB/xsb_clpq2.P --- ppl-1.1/interfaces/Prolog/XSB/xsb_clpq2.P 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/xsb_clpq2.P 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the toy PPL/XSB-Prolog CLP(Q) interpreter. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/XSB/xsb_clpq.P ppl-1.2/interfaces/Prolog/XSB/xsb_clpq.P --- ppl-1.1/interfaces/Prolog/XSB/xsb_clpq.P 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/xsb_clpq.P 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the toy PPL/XSB-Prolog CLP(Q) interpreter. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/XSB/xsb_efli.cc ppl-1.2/interfaces/Prolog/XSB/xsb_efli.cc --- ppl-1.1/interfaces/Prolog/XSB/xsb_efli.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/xsb_efli.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* XSB extended foreign language interface: definitions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/XSB/xsb_efli.hh ppl-1.2/interfaces/Prolog/XSB/xsb_efli.hh --- ppl-1.1/interfaces/Prolog/XSB/xsb_efli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/xsb_efli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* XSB extended foreign language interface: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/XSB/xsb_pl_check.P ppl-1.2/interfaces/Prolog/XSB/xsb_pl_check.P --- ppl-1.1/interfaces/Prolog/XSB/xsb_pl_check.P 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/XSB/xsb_pl_check.P 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the PPL/XSB-Prolog predicate checker. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/YAP/Makefile.am ppl-1.2/interfaces/Prolog/YAP/Makefile.am --- ppl-1.1/interfaces/Prolog/YAP/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/interfaces/Prolog/YAP/Makefile.in ppl-1.2/interfaces/Prolog/YAP/Makefile.in --- ppl-1.1/interfaces/Prolog/YAP/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/Makefile.in 2016-02-11 12:31:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -107,6 +107,7 @@ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -126,7 +127,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/interfaces/Prolog/YAP/ppl_interface_generator_yap_cc.m4 ppl-1.2/interfaces/Prolog/YAP/ppl_interface_generator_yap_cc.m4 --- ppl-1.1/interfaces/Prolog/YAP/ppl_interface_generator_yap_cc.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/ppl_interface_generator_yap_cc.m4 2016-02-11 12:31:26.000000000 +0000 @@ -3,7 +3,7 @@ dnl This m4 file generates the file ppl_yap.cc. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/interfaces/Prolog/YAP/ppl_prolog_sysdep.hh ppl-1.2/interfaces/Prolog/YAP/ppl_prolog_sysdep.hh --- ppl-1.1/interfaces/Prolog/YAP/ppl_prolog_sysdep.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/ppl_prolog_sysdep.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* System-dependent part of the Prolog interfaces: stub for YAP. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/YAP/ppl_yap.pl ppl-1.2/interfaces/Prolog/YAP/ppl_yap.pl --- ppl-1.1/interfaces/Prolog/YAP/ppl_yap.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/ppl_yap.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Loader for the YAP Prolog interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/YAP/README.yap ppl-1.2/interfaces/Prolog/YAP/README.yap --- ppl-1.1/interfaces/Prolog/YAP/README.yap 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/README.yap 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/interfaces/Prolog/YAP/yap_cfli.hh ppl-1.2/interfaces/Prolog/YAP/yap_cfli.hh --- ppl-1.1/interfaces/Prolog/YAP/yap_cfli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/yap_cfli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* YAP Prolog Common Foreign Language Interface. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -86,6 +86,16 @@ } /*! + Assign to \p t the list terminator [] (which needs not + be an atom). +*/ +inline int +Prolog_put_nil(Prolog_term_ref& t) { + t = YAP_TermNil(); + return 1; +} + +/*! Assign to \p t an atom whose name is given by the null-terminated string \p s. */ @@ -325,6 +335,15 @@ } /*! + Succeeds if and only if \p t represents the list terminator [] + (which needs not be an atom). +*/ +inline int +Prolog_get_nil(Prolog_term_ref t) { + return YAP_IsTermNil(t); +} + +/*! If \p c is a Prolog cons (list constructor), assign its head and tail to \p h and \p t, respectively. The behavior is undefined if \p c is not a Prolog cons. diff -Nru ppl-1.1/interfaces/Prolog/YAP/yap_clpq2.pl ppl-1.2/interfaces/Prolog/YAP/yap_clpq2.pl --- ppl-1.1/interfaces/Prolog/YAP/yap_clpq2.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/yap_clpq2.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the 2nd toy PPL/YAP-Prolog CLP(Q) interpreter. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/YAP/yap_clpq.pl ppl-1.2/interfaces/Prolog/YAP/yap_clpq.pl --- ppl-1.1/interfaces/Prolog/YAP/yap_clpq.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/yap_clpq.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the toy PPL/YAP-Prolog CLP(Q) interpreter. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/YAP/yap_efli.cc ppl-1.2/interfaces/Prolog/YAP/yap_efli.cc --- ppl-1.1/interfaces/Prolog/YAP/yap_efli.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/yap_efli.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* YAP extended foreign language interface: definitions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/YAP/yap_efli.hh ppl-1.2/interfaces/Prolog/YAP/yap_efli.hh --- ppl-1.1/interfaces/Prolog/YAP/yap_efli.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/yap_efli.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* YAP extended foreign language interface: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/YAP/yap_pl_check.pl ppl-1.2/interfaces/Prolog/YAP/yap_pl_check.pl --- ppl-1.1/interfaces/Prolog/YAP/yap_pl_check.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/yap_pl_check.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the PPL/YAP-Prolog predicate checker. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/interfaces/Prolog/YAP/yap_prolog_generated_test.pl ppl-1.2/interfaces/Prolog/YAP/yap_prolog_generated_test.pl --- ppl-1.1/interfaces/Prolog/YAP/yap_prolog_generated_test.pl 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/interfaces/Prolog/YAP/yap_prolog_generated_test.pl 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Prolog main program for the PPL/YAP-Prolog predicate checker. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/m4/ac_check_ciao.m4 ppl-1.2/m4/ac_check_ciao.m4 --- ppl-1.1/m4/ac_check_ciao.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_check_ciao.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to check for the existence and usability of Ciao-Prolog. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_check_cxx11.m4 ppl-1.2/m4/ac_check_cxx11.m4 --- ppl-1.1/m4/ac_check_cxx11.m4 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/m4/ac_check_cxx11.m4 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,54 @@ +dnl A function to check for the existence and usability of GMP. +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) +dnl +dnl This file is part of the Parma Polyhedra Library (PPL). +dnl +dnl The PPL is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the +dnl Free Software Foundation; either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl The PPL is distributed in the hope that it will be useful, but WITHOUT +dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software Foundation, +dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. +dnl +dnl For the most up-to-date information see the Parma Polyhedra Library +dnl site: http://bugseng.com/products/ppl/ . + +AC_DEFUN([AC_CHECK_CXX11], +[ +AC_LANG_PUSH(C++) +AC_MSG_CHECKING([if the C++ compiler supports C++11 features]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +template +struct check final { + static constexpr T value{ __cplusplus }; +}; + +typedef check> right_angle_brackets; + +int a; +decltype(a) b; + +typedef check check_type; +check_type c{}; +check_type&& cr = static_cast(c); + +static_assert(check_type::value == 201103L, "C++11 compiler"); +]])], + AC_MSG_RESULT(yes) + ac_cv_check_cxx11=yes, + AC_MSG_RESULT(no) + ac_cv_check_cx11=no + ) +AC_LANG_POP(C++) +if test "$ac_cv_check_cxx11" = yes; then + AC_DEFINE(HAVE_CXX11,, + [Defined if the C++compiler supports C++11 features.]) +fi +]) diff -Nru ppl-1.1/m4/ac_check_fpu_control.m4 ppl-1.2/m4/ac_check_fpu_control.m4 --- ppl-1.1/m4/ac_check_fpu_control.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_check_fpu_control.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to check for the possibility to control the FPU. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_check_gmp.m4 ppl-1.2/m4/ac_check_gmp.m4 --- ppl-1.1/m4/ac_check_gmp.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_check_gmp.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to check for the existence and usability of GMP. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl @@ -81,9 +81,6 @@ CPPFLAGS="$CPPFLAGS $gmp_include_options" ac_save_LIBS="$LIBS" LIBS="$LIBS $gmp_library_options" -eval ac_save_shared_library_path="\$$shared_library_path_env_var" -eval $shared_library_path_env_var=\"$gmp_library_paths:$ac_save_shared_library_path\" -export $shared_library_path_env_var AC_LANG_PUSH(C++) @@ -224,7 +221,6 @@ fi AC_LANG_POP(C++) -eval $shared_library_path_env_var=\"$ac_save_shared_library_path\" LIBS="$ac_save_LIBS" CPPFLAGS="$ac_save_CPPFLAGS" diff -Nru ppl-1.1/m4/ac_check_sicstus_prolog.m4 ppl-1.2/m4/ac_check_sicstus_prolog.m4 --- ppl-1.1/m4/ac_check_sicstus_prolog.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_check_sicstus_prolog.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to check for the existence and usability of SICStus Prolog. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_check_swi_prolog.m4 ppl-1.2/m4/ac_check_swi_prolog.m4 --- ppl-1.1/m4/ac_check_swi_prolog.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_check_swi_prolog.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to check for the existence and usability of SWI-Prolog. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_check_xsb_prolog.m4 ppl-1.2/m4/ac_check_xsb_prolog.m4 --- ppl-1.1/m4/ac_check_xsb_prolog.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_check_xsb_prolog.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to check for the existence and usability of XSB Prolog. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_check_yap.m4 ppl-1.2/m4/ac_check_yap.m4 --- ppl-1.1/m4/ac_check_yap.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_check_yap.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to check for the existence and usability of YAP Prolog. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_cxx_attribute_weak.m4 ppl-1.2/m4/ac_cxx_attribute_weak.m4 --- ppl-1.1/m4/ac_cxx_attribute_weak.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_cxx_attribute_weak.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ dnl A function to check whether the C++ compiler supports the function dnl __attribute__ ((weak)). dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_cxx_double_binary_format.m4 ppl-1.2/m4/ac_cxx_double_binary_format.m4 --- ppl-1.1/m4/ac_cxx_double_binary_format.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_cxx_double_binary_format.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to detect the binary format used by C++ doubles. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_cxx_float_binary_format.m4 ppl-1.2/m4/ac_cxx_float_binary_format.m4 --- ppl-1.1/m4/ac_cxx_float_binary_format.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_cxx_float_binary_format.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to detect the binary format used by C++ floats. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_cxx_ieee_inexact_flag.m4 ppl-1.2/m4/ac_cxx_ieee_inexact_flag.m4 --- ppl-1.1/m4/ac_cxx_ieee_inexact_flag.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_cxx_ieee_inexact_flag.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ dnl A function to check whether the IEEE inexact flag is supported and dnl available to C++ programs. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_cxx_limit_memory.m4 ppl-1.2/m4/ac_cxx_limit_memory.m4 --- ppl-1.1/m4/ac_cxx_limit_memory.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_cxx_limit_memory.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ dnl A function to check whether it is possible to limit the memory dnl available to processes using setrlimit(). dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_cxx_long_double_binary_format.m4 ppl-1.2/m4/ac_cxx_long_double_binary_format.m4 --- ppl-1.1/m4/ac_cxx_long_double_binary_format.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_cxx_long_double_binary_format.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to detect the binary format used by C++ long doubles. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_cxx_plain_char_is_signed.m4 ppl-1.2/m4/ac_cxx_plain_char_is_signed.m4 --- ppl-1.1/m4/ac_cxx_plain_char_is_signed.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_cxx_plain_char_is_signed.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to check whether the plain char type is signed. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_cxx_proper_long_double.m4 ppl-1.2/m4/ac_cxx_proper_long_double.m4 --- ppl-1.1/m4/ac_cxx_proper_long_double.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_cxx_proper_long_double.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ dnl A function to check whether the C++ compiler provides long double dnl numbers that have bigger range or precision than double. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_cxx_zero_length_arrays.m4 ppl-1.2/m4/ac_cxx_zero_length_arrays.m4 --- ppl-1.1/m4/ac_cxx_zero_length_arrays.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_cxx_zero_length_arrays.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to check whether the C++ compiler supports zero-length arrays. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_prog_jar.m4 ppl-1.2/m4/ac_prog_jar.m4 --- ppl-1.1/m4/ac_prog_jar.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_prog_jar.m4 2016-02-11 12:31:26.000000000 +0000 @@ -36,7 +36,7 @@ # # Copyright (C) 2000 Egon Willighagen # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # Copying and distribution of this file, with or without # modification, are permitted in any medium without royalty provided diff -Nru ppl-1.1/m4/ac_prog_javac.m4 ppl-1.2/m4/ac_prog_javac.m4 --- ppl-1.1/m4/ac_prog_javac.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_prog_javac.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to check whether the Java compiler supports enums. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl @@ -98,7 +98,7 @@ # # Copyright (c) 2000 Stephane Bortzmeyer # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as diff -Nru ppl-1.1/m4/ac_prog_javah.m4 ppl-1.2/m4/ac_prog_javah.m4 --- ppl-1.1/m4/ac_prog_javah.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_prog_javah.m4 2016-02-11 12:31:26.000000000 +0000 @@ -18,7 +18,7 @@ # # Copyright (C) 2002 Luc Maisonobe # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # Copying and distribution of this file, with or without # modification, are permitted in any medium without royalty provided diff -Nru ppl-1.1/m4/ac_prog_java.m4 ppl-1.2/m4/ac_prog_java.m4 --- ppl-1.1/m4/ac_prog_java.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_prog_java.m4 2016-02-11 12:31:26.000000000 +0000 @@ -23,7 +23,7 @@ # # Copyright (C) 2000 Stephane Bortzmeyer # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as diff -Nru ppl-1.1/m4/ac_text_md5sum.m4 ppl-1.2/m4/ac_text_md5sum.m4 --- ppl-1.1/m4/ac_text_md5sum.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ac_text_md5sum.m4 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ dnl A function to set the command for computing the MD5 checksum of text files. dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ac_use_libtool.m4 ppl-1.2/m4/ac_use_libtool.m4 --- ppl-1.1/m4/ac_use_libtool.m4 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/m4/ac_use_libtool.m4 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,27 @@ +# Public macros for the TeX Live (TL) tree. +# Copyright (C) 1995-2009 Karl Berry +# Copyright (C) 2009-2012 Peter Breitenlohner +# +# This file is free software; the copyright holders +# give unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# Use libtool for linking. This allows testing properties of libraries +# that can be either (1) uninstalled libtool libraries already built +# when this configure runs, or (2) installed libraries -- libtool or not. + +AC_DEFUN([AC_USE_LIBTOOL], +[## $0: Generate a libtool script for use in configure tests +AC_PROVIDE_IFELSE([LT_INIT], , + [m4_fatal([$0: requires libtool])])[]dnl +LT_OUTPUT +m4_append([AC_LANG(C)], +[ac_link="./libtool --mode=link --tag=CC $ac_link" +])[]dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], +[m4_append([AC_LANG(C++)], +[ac_link="./libtool --mode=link --tag=CXX $ac_link" +])])[]dnl +AC_LANG(_AC_LANG)[]dnl +]) # AC_USE_LIBTOOL diff -Nru ppl-1.1/m4/Makefile.am ppl-1.2/m4/Makefile.am --- ppl-1.1/m4/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -50,6 +50,7 @@ ac_prog_javac.m4 \ ac_prog_javah.m4 \ ac_text_md5sum.m4 \ +ac_use_libtool.m4 \ libtool.m4 \ ltoptions.m4 \ ltsugar.m4 \ diff -Nru ppl-1.1/m4/Makefile.in ppl-1.2/m4/Makefile.in --- ppl-1.1/m4/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/m4/Makefile.in 2016-02-11 12:31:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -106,6 +106,7 @@ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -125,7 +126,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ @@ -409,6 +411,7 @@ ac_prog_javac.m4 \ ac_prog_javah.m4 \ ac_text_md5sum.m4 \ +ac_use_libtool.m4 \ libtool.m4 \ ltoptions.m4 \ ltsugar.m4 \ diff -Nru ppl-1.1/m4/ppl_c.m4 ppl-1.2/m4/ppl_c.m4 --- ppl-1.1/m4/ppl_c.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ppl_c.m4 2016-02-11 12:31:26.000000000 +0000 @@ -3,7 +3,7 @@ dnl the required paths. dnl Copyright (C) 1997 Owen Taylor dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/m4/ppl.m4 ppl-1.2/m4/ppl.m4 --- ppl-1.1/m4/ppl.m4 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/m4/ppl.m4 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ dnl versions of the PPL, defining macros containing the required paths. dnl Copyright (C) 1997 Owen Taylor dnl Copyright (C) 2001-2010 Roberto Bagnara -dnl Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) dnl dnl This file is part of the Parma Polyhedra Library (PPL). dnl diff -Nru ppl-1.1/Makefile.am ppl-1.2/Makefile.am --- ppl-1.1/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/Makefile.in ppl-1.2/Makefile.in --- ppl-1.1/Makefile.in 2013-10-28 12:44:51.000000000 +0000 +++ ppl-1.2/Makefile.in 2016-02-11 12:31:41.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -111,6 +111,7 @@ config.rpath config.sub depcomp install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -130,7 +131,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ @@ -779,9 +781,10 @@ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ diff -Nru ppl-1.1/missing ppl-1.2/missing --- ppl-1.1/missing 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/missing 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. @@ -160,7 +160,7 @@ ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff -Nru ppl-1.1/NEWS ppl-1.2/NEWS --- ppl-1.1/NEWS 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/NEWS 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. @@ -9,6 +9,35 @@ =============================================================== -------------------------------------------------------------------------- +NEWS for version 1.2 (released on February 11, 2016) +-------------------------------------------------------------------------- + +New and Changed Features +======================== + +o Improved the efficiency of the conversion procedure for polyhedra + by adding a quick adjacency check. + +o In the Java language interface, throw an exception when trying + to build a disequality Constraint. + + +Bugfixes +======== + +o Fixed a bug in the implementation of methods + Pointset_Powerset::relation_with(const Constraint&) const; + and + Pointset_Powerset::relation_with(const Congruence&) const; + whereby the computed result for relations strictly_intersects() + and saturates() could have been wrong. + +o Fixed a bug in the implementation of dense rows. + +o Portability improved. + + +-------------------------------------------------------------------------- NEWS for version 1.1 (released on October 28, 2013) -------------------------------------------------------------------------- diff -Nru ppl-1.1/ppl-config.h.in ppl-1.2/ppl-config.h.in --- ppl-1.1/ppl-config.h.in 2013-10-28 12:47:18.000000000 +0000 +++ ppl-1.2/ppl-config.h.in 2016-02-11 12:40:39.000000000 +0000 @@ -26,6 +26,9 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD +/* Defined if the C++compiler supports C++11 features. */ +#undef PPL_HAVE_CXX11 + /* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ #undef PPL_HAVE_DECL_FFS diff -Nru ppl-1.1/ppl-config.sed ppl-1.2/ppl-config.sed --- ppl-1.1/ppl-config.sed 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/ppl-config.sed 2016-02-11 12:31:26.000000000 +0000 @@ -1,3 +1,4 @@ +s/\([^A-Z_]\)HAVE_CXX11/\1PPL_HAVE_CXX11/g s/\([^A-Z_]\)HAVE_DECL_FFS/\1PPL_HAVE_DECL_FFS/g s/\([^A-Z_]\)HAVE_DECL_FMA/\1PPL_HAVE_DECL_FMA/g s/\([^A-Z_]\)HAVE_DECL_FMAF/\1PPL_HAVE_DECL_FMAF/g diff -Nru ppl-1.1/README ppl-1.2/README --- ppl-1.1/README 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/README 2016-02-11 12:31:26.000000000 +0000 @@ -1,12 +1,12 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) See below for the copying conditions. -Parma Polyhedra Library (Release 1.0) +Parma Polyhedra Library (Release 1.2) ===================================== -This is the release 1.0 of the Parma Polyhedra Library: +This is the release 1.2 of the Parma Polyhedra Library: a C++ library for (not necessarily closed) convex polyhedra and other numerical abstractions. @@ -71,10 +71,10 @@ For any additional questions you might have, please do not hesitate to write to ppl-devel@cs.unipr.it. -Here is the contents of the PPL 1.0 source distribution -(41 directories, 1616 files): +Here is the contents of the PPL 1.2 source distribution +(41 directories, 1634 files): -ppl-1.0 +ppl-1.2 |-- BUGS |-- COPYING |-- CREDITS @@ -344,18 +344,18 @@ | |-- libppl.3 | |-- libppl_c.3 | |-- ppl-config.1 -| |-- ppl-user-1.0-html.tar.gz -| |-- ppl-user-1.0.pdf -| |-- ppl-user-1.0.ps.gz -| |-- ppl-user-c-interface-1.0-html.tar.gz -| |-- ppl-user-c-interface-1.0.pdf -| |-- ppl-user-c-interface-1.0.ps.gz -| |-- ppl-user-ocaml-interface-1.0-html.tar.gz -| |-- ppl-user-ocaml-interface-1.0.pdf -| |-- ppl-user-ocaml-interface-1.0.ps.gz -| |-- ppl-user-prolog-interface-1.0-html.tar.gz -| |-- ppl-user-prolog-interface-1.0.pdf -| |-- ppl-user-prolog-interface-1.0.ps.gz +| |-- ppl-user-1.2-html.tar.gz +| |-- ppl-user-1.2.pdf +| |-- ppl-user-1.2.ps.gz +| |-- ppl-user-c-interface-1.2-html.tar.gz +| |-- ppl-user-c-interface-1.2.pdf +| |-- ppl-user-c-interface-1.2.ps.gz +| |-- ppl-user-java-interface-1.2-html.tar.gz +| |-- ppl-user-java-interface-1.2.pdf +| |-- ppl-user-java-interface-1.2.ps.gz +| |-- ppl-user-prolog-interface-1.2-html.tar.gz +| |-- ppl-user-prolog-interface-1.2.pdf +| |-- ppl-user-prolog-interface-1.2.ps.gz | |-- ppl.bib | |-- ppl.sty | |-- ppl_citations.bib @@ -466,12 +466,14 @@ | | | |-- Relation_Symbol.java | | | |-- Timeout_Exception.java | | | |-- Variable.java +| | | |-- Variable_Stringifier.java | | | |-- Variables_Set.java | | | |-- ppl_interface_generator_java_classes_java.m4 | | | `-- ppl_interface_generator_java_classes_java_code.m4 | | |-- ppl_interface_generator_java_procedure_generators.m4 | | `-- tests | | |-- C_Polyhedron_test1.java +| | |-- Custom_Variable_Stringifier.java | | |-- MIP_Problem_test1.java | | |-- Makefile.am | | |-- Makefile.in @@ -481,6 +483,7 @@ | | |-- Parma_Polyhedra_Library_test1.java | | |-- Parma_Polyhedra_Library_test2.java | | |-- Test_Executor.java +| | |-- Variable_Output_test1.java | | |-- ppl_interface_generator_java_test_java.m4 | | |-- ppl_interface_generator_java_test_java_code.m4 | | `-- ppl_java_tests_common @@ -569,6 +572,7 @@ | | | |-- ppl_interface_generator_swiprolog_cc.m4 | | | |-- ppl_pl.cc | | | |-- ppl_prolog_sysdep.hh +| | | |-- ppl_swiprolog.hh | | | |-- ppl_swiprolog.pl | | | |-- swi_cfli.hh | | | |-- swi_efli.cc @@ -677,6 +681,7 @@ | |-- Makefile.in | |-- ac_check_ciao.m4 | |-- ac_check_classpath.m4 +| |-- ac_check_cxx11.m4 | |-- ac_check_fpu_control.m4 | |-- ac_check_gmp.m4 | |-- ac_check_sicstus_prolog.m4 @@ -697,6 +702,7 @@ | |-- ac_prog_javac.m4 | |-- ac_prog_javah.m4 | |-- ac_text_md5sum.m4 +| |-- ac_use_libtool.m4 | |-- libtool.m4 | |-- ltoptions.m4 | |-- ltsugar.m4 @@ -712,7 +718,8 @@ |-- ppl-config.sed |-- ppl.lsm.in |-- src -| |-- BDS_Status.idefs.hh +| |-- BDS_Status.cc +| |-- BDS_Status_idefs.hh | |-- BDS_Status_inlines.hh | |-- BD_Shape.cc | |-- BD_Shape_defs.hh @@ -735,12 +742,13 @@ | |-- Bit_Row_types.hh | |-- Boundary_defs.hh | |-- Box.cc +| |-- Box_Status.cc +| |-- Box_Status_idefs.hh +| |-- Box_Status_inlines.hh | |-- Box_defs.hh | |-- Box_inlines.hh | |-- Box_templates.hh | |-- Box_types.hh -| |-- Box_Status.idefs.hh -| |-- Box_Status_inlines.hh | |-- COPYING.cc.dist | |-- COPYING.hh.dist | |-- CO_Tree.cc @@ -767,31 +775,31 @@ | |-- Coefficient.cc | |-- Coefficient_defs.hh | |-- Coefficient_inlines.hh -| |-- Coefficient_types.hh | |-- Coefficient_traits_template.hh +| |-- Coefficient_types.hh | |-- Concrete_Expression.cc | |-- Concrete_Expression_defs.hh | |-- Concrete_Expression_inlines.hh | |-- Concrete_Expression_types.hh | |-- Congruence.cc -| |-- Congruence_defs.hh -| |-- Congruence_inlines.hh -| |-- Congruence_types.hh | |-- Congruence_System.cc | |-- Congruence_System_defs.hh | |-- Congruence_System_inlines.hh | |-- Congruence_System_types.hh +| |-- Congruence_defs.hh +| |-- Congruence_inlines.hh +| |-- Congruence_types.hh | |-- Constant_Floating_Point_Expression_defs.hh | |-- Constant_Floating_Point_Expression_inlines.hh | |-- Constant_Floating_Point_Expression_types.hh | |-- Constraint.cc -| |-- Constraint_defs.hh -| |-- Constraint_inlines.hh -| |-- Constraint_types.hh | |-- Constraint_System.cc | |-- Constraint_System_defs.hh | |-- Constraint_System_inlines.hh | |-- Constraint_System_types.hh +| |-- Constraint_defs.hh +| |-- Constraint_inlines.hh +| |-- Constraint_types.hh | |-- DB_Matrix_defs.hh | |-- DB_Matrix_inlines.hh | |-- DB_Matrix_templates.hh @@ -819,12 +827,15 @@ | |-- Doubly_Linked_Object_defs.hh | |-- Doubly_Linked_Object_inlines.hh | |-- Doubly_Linked_Object_types.hh -| |-- EList_defs.hh -| |-- EList_inlines.hh -| |-- EList_types.hh | |-- EList_Iterator_defs.hh | |-- EList_Iterator_inlines.hh | |-- EList_Iterator_types.hh +| |-- EList_defs.hh +| |-- EList_inlines.hh +| |-- EList_types.hh +| |-- Expression_Adapter_defs.hh +| |-- Expression_Adapter_inlines.hh +| |-- Expression_Adapter_types.hh | |-- Expression_Hide_Inhomo_defs.hh | |-- Expression_Hide_Inhomo_inlines.hh | |-- Expression_Hide_Inhomo_types.hh @@ -843,42 +854,43 @@ | |-- GMP_Integer_inlines.hh | |-- GMP_Integer_types.hh | |-- Generator.cc -| |-- Generator_defs.hh -| |-- Generator_inlines.hh -| |-- Generator_types.hh | |-- Generator_System.cc | |-- Generator_System_defs.hh | |-- Generator_System_inlines.hh | |-- Generator_System_types.hh -| |-- Grid_defs.hh -| |-- Grid_inlines.hh -| |-- Grid_templates.hh -| |-- Grid_types.hh +| |-- Generator_defs.hh +| |-- Generator_inlines.hh +| |-- Generator_types.hh | |-- Grid_Certificate.cc | |-- Grid_Certificate_defs.hh | |-- Grid_Certificate_inlines.hh | |-- Grid_Certificate_types.hh | |-- Grid_Generator.cc -| |-- Grid_Generator_defs.hh -| |-- Grid_Generator_inlines.hh -| |-- Grid_Generator_types.hh | |-- Grid_Generator_System.cc | |-- Grid_Generator_System_defs.hh | |-- Grid_Generator_System_inlines.hh | |-- Grid_Generator_System_types.hh +| |-- Grid_Generator_defs.hh +| |-- Grid_Generator_inlines.hh +| |-- Grid_Generator_types.hh | |-- Grid_Status.cc -| |-- Grid_Status.idefs.hh +| |-- Grid_Status_idefs.hh | |-- Grid_Status_inlines.hh | |-- Grid_chdims.cc | |-- Grid_conversion.cc +| |-- Grid_defs.hh +| |-- Grid_inlines.hh | |-- Grid_nonpublic.cc | |-- Grid_public.cc | |-- Grid_simplify.cc +| |-- Grid_templates.hh +| |-- Grid_types.hh | |-- Grid_widenings.cc | |-- H79_Certificate.cc | |-- H79_Certificate_defs.hh | |-- H79_Certificate_inlines.hh | |-- H79_Certificate_types.hh +| |-- Handler.cc | |-- Handler_defs.hh | |-- Handler_inlines.hh | |-- Handler_types.hh @@ -888,17 +900,14 @@ | |-- Init_inlines.hh | |-- Init_types.hh | |-- Integer_Interval.hh +| |-- Interval_Info_defs.hh +| |-- Interval_Info_inlines.hh +| |-- Interval_Info_types.hh | |-- Interval_defs.hh | |-- Interval_inlines.hh | |-- Interval_templates.hh | |-- Interval_types.hh -| |-- Interval_Info_defs.hh -| |-- Interval_Info_inlines.hh -| |-- Interval_Info_types.hh | |-- Linear_Expression.cc -| |-- Linear_Expression_defs.hh -| |-- Linear_Expression_inlines.hh -| |-- Linear_Expression_types.hh | |-- Linear_Expression_Impl.cc | |-- Linear_Expression_Impl_defs.hh | |-- Linear_Expression_Impl_inlines.hh @@ -907,6 +916,9 @@ | |-- Linear_Expression_Interface.cc | |-- Linear_Expression_Interface_defs.hh | |-- Linear_Expression_Interface_types.hh +| |-- Linear_Expression_defs.hh +| |-- Linear_Expression_inlines.hh +| |-- Linear_Expression_types.hh | |-- Linear_Form.cc | |-- Linear_Form_defs.hh | |-- Linear_Form_inlines.hh @@ -945,7 +957,8 @@ | |-- Octagonal_Shape_inlines.hh | |-- Octagonal_Shape_templates.hh | |-- Octagonal_Shape_types.hh -| |-- Og_Status.idefs.hh +| |-- Og_Status.cc +| |-- Og_Status_idefs.hh | |-- Og_Status_inlines.hh | |-- Opposite_Floating_Point_Expression_defs.hh | |-- Opposite_Floating_Point_Expression_inlines.hh @@ -975,7 +988,7 @@ | |-- Pending_List_templates.hh | |-- Pending_List_types.hh | |-- Ph_Status.cc -| |-- Ph_Status.idefs.hh +| |-- Ph_Status_idefs.hh | |-- Ph_Status_inlines.hh | |-- Pointset_Powerset.cc | |-- Pointset_Powerset_defs.hh @@ -990,17 +1003,17 @@ | |-- Poly_Gen_Relation_defs.hh | |-- Poly_Gen_Relation_inlines.hh | |-- Poly_Gen_Relation_types.hh -| |-- Polyhedron_defs.hh -| |-- Polyhedron_inlines.hh -| |-- Polyhedron_templates.hh -| |-- Polyhedron_types.hh | |-- Polyhedron_chdims.cc | |-- Polyhedron_chdims_templates.hh | |-- Polyhedron_conversion_templates.hh +| |-- Polyhedron_defs.hh +| |-- Polyhedron_inlines.hh | |-- Polyhedron_minimize_templates.hh | |-- Polyhedron_nonpublic.cc | |-- Polyhedron_public.cc | |-- Polyhedron_simplify_templates.hh +| |-- Polyhedron_templates.hh +| |-- Polyhedron_types.hh | |-- Polyhedron_widenings.cc | |-- Powerset_defs.hh | |-- Powerset_inlines.hh @@ -1046,12 +1059,12 @@ | |-- Time_types.hh | |-- Topology_types.hh | |-- Variable.cc -| |-- Variable_defs.hh -| |-- Variable_inlines.hh -| |-- Variable_types.hh | |-- Variable_Floating_Point_Expression_defs.hh | |-- Variable_Floating_Point_Expression_inlines.hh | |-- Variable_Floating_Point_Expression_types.hh +| |-- Variable_defs.hh +| |-- Variable_inlines.hh +| |-- Variable_types.hh | |-- Variables_Set.cc | |-- Variables_Set_defs.hh | |-- Variables_Set_inlines.hh @@ -1068,8 +1081,8 @@ | |-- Widening_Function_inlines.hh | |-- Widening_Function_types.hh | |-- algorithms.hh -| |-- assert.cc -| |-- assert.hh +| |-- assertions.cc +| |-- assertions.hh | |-- assign_or_swap.hh | |-- c_streambuf.cc | |-- c_streambuf_defs.hh @@ -1077,9 +1090,9 @@ | |-- c_streambuf_types.hh | |-- checked.cc | |-- checked_defs.hh -| |-- checked_inlines.hh | |-- checked_ext_inlines.hh | |-- checked_float_inlines.hh +| |-- checked_inlines.hh | |-- checked_int_inlines.hh | |-- checked_mpq_inlines.hh | |-- checked_mpz_inlines.hh @@ -1116,6 +1129,7 @@ | |-- ppl-config.cc.in | |-- ppl.hh.dist | |-- ppl_header.hh +| |-- set_GMP_memory_alloc_funcs.cc | |-- stdiobuf.cc | |-- stdiobuf_defs.hh | |-- stdiobuf_inlines.hh @@ -1130,6 +1144,7 @@ | |-- wrap_assign.hh | |-- wrap_string.cc | `-- wrap_string.hh +|-- test-driver |-- tests | |-- BD_Shape | | |-- Makefile.am @@ -1604,6 +1619,7 @@ | | |-- h79widening1.cc | | |-- h79widening2.cc | | |-- hybrid.cc +| | |-- hypercubes.cc | | |-- intersection1.cc | | |-- limitedbhrz03extrapolation1.cc | | |-- limitedh79extrapolation1.cc @@ -1624,6 +1640,7 @@ | | |-- mingenerators2.cc | | |-- nncminimize1.cc | | |-- nncminimize2.cc +| | |-- nncpostimeelapse1.cc | | |-- numberinput1.cc | | |-- onepoint.cc | | |-- permute.cc @@ -1644,6 +1661,7 @@ | | |-- removespacedims1.cc | | |-- removespacedims2.cc | | |-- simplifyusingcontext1.cc +| | |-- simplifyusingcontext2.cc | | |-- smm1.cc | | |-- sparserow1.cc | | |-- termination1.cc @@ -1737,7 +1755,7 @@ -------- Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/README.alpha ppl-1.2/README.alpha --- ppl-1.1/README.alpha 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/README.alpha 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) See below for the copying conditions. @@ -28,7 +28,7 @@ -------- Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/README.arm ppl-1.2/README.arm --- ppl-1.1/README.arm 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/README.arm 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) See below for the copying conditions. @@ -23,7 +23,7 @@ -------- Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/README.configure ppl-1.2/README.configure --- ppl-1.1/README.configure 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/README.configure 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) See below for the copying conditions. @@ -488,7 +488,7 @@ -------- Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/README.solaris ppl-1.2/README.solaris --- ppl-1.1/README.solaris 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/README.solaris 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) See below for the copying conditions. @@ -19,7 +19,7 @@ -------- Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/algorithms.hh ppl-1.2/src/algorithms.hh --- ppl-1.1/src/algorithms.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/algorithms.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* A collection of useful convex polyhedra algorithms: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,6 @@ #include "NNC_Polyhedron_defs.hh" #include "Pointset_Powerset_defs.hh" #include -#include "assert.hh" namespace Parma_Polyhedra_Library { @@ -57,12 +56,14 @@ partition = linear_partition(q, poly_hull); const Pointset_Powerset& s = partition.second; typedef Pointset_Powerset::const_iterator iter; - for (iter i = s.begin(), s_end = s.end(); i != s_end; ++i) + for (iter i = s.begin(), s_end = s.end(); i != s_end; ++i) { // The polyhedral hull is exact if and only if all the elements // of the partition of the polyhedral hull of `p' and `q' with // respect to `q' are included in `p' - if (!nnc_p.contains(i->pointset())) + if (!nnc_p.contains(i->pointset())) { return false; + } + } p = poly_hull; return true; } diff -Nru ppl-1.1/src/assert.cc ppl-1.2/src/assert.cc --- ppl-1.1/src/assert.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/assert.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* Definitions of assert-like functions. - Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) - -This file is part of the Parma Polyhedra Library (PPL). - -The PPL is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 3 of the License, or (at your -option) any later version. - -The PPL is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. - -For the most up-to-date information see the Parma Polyhedra Library -site: http://bugseng.com/products/ppl/ . */ - -#include "ppl-config.h" -#include "assert.hh" -#include -#include - -namespace PPL = Parma_Polyhedra_Library; - -void -PPL::ppl_unreachable() { - abort(); -} - -void -PPL::ppl_unreachable_msg(const char* msg, - const char* file, unsigned int line, - const char* function) { - std::cerr << file << ":" << line << ": " << function - << ": Latent fault detected: " << msg << ".\n"; - abort(); -} - -void -PPL::ppl_assertion_failed(const char* assertion_text, - const char* file, unsigned int line, - const char* function) { - std::cerr << file << ":" << line << ": " << function - << ": Assertion `" << assertion_text << "' failed.\n"; - abort(); -} diff -Nru ppl-1.1/src/assert.hh ppl-1.2/src/assert.hh --- ppl-1.1/src/assert.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/assert.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ -/* Implementation of PPL assert-like macros. - Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) - -This file is part of the Parma Polyhedra Library (PPL). - -The PPL is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 3 of the License, or (at your -option) any later version. - -The PPL is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. - -For the most up-to-date information see the Parma Polyhedra Library -site: http://bugseng.com/products/ppl/ . */ - -#ifndef PPL_assert_hh -#define PPL_assert_hh 1 - -// The PPL_UNREACHABLE_MSG macro flags a program point as unreachable. -// Argument `msg__' is added to output when assertions are turned on. -#if defined(NDEBUG) -#define PPL_UNREACHABLE_MSG(msg__) Parma_Polyhedra_Library::ppl_unreachable() -#else -#define PPL_UNREACHABLE_MSG(msg__) Parma_Polyhedra_Library:: \ - ppl_unreachable_msg(msg__, __FILE__, __LINE__, __func__) -#endif - -// The PPL_UNREACHABLE macro flags a program point as unreachable. -#define PPL_UNREACHABLE PPL_UNREACHABLE_MSG("unreachable") - -// The PPL_ASSERTION_FAILED macro is used to output a message after -// an assertion failure and then cause program termination. -// (It is meant to be used only when assertions are turned on.) -#define PPL_ASSERTION_FAILED(msg__) Parma_Polyhedra_Library:: \ - ppl_assertion_failed(msg__, __FILE__, __LINE__, __func__) - -// Helper macro PPL_ASSERT_IMPL_: do not use it directly. -#if defined(NDEBUG) -#define PPL_ASSERT_IMPL_(cond__) ((void) 0) -#else -#define PPL_STRING_(s) #s -#define PPL_ASSERT_IMPL_(cond__) \ - ((cond__) ? (void) 0 : PPL_ASSERTION_FAILED(PPL_STRING_(cond__))) -#endif - - -// Non zero to detect use of PPL_ASSERT instead of PPL_ASSERT_HEAVY -// Note: flag does not affect code built with NDEBUG defined. -#define PPL_DEBUG_PPL_ASSERT 1 - -// The PPL_ASSERT macro states that Boolean condition cond__ should hold. -// This is meant to replace uses of C assert(). -#if defined(NDEBUG) || (!PPL_DEBUG_PPL_ASSERT) -#define PPL_ASSERT(cond__) PPL_ASSERT_IMPL_(cond__) -#else -// Note: here we have assertions enabled and PPL_DEBUG_PPL_ASSERT is 1. -// Check if the call to PPL_ASSERT should be replaced by PPL_ASSERT_HEAVY -// (i.e., if the former may interfere with computational weights). -#define PPL_ASSERT(cond__) \ - do { \ - typedef Parma_Polyhedra_Library::Weightwatch_Traits W_Traits; \ - W_Traits::Threshold old_weight__ = W_Traits::weight; \ - PPL_ASSERT_IMPL_(cond__); \ - PPL_ASSERT_IMPL_(old_weight__ == W_Traits::weight \ - && ("PPL_ASSERT_HEAVY has to be used here" != 0)); \ - } while (false) -#endif // !defined(NDEBUG) && PPL_DEBUG_PPL_ASSERT - - -// Macro PPL_ASSERT_HEAVY is meant to be used when the evaluation of -// the assertion may change computational weights (via WEIGHT_ADD). -#if defined(NDEBUG) -#define PPL_ASSERT_HEAVY(cond__) PPL_ASSERT_IMPL_(cond__) -#else -#define PPL_ASSERT_HEAVY(cond__) \ - do { \ - Parma_Polyhedra_Library::In_Assert guard; \ - PPL_ASSERT_IMPL_(cond__); \ - } while (false) -#endif // !defined(NDEBUG) - - -// Macro PPL_EXPECT (resp., PPL_EXPECT_HEAVY) should be used rather than -// PPL_ASSERT (resp., PPL_ASSERT_HEAVY) when the condition is assumed to -// hold but it is not under library control (typically, it depends on -// user provided input). -#define PPL_EXPECT(cond__) PPL_ASSERT(cond__) -#define PPL_EXPECT_HEAVY(cond__) PPL_ASSERT_HEAVY(cond__) - - -namespace Parma_Polyhedra_Library { - -#if PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK -#define PPL_WEAK_NORETURN __attribute__((weak, noreturn)) -#else -#define PPL_WEAK_NORETURN __attribute__((noreturn)) -#endif - -#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS -//! Helper function causing program termination by calling \c abort. -#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) -void ppl_unreachable() PPL_WEAK_NORETURN; - -#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS -/*! \brief - Helper function printing message on \c std::cerr and causing program - termination by calling \c abort. -*/ -#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) -void ppl_unreachable_msg(const char* msg, - const char* file, unsigned int line, - const char* function) PPL_WEAK_NORETURN; - -#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS -/*! \brief - Helper function printing an assertion failure message on \c std::cerr - and causing program termination by calling \c abort. -*/ -#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) -void ppl_assertion_failed(const char* assertion_text, - const char* file, unsigned int line, - const char* function) PPL_WEAK_NORETURN; - - -#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS -/*! \brief - Returns \c true if and only if \p x_copy contains \p y_copy. - - \note - This is a helper function for debugging purposes, to be used in assertions. - The two arguments are meant to be passed by value, i.e., copied, - so that their representations will not be affected by the containment check. -*/ -#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) -template -bool copy_contains(T x_copy, T y_copy) { - return x_copy.contains(y_copy); -} - -} // namespace Parma_Polyhedra_Library - -#endif // !defined(PPL_assert_hh) diff -Nru ppl-1.1/src/assertions.cc ppl-1.2/src/assertions.cc --- ppl-1.1/src/assertions.cc 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/src/assertions.cc 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,52 @@ +/* Definitions of assert-like functions. + Copyright (C) 2001-2010 Roberto Bagnara + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) + +This file is part of the Parma Polyhedra Library (PPL). + +The PPL is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The PPL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. + +For the most up-to-date information see the Parma Polyhedra Library +site: http://bugseng.com/products/ppl/ . */ + +#include "ppl-config.h" +#include "assertions.hh" +#include +#include + +namespace PPL = Parma_Polyhedra_Library; + +void +PPL::ppl_unreachable() { + abort(); +} + +void +PPL::ppl_unreachable_msg(const char* msg, + const char* file, unsigned int line, + const char* function) { + std::cerr << file << ":" << line << ": " << function + << ": Latent fault detected: " << msg << ".\n"; + abort(); +} + +void +PPL::ppl_assertion_failed(const char* assertion_text, + const char* file, unsigned int line, + const char* function) { + std::cerr << file << ":" << line << ": " << function + << ": Assertion `" << assertion_text << "' failed.\n"; + abort(); +} diff -Nru ppl-1.1/src/assertions.hh ppl-1.2/src/assertions.hh --- ppl-1.1/src/assertions.hh 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/src/assertions.hh 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,150 @@ +/* Implementation of PPL assert-like macros. + Copyright (C) 2001-2010 Roberto Bagnara + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) + +This file is part of the Parma Polyhedra Library (PPL). + +The PPL is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The PPL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. + +For the most up-to-date information see the Parma Polyhedra Library +site: http://bugseng.com/products/ppl/ . */ + +#ifndef PPL_assert_hh +#define PPL_assert_hh 1 + +// The PPL_UNREACHABLE_MSG macro flags a program point as unreachable. +// Argument `msg__' is added to output when assertions are turned on. +#if defined(NDEBUG) +#define PPL_UNREACHABLE_MSG(msg__) Parma_Polyhedra_Library::ppl_unreachable() +#else +#define PPL_UNREACHABLE_MSG(msg__) Parma_Polyhedra_Library:: \ + ppl_unreachable_msg(msg__, __FILE__, __LINE__, __func__) +#endif + +// The PPL_UNREACHABLE macro flags a program point as unreachable. +#define PPL_UNREACHABLE PPL_UNREACHABLE_MSG("unreachable") + +// The PPL_ASSERTION_FAILED macro is used to output a message after +// an assertion failure and then cause program termination. +// (It is meant to be used only when assertions are turned on.) +#define PPL_ASSERTION_FAILED(msg__) Parma_Polyhedra_Library:: \ + ppl_assertion_failed(msg__, __FILE__, __LINE__, __func__) + +// Helper macro PPL_ASSERT_IMPL_: do not use it directly. +#if defined(NDEBUG) +#define PPL_ASSERT_IMPL_(cond__) ((void) 0) +#else +#define PPL_STRING_(s) #s +#define PPL_ASSERT_IMPL_(cond__) \ + ((cond__) ? (void) 0 : PPL_ASSERTION_FAILED(PPL_STRING_(cond__))) +#endif + + +// Non zero to detect use of PPL_ASSERT instead of PPL_ASSERT_HEAVY +// Note: flag does not affect code built with NDEBUG defined. +#define PPL_DEBUG_PPL_ASSERT 1 + +// The PPL_ASSERT macro states that Boolean condition cond__ should hold. +// This is meant to replace uses of C assert(). +#if defined(NDEBUG) || (!PPL_DEBUG_PPL_ASSERT) +#define PPL_ASSERT(cond__) PPL_ASSERT_IMPL_(cond__) +#else +// Note: here we have assertions enabled and PPL_DEBUG_PPL_ASSERT is 1. +// Check if the call to PPL_ASSERT should be replaced by PPL_ASSERT_HEAVY +// (i.e., if the former may interfere with computational weights). +#define PPL_ASSERT(cond__) \ + do { \ + typedef Parma_Polyhedra_Library::Weightwatch_Traits W_Traits; \ + W_Traits::Threshold old_weight__ = W_Traits::weight; \ + PPL_ASSERT_IMPL_(cond__); \ + PPL_ASSERT_IMPL_(old_weight__ == W_Traits::weight \ + && ("PPL_ASSERT_HEAVY has to be used here" != 0)); \ + } while (false) +#endif // !defined(NDEBUG) && PPL_DEBUG_PPL_ASSERT + + +// Macro PPL_ASSERT_HEAVY is meant to be used when the evaluation of +// the assertion may change computational weights (via WEIGHT_ADD). +#if defined(NDEBUG) +#define PPL_ASSERT_HEAVY(cond__) PPL_ASSERT_IMPL_(cond__) +#else +#define PPL_ASSERT_HEAVY(cond__) \ + do { \ + Parma_Polyhedra_Library::In_Assert guard; \ + PPL_ASSERT_IMPL_(cond__); \ + } while (false) +#endif // !defined(NDEBUG) + + +// Macro PPL_EXPECT (resp., PPL_EXPECT_HEAVY) should be used rather than +// PPL_ASSERT (resp., PPL_ASSERT_HEAVY) when the condition is assumed to +// hold but it is not under library control (typically, it depends on +// user provided input). +#define PPL_EXPECT(cond__) PPL_ASSERT(cond__) +#define PPL_EXPECT_HEAVY(cond__) PPL_ASSERT_HEAVY(cond__) + + +namespace Parma_Polyhedra_Library { + +#if PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK +#define PPL_WEAK_NORETURN __attribute__((weak, noreturn)) +#else +#define PPL_WEAK_NORETURN __attribute__((noreturn)) +#endif + +#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS +//! Helper function causing program termination by calling \c abort. +#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) +void ppl_unreachable() PPL_WEAK_NORETURN; + +#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS +/*! \brief + Helper function printing message on \c std::cerr and causing program + termination by calling \c abort. +*/ +#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) +void ppl_unreachable_msg(const char* msg, + const char* file, unsigned int line, + const char* function) PPL_WEAK_NORETURN; + +#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS +/*! \brief + Helper function printing an assertion failure message on \c std::cerr + and causing program termination by calling \c abort. +*/ +#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) +void ppl_assertion_failed(const char* assertion_text, + const char* file, unsigned int line, + const char* function) PPL_WEAK_NORETURN; + + +#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS +/*! \brief + Returns \c true if and only if \p x_copy contains \p y_copy. + + \note + This is a helper function for debugging purposes, to be used in assertions. + The two arguments are meant to be passed by value, i.e., copied, + so that their representations will not be affected by the containment check. +*/ +#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) +template +bool copy_contains(T x_copy, T y_copy) { + return x_copy.contains(y_copy); +} + +} // namespace Parma_Polyhedra_Library + +#endif // !defined(PPL_assert_hh) diff -Nru ppl-1.1/src/assign_or_swap.hh ppl-1.2/src/assign_or_swap.hh --- ppl-1.1/src/assign_or_swap.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/assign_or_swap.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* The assign_or_swap() utility functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/BD_Shape.cc ppl-1.2/src/BD_Shape.cc --- ppl-1.1/src/BD_Shape.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BD_Shape.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* BD_Shape class implementation: non-inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -40,9 +40,10 @@ PPL_ASSERT(c_num_vars == 0 && c_first_var == 0 && c_second_var == 0); c_first_var = c.expression().first_nonzero(1, space_dim + 1); - if (c_first_var == space_dim + 1) + if (c_first_var == space_dim + 1) { // All the inhomogeneous coefficients are zero. return true; + } ++c_num_vars; @@ -57,21 +58,23 @@ ++c_num_vars; - if (!c.expression().all_zeroes(c_second_var + 1, space_dim + 1)) + if (!c.expression().all_zeroes(c_second_var + 1, space_dim + 1)) { // The constraint `c' is not a bounded difference. return false; + } // Make sure that `c' is indeed a bounded difference, i.e., it is of the // form: // a*x - a*y <=/= b. Coefficient_traits::const_reference c0 = c.expression().get(Variable(c_first_var - 1)); Coefficient_traits::const_reference c1 = c.expression().get(Variable(c_second_var - 1)); - if (sgn(c0) == sgn(c1) || c0 != -c1) + if (sgn(c0) == sgn(c1) || c0 != -c1) { // Constraint `c' is not a bounded difference. return false; + } c_coeff = c1; - + return true; } @@ -87,7 +90,9 @@ PPL_ASSERT(indices.size() == 0); PPL_ASSERT(0 == predecessor[0]); indices.push_back(0); - for (dimension_type i = 1, p_size = predecessor.size(); i != p_size; ++i) - if (i == predecessor[i]) + for (dimension_type i = 1, p_size = predecessor.size(); i != p_size; ++i) { + if (i == predecessor[i]) { indices.push_back(i); + } + } } diff -Nru ppl-1.1/src/BD_Shape_defs.hh ppl-1.2/src/BD_Shape_defs.hh --- ppl-1.1/src/BD_Shape_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BD_Shape_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* BD_Shape class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -1914,20 +1914,23 @@ friend bool operator==(const BD_Shape& x, const BD_Shape& y); template - friend bool Parma_Polyhedra_Library::rectilinear_distance_assign - (Checked_Number& r, - const BD_Shape& x, const BD_Shape& y, const Rounding_Dir dir, - Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::rectilinear_distance_assign(Checked_Number& r, + const BD_Shape& x, const BD_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); template - friend bool Parma_Polyhedra_Library::euclidean_distance_assign - (Checked_Number& r, - const BD_Shape& x, const BD_Shape& y, const Rounding_Dir dir, - Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::euclidean_distance_assign(Checked_Number& r, + const BD_Shape& x, const BD_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); template - friend bool Parma_Polyhedra_Library::l_infinity_distance_assign - (Checked_Number& r, - const BD_Shape& x, const BD_Shape& y, const Rounding_Dir dir, - Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::l_infinity_distance_assign(Checked_Number& r, + const BD_Shape& x, const BD_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); private: template friend class Parma_Polyhedra_Library::BD_Shape; @@ -2227,45 +2230,45 @@ image" that handle the general case: \f$l = ax + c\f$ */ template - void one_variable_affine_form_image - (const dimension_type& var_id, - const Interval& b, - const Interval& w_coeff, - const dimension_type& w_id, - const dimension_type& space_dim); + void + one_variable_affine_form_image(const dimension_type& var_id, + const Interval& b, + const Interval& w_coeff, + const dimension_type& w_id, + const dimension_type& space_dim); /*! \brief Auxiliary function for \ref affine_form_relation "affine form image" that handle the general case: \f$l = ax + by + c\f$ */ template - void two_variables_affine_form_image - (const dimension_type& var_id, - const Linear_Form >& lf, - const dimension_type& space_dim); + void + two_variables_affine_form_image(const dimension_type& var_id, + const Linear_Form >& lf, + const dimension_type& space_dim); /*! \brief Auxiliary function for refine with linear form that handle the general case: \f$l = ax + c\f$ */ template - void left_inhomogeneous_refine - (const dimension_type& right_t, - const dimension_type& right_w_id, - const Linear_Form >& left, - const Linear_Form >& right); + void + left_inhomogeneous_refine(const dimension_type& right_t, + const dimension_type& right_w_id, + const Linear_Form >& left, + const Linear_Form >& right); /*! \brief Auxiliary function for refine with linear form that handle the general case: \f$ax + b = cy + d\f$ */ template - void left_one_var_refine - (const dimension_type& left_w_id, - const dimension_type& right_t, - const dimension_type& right_w_id, - const Linear_Form >& left, - const Linear_Form >& right); + void + left_one_var_refine(const dimension_type& left_w_id, + const dimension_type& right_t, + const dimension_type& right_w_id, + const Linear_Form >& left, + const Linear_Form >& right); /*! \brief Auxiliary function for refine with linear form that handle diff -Nru ppl-1.1/src/BD_Shape_inlines.hh ppl-1.2/src/BD_Shape_inlines.hh --- ppl-1.1/src/BD_Shape_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BD_Shape_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* BD_Shape class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -34,7 +34,7 @@ #include "Temp_defs.hh" #include "meta_programming.hh" #include "wrap_assign.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -115,12 +115,14 @@ BD_Shape::BD_Shape(const dimension_type num_dimensions, const Degenerate_Element kind) : dbm(num_dimensions + 1), status(), redundancy_dbm() { - if (kind == EMPTY) + if (kind == EMPTY) { set_empty(); + } else { - if (num_dimensions > 0) + if (num_dimensions > 0) { // A (non zero-dim) universe BDS is closed. set_shortest_path_closed(); + } } PPL_ASSERT(OK()); } @@ -129,8 +131,9 @@ inline BD_Shape::BD_Shape(const BD_Shape& y, Complexity_Class) : dbm(y.dbm), status(y.status), redundancy_dbm() { - if (y.marked_shortest_path_reduced()) + if (y.marked_shortest_path_reduced()) { redundancy_dbm = y.redundancy_dbm; + } } template @@ -143,10 +146,12 @@ status(), redundancy_dbm() { // TODO: handle flags properly, possibly taking special cases into account. - if (y.marked_empty()) + if (y.marked_empty()) { set_empty(); - else if (y.marked_zero_dim_univ()) + } + else if (y.marked_zero_dim_univ()) { set_zero_dim_univ(); + } } template @@ -159,8 +164,9 @@ inline void BD_Shape::add_constraints(const Constraint_System& cs) { for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) + cs_end = cs.end(); i != cs_end; ++i) { add_constraint(*i); + } } template @@ -173,8 +179,9 @@ inline void BD_Shape::add_congruences(const Congruence_System& cgs) { for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); i != cgs_end; ++i) + cgs_end = cgs.end(); i != cgs_end; ++i) { add_congruence(*i); + } } template @@ -188,24 +195,28 @@ BD_Shape::refine_with_constraint(const Constraint& c) { const dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dimension()) + if (c_space_dim > space_dimension()) { throw_dimension_incompatible("refine_with_constraint(c)", c); + } - if (!marked_empty()) + if (!marked_empty()) { refine_no_check(c); + } } template inline void BD_Shape::refine_with_constraints(const Constraint_System& cs) { // Dimension-compatibility check. - if (cs.space_dimension() > space_dimension()) + if (cs.space_dimension() > space_dimension()) { throw_invalid_argument("refine_with_constraints(cs)", "cs and *this are space-dimension incompatible"); + } for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) + cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) { refine_no_check(*i); + } } template @@ -213,24 +224,28 @@ BD_Shape::refine_with_congruence(const Congruence& cg) { const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dimension()) + if (cg_space_dim > space_dimension()) { throw_dimension_incompatible("refine_with_congruence(cg)", cg); + } - if (!marked_empty()) + if (!marked_empty()) { refine_no_check(cg); + } } template void BD_Shape::refine_with_congruences(const Congruence_System& cgs) { // Dimension-compatibility check. - if (cgs.space_dimension() > space_dimension()) + if (cgs.space_dimension() > space_dimension()) { throw_invalid_argument("refine_with_congruences(cgs)", "cgs and *this are space-dimension incompatible"); + } for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) + cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) { refine_no_check(*i); + } } template @@ -240,8 +255,9 @@ PPL_ASSERT(cg.space_dimension() <= space_dimension()); if (cg.is_proper_congruence()) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { set_empty(); + } // Other proper congruences are just ignored. return; } @@ -268,9 +284,10 @@ inline BD_Shape::BD_Shape(const Constraint_System& cs) : dbm(cs.space_dimension() + 1), status(), redundancy_dbm() { - if (cs.space_dimension() > 0) + if (cs.space_dimension() > 0) { // A (non zero-dim) universe BDS is shortest-path closed. set_shortest_path_closed(); + } add_constraints(cs); } @@ -281,8 +298,9 @@ Complexity_Class) : dbm(box.space_dimension() + 1), status(), redundancy_dbm() { // Check emptiness for maximum precision. - if (box.is_empty()) + if (box.is_empty()) { set_empty(); + } else if (box.space_dimension() > 0) { // A (non zero-dim) universe BDS is shortest-path closed. set_shortest_path_closed(); @@ -295,9 +313,10 @@ BD_Shape::BD_Shape(const Grid& grid, Complexity_Class) : dbm(grid.space_dimension() + 1), status(), redundancy_dbm() { - if (grid.space_dimension() > 0) + if (grid.space_dimension() > 0) { // A (non zero-dim) universe BDS is shortest-path closed. set_shortest_path_closed(); + } // Taking minimized congruences ensures maximum precision. refine_with_congruences(grid.minimized_congruences()); } @@ -309,8 +328,9 @@ Complexity_Class) : dbm(os.space_dimension() + 1), status(), redundancy_dbm() { // Check for emptiness for maximum precision. - if (os.is_empty()) + if (os.is_empty()) { set_empty(); + } else if (os.space_dimension() > 0) { // A (non zero-dim) universe BDS is shortest-path closed. set_shortest_path_closed(); @@ -326,8 +346,9 @@ BD_Shape::operator=(const BD_Shape& y) { dbm = y.dbm; status = y.status; - if (y.marked_shortest_path_reduced()) + if (y.marked_shortest_path_reduced()) { redundancy_dbm = y.redundancy_dbm; + } return *this; } @@ -425,15 +446,18 @@ operator==(const BD_Shape& x, const BD_Shape& y) { const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } // Zero-dim BDSs are equal if and only if they are both empty or universe. if (x_space_dim == 0) { - if (x.marked_empty()) + if (x.marked_empty()) { return y.marked_empty(); - else + } + else { return !y.marked_empty(); + } } // The exact equivalence test requires shortest-path closure. @@ -442,10 +466,12 @@ // If one of two BDSs is empty, then they are equal // if and only if the other BDS is empty too. - if (x.marked_empty()) + if (x.marked_empty()) { return y.marked_empty(); - if (y.marked_empty()) + } + if (y.marked_empty()) { return false; + } // Check for syntactic equivalence of the two (shortest-path closed) // systems of bounded differences. return x.dbm == y.dbm; @@ -470,15 +496,18 @@ Temp& tmp2) { const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } // Zero-dim BDSs are equal if and only if they are both empty or universe. if (x_space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -489,10 +518,12 @@ // If one of two BDSs is empty, then they are equal if and only if // the other BDS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -535,15 +566,18 @@ Temp& tmp2) { const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } // Zero-dim BDSs are equal if and only if they are both empty or universe. if (x_space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -554,10 +588,12 @@ // If one of two BDSs is empty, then they are equal if and only if // the other BDS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -600,15 +636,17 @@ Temp& tmp2) { const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; - + } // Zero-dim BDSs are equal if and only if they are both empty or universe. if (x_space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -619,10 +657,12 @@ // If one of two BDSs is empty, then they are equal if and only if // the other BDS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -663,8 +703,9 @@ N& dbm_ij = dbm[i][j]; if (dbm_ij > k) { dbm_ij = k; - if (marked_shortest_path_closed()) + if (marked_shortest_path_closed()) { reset_shortest_path_closed(); + } } } @@ -686,8 +727,9 @@ inline void BD_Shape::time_elapse_assign(const BD_Shape& y) { // Dimension-compatibility check. - if (space_dimension() != y.space_dimension()) + if (space_dimension() != y.space_dimension()) { throw_dimension_incompatible("time_elapse_assign(y)", y); + } // Compute time-elapse on polyhedra. // TODO: provide a direct implementation. C_Polyhedron ph_x(constraints()); @@ -708,8 +750,9 @@ template inline bool BD_Shape::upper_bound_assign_if_exact(const BD_Shape& y) { - if (space_dimension() != y.space_dimension()) + if (space_dimension() != y.space_dimension()) { throw_dimension_incompatible("upper_bound_assign_if_exact(y)", y); + } #if 0 return BFT00_upper_bound_assign_if_exact(y); #else @@ -724,8 +767,9 @@ PPL_COMPILE_TIME_CHECK(std::numeric_limits::is_integer, "BD_Shape::integer_upper_bound_assign_if_exact(y):" " T in not an integer datatype."); - if (space_dimension() != y.space_dimension()) + if (space_dimension() != y.space_dimension()) { throw_dimension_incompatible("integer_upper_bound_assign_if_exact(y)", y); + } const bool integer_upper_bound = true; return BHZ09_upper_bound_assign_if_exact(y); } @@ -737,9 +781,10 @@ // Dimension-compatibility check: the variable having // maximum index is the one occurring last in the set. const dimension_type space_dim = space_dimension(); - if (new_dimension > space_dim) + if (new_dimension > space_dim) { throw_dimension_incompatible("remove_higher_space_dimensions(nd)", new_dimension); + } // The removal of no dimensions from any BDS is a no-op. // Note that this case also captures the only legal removal of @@ -755,13 +800,15 @@ // Shortest-path closure is maintained. // TODO: see whether or not reduction can be (efficiently!) maintained too. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } // If we removed _all_ dimensions from a non-empty BDS, // the zero-dim universe BDS has been obtained. - if (new_dimension == 0 && !marked_empty()) + if (new_dimension == 0 && !marked_empty()) { set_zero_dim_univ(); + } PPL_ASSERT(OK()); } diff -Nru ppl-1.1/src/BD_Shape_templates.hh ppl-1.2/src/BD_Shape_templates.hh --- ppl-1.1/src/BD_Shape_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BD_Shape_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* BD_Shape class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -36,7 +36,7 @@ #include "Variables_Set_defs.hh" #include "Bit_Row_defs.hh" #include "Temp_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -89,11 +89,12 @@ for (dimension_type i = space_dim; i > 0; --i) { const Coefficient& g_i = g.expression().get(Variable(i - 1)); DB_Row& dbm_i = dbm[i]; - for (dimension_type j = space_dim; j > 0; --j) + for (dimension_type j = space_dim; j > 0; --j) { if (i != j) { const Coefficient& g_j = g.expression().get(Variable(j - 1)); div_round_up(dbm_i[j], g_j - g_i, d); } + } div_round_up(dbm_i[0], -g_i, d); } for (dimension_type j = space_dim; j > 0; --j) { @@ -133,11 +134,12 @@ } } - if (!point_seen) + if (!point_seen) { // The generator system is not empty, but contains no points. throw_invalid_argument("BD_Shape(gs)", "the non-empty generator system gs " "contains no points."); + } // Going through all the lines and rays. for (Generator_System::const_iterator gs_i = gs_begin; @@ -151,16 +153,20 @@ const Coefficient& g_i = g.expression().get(Variable(i - 1)); DB_Row& dbm_i = dbm[i]; // The loop correctly handles the case when i == j. - for (dimension_type j = space_dim; j > 0; --j) - if (g_i != g.expression().get(Variable(j - 1))) + for (dimension_type j = space_dim; j > 0; --j) { + if (g_i != g.expression().get(Variable(j - 1))) { assign_r(dbm_i[j], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i != 0) + } + } + if (g_i != 0) { assign_r(dbm_i[0], PLUS_INFINITY, ROUND_NOT_NEEDED); + } } for (Generator::expr_type::const_iterator i = g.expression().begin(), - i_end = g.expression().end(); i != i_end; ++i) + i_end = g.expression().end(); i != i_end; ++i) { assign_r(dbm_0[i.variable().space_dimension()], PLUS_INFINITY, ROUND_NOT_NEEDED); + } break; case Generator::RAY: // TODO: Check if the following loop can be optimized used @@ -169,17 +175,22 @@ const Coefficient& g_i = g.expression().get(Variable(i - 1)); DB_Row& dbm_i = dbm[i]; // The loop correctly handles the case when i == j. - for (dimension_type j = space_dim; j > 0; --j) - if (g_i < g.expression().get(Variable(j - 1))) + for (dimension_type j = space_dim; j > 0; --j) { + if (g_i < g.expression().get(Variable(j - 1))) { assign_r(dbm_i[j], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i < 0) + } + } + if (g_i < 0) { assign_r(dbm_i[0], PLUS_INFINITY, ROUND_NOT_NEEDED); + } } for (Generator::expr_type::const_iterator i = g.expression().begin(), - i_end = g.expression().end(); i != i_end; ++i) - if (*i > 0) + i_end = g.expression().end(); i != i_end; ++i) { + if (*i > 0) { assign_r(dbm_0[i.variable().space_dimension()], PLUS_INFINITY, ROUND_NOT_NEEDED); + } + } break; default: // Points and closure points already dealt with. @@ -229,11 +240,12 @@ // See if there is at least one inconsistent constraint in `ph.con_sys'. for (Constraint_System::const_iterator i = ph.con_sys.begin(), - cs_end = ph.con_sys.end(); i != cs_end; ++i) + cs_end = ph.con_sys.end(); i != cs_end; ++i) { if (i->is_inconsistent()) { *this = BD_Shape(num_dimensions, EMPTY); return; } + } // If `complexity' allows it, use simplex to derive the exact (modulo // the fact that our BDSs are topologically closed) variable bounds. @@ -242,9 +254,10 @@ lp.set_optimization_mode(MAXIMIZATION); const Constraint_System& ph_cs = ph.constraints(); - if (!ph_cs.has_strict_inequalities()) + if (!ph_cs.has_strict_inequalities()) { lp.add_constraints(ph_cs); - else + } + else { // Adding to `lp' a topologically closed version of `ph_cs'. for (Constraint_System::const_iterator i = ph_cs.begin(), ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) { @@ -253,9 +266,11 @@ Linear_Expression expr(c.expression()); lp.add_constraint(expr >= 0); } - else + else { lp.add_constraint(c); + } } + } // Check for unsatisfiability. if (!lp.is_satisfiable()) { @@ -280,8 +295,9 @@ } // Evaluate optimal upper bound for `x - y <= ub'. for (dimension_type j = 1; j <= num_dimensions; ++j) { - if (i == j) + if (i == j) { continue; + } Variable y(j-1); lp.set_objective_function(x - y); if (lp.solve() == OPTIMIZED_MIP_PROBLEM) { @@ -314,15 +330,15 @@ BD_Shape::affine_dimension() const { const dimension_type space_dim = space_dimension(); // A zero-space-dim shape always has affine dimension zero. - if (space_dim == 0) + if (space_dim == 0) { return 0; - + } // Shortest-path closure is necessary to detect emptiness // and all (possibly implicit) equalities. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return 0; - + } // The vector `predecessor' is used to represent equivalence classes: // `predecessor[i] == i' if and only if `i' is the leader of its // equivalence class (i.e., the minimum index in the class). @@ -333,10 +349,11 @@ // less the number of equivalence classes. dimension_type affine_dim = 0; // Note: disregard the first equivalence class. - for (dimension_type i = 1; i <= space_dim; ++i) - if (predecessor[i] == i) + for (dimension_type i = 1; i <= space_dim; ++i) { + if (predecessor[i] == i) { ++affine_dim; - + } + } return affine_dim; } @@ -351,8 +368,9 @@ Congruence_System cgs(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cgs = Congruence_System::zero_dim_empty(); + } return cgs; } @@ -395,17 +413,18 @@ void BD_Shape::add_constraint(const Constraint& c) { // Dimension-compatibility check. - if (c.space_dimension() > space_dimension()) + if (c.space_dimension() > space_dimension()) { throw_dimension_incompatible("add_constraint(c)", c); - + } // Get rid of strict inequalities. if (c.is_strict_inequality()) { if (c.is_inconsistent()) { set_empty(); return; } - if (c.is_tautological()) + if (c.is_tautological()) { return; + } // Nontrivial strict inequalities are not allowed. throw_invalid_argument("add_constraint(c)", "strict inequalities are not allowed"); @@ -416,25 +435,26 @@ dimension_type j = 0; PPL_DIRTY_TEMP_COEFFICIENT(coeff); // Constraints that are not bounded differences are not allowed. - if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) + if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) { throw_invalid_argument("add_constraint(c)", "c is not a bounded difference constraint"); - + } const Coefficient& inhomo = c.inhomogeneous_term(); if (num_vars == 0) { // Dealing with a trivial constraint (not a strict inequality). if (inhomo < 0 - || (inhomo != 0 && c.is_equality())) + || (inhomo != 0 && c.is_equality())) { set_empty(); + } return; } // Select the cell to be modified for the "<=" part of the constraint, // and set `coeff' to the absolute value of itself. const bool negative = (coeff < 0); - if (negative) + if (negative) { neg_assign(coeff); - + } bool changed = false; N& x = negative ? dbm[i][j] : dbm[j][i]; // Compute the bound for `x', rounding towards plus infinity. @@ -459,8 +479,9 @@ // In general, adding a constraint does not preserve the shortest-path // closure or reduction of the bounded difference shape. - if (changed && marked_shortest_path_closed()) + if (changed && marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -470,13 +491,14 @@ const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check: // the dimension of `cg' can not be greater than space_dim. - if (space_dimension() < cg_space_dim) + if (space_dimension() < cg_space_dim) { throw_dimension_incompatible("add_congruence(cg)", cg); - + } // Handle the case of proper congruences first. if (cg.is_proper_congruence()) { - if (cg.is_tautological()) + if (cg.is_tautological()) { return; + } if (cg.is_inconsistent()) { set_empty(); return; @@ -502,16 +524,17 @@ dimension_type j = 0; PPL_DIRTY_TEMP_COEFFICIENT(coeff); // Constraints that are not bounded differences are ignored. - if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) + if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) { return; - + } const Coefficient& inhomo = c.inhomogeneous_term(); if (num_vars == 0) { // Dealing with a trivial constraint (might be a strict inequality). if (inhomo < 0 || (c.is_equality() && inhomo != 0) - || (c.is_strict_inequality() && inhomo == 0)) + || (c.is_strict_inequality() && inhomo == 0)) { set_empty(); + } return; } @@ -520,9 +543,9 @@ const bool negative = (coeff < 0); N& x = negative ? dbm[i][j] : dbm[j][i]; N& y = negative ? dbm[j][i] : dbm[i][j]; - if (negative) + if (negative) { neg_assign(coeff); - + } bool changed = false; // Compute the bound for `x', rounding towards plus infinity. PPL_DIRTY_TEMP(N, d); @@ -545,8 +568,9 @@ // In general, adding a constraint does not preserve the shortest-path // closure or reduction of the bounded difference shape. - if (changed && marked_shortest_path_closed()) + if (changed && marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -585,12 +609,14 @@ DB_Row& dbm_i = dbm[i]; dbm_i[0] = y.dbm[i - x_space_dim][0]; dbm[0][i] = y.dbm[0][i - x_space_dim]; - for (dimension_type j = x_space_dim + 1; j <= new_space_dim; ++j) + for (dimension_type j = x_space_dim + 1; j <= new_space_dim; ++j) { dbm_i[j] = y.dbm[i - x_space_dim][j - x_space_dim]; + } } - if (marked_shortest_path_closed()) + if (marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -601,9 +627,9 @@ const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { throw_dimension_incompatible("contains(y)", y); - + } if (x_space_dim == 0) { // The zero-dimensional empty shape only contains another // zero-dimensional empty shape. @@ -636,21 +662,23 @@ */ y.shortest_path_closure_assign(); // An empty shape is contained in any other dimension-compatible shapes. - if (y.marked_empty()) + if (y.marked_empty()) { return true; - + } // If `x' is empty it can not contain `y' (which is not empty). - if (x.is_empty()) + if (x.is_empty()) { return false; - + } // `*this' contains `y' if and only if every cell of `dbm' // is greater than or equal to the correspondent one of `y.dbm'. for (dimension_type i = x_space_dim + 1; i-- > 0; ) { const DB_Row& x_dbm_i = x.dbm[i]; const DB_Row& y_dbm_i = y.dbm[i]; - for (dimension_type j = x_space_dim + 1; j-- > 0; ) - if (x_dbm_i[j] < y_dbm_i[j]) + for (dimension_type j = x_space_dim + 1; j-- > 0; ) { + if (x_dbm_i[j] < y_dbm_i[j]) { return false; + } + } } return true; } @@ -660,18 +688,19 @@ BD_Shape::is_disjoint_from(const BD_Shape& y) const { const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("is_disjoint_from(y)", y); - + } // If one of the two bounded difference shape is empty, // then the two bounded difference shape are disjoint. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return true; + } y.shortest_path_closure_assign(); - if (y.marked_empty()) + if (y.marked_empty()) { return true; - + } // Two BDSs are disjoint when their intersection is empty. // That is if and only if there exists at least a bounded difference // such that the upper bound of the bounded difference in the first @@ -689,8 +718,9 @@ const DB_Row& x_i = dbm[i]; for (dimension_type j = space_dim+1; j-- > 0; ) { neg_assign_r(tmp, y.dbm[j][i], ROUND_UP); - if (x_i[j] < tmp) + if (x_i[j] < tmp) { return true; + } } } @@ -700,22 +730,24 @@ template bool BD_Shape::is_universe() const { - if (marked_empty()) + if (marked_empty()) { return false; - + } const dimension_type space_dim = space_dimension(); // If the BDS is non-empty and zero-dimensional, // then it is necessarily the universe BDS. - if (space_dim == 0) + if (space_dim == 0) { return true; - + } // A bounded difference shape defining the universe BDS can only // contain trivial constraints. for (dimension_type i = space_dim + 1; i-- > 0; ) { const DB_Row& dbm_i = dbm[i]; - for (dimension_type j = space_dim + 1; j-- > 0; ) - if (!is_plus_infinity(dbm_i[j])) + for (dimension_type j = space_dim + 1; j-- > 0; ) { + if (!is_plus_infinity(dbm_i[j])) { return false; + } + } } return true; } @@ -726,17 +758,20 @@ shortest_path_closure_assign(); const dimension_type space_dim = space_dimension(); // A zero-dimensional or empty BDS is bounded. - if (marked_empty() || space_dim == 0) + if (marked_empty() || space_dim == 0) { return true; - + } // A bounded difference shape defining the bounded BDS never can // contain trivial constraints. for (dimension_type i = space_dim + 1; i-- > 0; ) { const DB_Row& dbm_i = dbm[i]; - for (dimension_type j = space_dim + 1; j-- > 0; ) - if (i != j) - if (is_plus_infinity(dbm_i[j])) + for (dimension_type j = space_dim + 1; j-- > 0; ) { + if (i != j) { + if (is_plus_infinity(dbm_i[j])) { return false; + } + } + } } return true; @@ -746,18 +781,18 @@ bool BD_Shape::contains_integer_point() const { // Force shortest-path closure. - if (is_empty()) + if (is_empty()) { return false; - + } const dimension_type space_dim = space_dimension(); - if (space_dim == 0) + if (space_dim == 0) { return true; - + } // A non-empty BD_Shape defined by integer constraints // necessarily contains an integer point. - if (std::numeric_limits::is_integer) + if (std::numeric_limits::is_integer) { return true; - + } // Build an integer BD_Shape z with bounds at least as tight as // those in *this and then recheck for emptiness. BD_Shape bds_z(space_dim); @@ -770,10 +805,12 @@ const DB_Row& dbm_i = dbm[i]; for (dimension_type j = space_dim + 1; j-- > 0; ) { const N& dbm_i_j = dbm_i[j]; - if (is_plus_infinity(dbm_i_j)) + if (is_plus_infinity(dbm_i_j)) { continue; - if (is_integer(dbm_i_j)) + } + if (is_integer(dbm_i_j)) { assign_r(z_i[j], dbm_i_j, ROUND_NOT_NEEDED); + } else { all_integers = false; Z& z_i_j = z_i[j]; @@ -794,9 +831,9 @@ Coefficient& val_n, Coefficient& val_d) const { dimension_type space_dim = space_dimension(); // The dimension of `expr' must be at most the dimension of *this. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("frequency(e, ...)", "e", expr); - + } // Check if `expr' has a constant value. // If it is constant, set the frequency `freq_n' to 0 // and return true. Otherwise the values for \p expr @@ -805,8 +842,9 @@ // Space dimension is 0: if empty, then return false; // otherwise the frequency is 0 and the value is the inhomogeneous term. if (space_dim == 0) { - if (is_empty()) + if (is_empty()) { return false; + } freq_n = 0; freq_d = 1; val_n = expr.inhomogeneous_term(); @@ -816,9 +854,9 @@ shortest_path_closure_assign(); // For an empty BD shape, we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; - + } // The BD shape has at least 1 dimension and is not empty. PPL_DIRTY_TEMP_COEFFICIENT(coeff); PPL_DIRTY_TEMP_COEFFICIENT(numer); @@ -837,9 +875,9 @@ for (dimension_type i = dbm.num_rows(); i-- > 1; ) { const Variable v(i-1); coeff = le.coefficient(v); - if (coeff == 0) + if (coeff == 0) { continue; - + } const DB_Row& dbm_i = dbm[i]; // Check if `v' is constant in the BD shape. assign_r(tmp, dbm_i[0], ROUND_NOT_NEEDED); @@ -877,9 +915,10 @@ break; } } - if (!constant_v) + if (!constant_v) { // The expression `expr' is not constant. return false; + } } } @@ -897,21 +936,22 @@ BD_Shape::constrains(const Variable var) const { // `var' should be one of the dimensions of the BD shape. const dimension_type var_space_dim = var.space_dimension(); - if (space_dimension() < var_space_dim) + if (space_dimension() < var_space_dim) { throw_dimension_incompatible("constrains(v)", "v", var); - + } shortest_path_closure_assign(); // A BD shape known to be empty constrains all variables. // (Note: do not force emptiness check _yet_) - if (marked_empty()) + if (marked_empty()) { return true; - + } // Check whether `var' is syntactically constrained. const DB_Row& dbm_v = dbm[var_space_dim]; for (dimension_type i = dbm.num_rows(); i-- > 0; ) { if (!is_plus_infinity(dbm_v[i]) - || !is_plus_infinity(dbm[i][var_space_dim])) + || !is_plus_infinity(dbm[i][var_space_dim])) { return true; + } } // `var' is not syntactically constrained: @@ -933,20 +973,23 @@ const dimension_type predecessor_size = dbm.num_rows(); // Initially, each variable is leader of its own zero-equivalence class. predecessor.reserve(predecessor_size); - for (dimension_type i = 0; i < predecessor_size; ++i) + for (dimension_type i = 0; i < predecessor_size; ++i) { predecessor.push_back(i); + } // Now compute actual predecessors. - for (dimension_type i = predecessor_size; i-- > 1; ) + for (dimension_type i = predecessor_size; i-- > 1; ) { if (i == predecessor[i]) { const DB_Row& dbm_i = dbm[i]; - for (dimension_type j = i; j-- > 0; ) + for (dimension_type j = i; j-- > 0; ) { if (j == predecessor[j] && is_additive_inverse(dbm[j][i], dbm_i[j])) { // Choose as predecessor the variable having the smaller index. predecessor[i] = j; break; } + } } + } } template @@ -973,44 +1016,47 @@ bool BD_Shape::is_shortest_path_reduced() const { // If the BDS is empty, it is also reduced. - if (marked_empty()) + if (marked_empty()) { return true; - + } const dimension_type space_dim = space_dimension(); // Zero-dimensional BDSs are necessarily reduced. - if (space_dim == 0) + if (space_dim == 0) { return true; - + } // A shortest-path reduced dbm is just a dbm with an indication of // those constraints that are redundant. If there is no indication // of the redundant constraints, then it cannot be reduced. - if (!marked_shortest_path_reduced()) + if (!marked_shortest_path_reduced()) { return false; + } const BD_Shape x_copy = *this; x_copy.shortest_path_closure_assign(); // If we just discovered emptiness, it cannot be reduced. - if (x_copy.marked_empty()) + if (x_copy.marked_empty()) { return false; - + } // The vector `leader' is used to indicate which variables are equivalent. std::vector leader(space_dim + 1); // We store the leader. - for (dimension_type i = space_dim + 1; i-- > 0; ) + for (dimension_type i = space_dim + 1; i-- > 0; ) { leader[i] = i; - + } // Step 1: we store really the leader with the corrected value. // We search for the equivalent or zero-equivalent variables. // The variable(i-1) and variable(j-1) are equivalent if and only if // m_i_j == -(m_j_i). for (dimension_type i = 0; i < space_dim; ++i) { const DB_Row& x_copy_dbm_i = x_copy.dbm[i]; - for (dimension_type j = i + 1; j <= space_dim; ++j) - if (is_additive_inverse(x_copy.dbm[j][i], x_copy_dbm_i[j])) + for (dimension_type j = i + 1; j <= space_dim; ++j) { + if (is_additive_inverse(x_copy.dbm[j][i], x_copy_dbm_i[j])) { // Two equivalent variables have got the same leader // (the smaller variable). leader[j] = leader[i]; + } + } } // Step 2: we check if there are redundant constraints in the zero_cycle @@ -1019,34 +1065,38 @@ // their sum is the same constraint with the inhomogeneous term // less than or equal to the `c' one. PPL_DIRTY_TEMP(N, c); - for (dimension_type k = 0; k <= space_dim; ++k) + for (dimension_type k = 0; k <= space_dim; ++k) { if (leader[k] == k) { const DB_Row& x_k = x_copy.dbm[k]; - for (dimension_type i = 0; i <= space_dim; ++i) + for (dimension_type i = 0; i <= space_dim; ++i) { if (leader[i] == i) { const DB_Row& x_i = x_copy.dbm[i]; const Bit_Row& redundancy_i = redundancy_dbm[i]; const N& x_i_k = x_i[k]; - for (dimension_type j = 0; j <= space_dim; ++j) + for (dimension_type j = 0; j <= space_dim; ++j) { if (leader[j] == j) { const N& x_i_j = x_i[j]; if (!is_plus_infinity(x_i_j)) { add_assign_r(c, x_i_k, x_k[j], ROUND_UP); - if (x_i_j >= c && !redundancy_i[j]) + if (x_i_j >= c && !redundancy_i[j]) { return false; + } } } + } } + } } + } // The vector `var_conn' is used to check if there is a single cycle // that connected all zero-equivalent variables between them. // The value `space_dim + 1' is used to indicate that the equivalence // class contains a single variable. std::vector var_conn(space_dim + 1); - for (dimension_type i = space_dim + 1; i-- > 0; ) + for (dimension_type i = space_dim + 1; i-- > 0; ) { var_conn[i] = space_dim + 1; - + } // Step 3: we store really the `var_conn' with the right value, putting // the variable with the selected variable is connected: // we check the row of each variable: @@ -1063,20 +1113,24 @@ dimension_type leader_j = leader[j]; // Only the connectedness with equivalent variables // is considered. - if (j != leader_j) + if (j != leader_j) { if (!redundancy_dbm[i][j]) { - if (t == 1) + if (t == 1) { // Two non-leaders cannot be connected with the same leader. return false; - else - if (leader_j != i) + } + else { + if (leader_j != i) { // The variables are not in the same equivalence class. return false; + } else { ++t; var_conn[i] = j; } + } } + } } } // Case b: non-leader. @@ -1084,13 +1138,15 @@ for (dimension_type j = 0; j <= space_dim; ++j) { if (!redundancy_dbm[i][j]) { dimension_type leader_j = leader[j]; - if (leader_i != leader_j) + if (leader_i != leader_j) { // The variables are not in the same equivalence class. return false; + } else { - if (t == 1) + if (t == 1) { // The variables cannot be connected with the same leader. return false; + } else { ++t; var_conn[i] = j; @@ -1098,8 +1154,9 @@ } // A non-leader must be connected with // another variable. - if (t == 0) + if (t == 0) { return false; + } } } } @@ -1108,9 +1165,9 @@ // The vector `just_checked' is used to check if // a variable is already checked. std::vector just_checked(space_dim + 1); - for (dimension_type i = space_dim + 1; i-- > 0; ) + for (dimension_type i = space_dim + 1; i-- > 0; ) { just_checked[i] = false; - + } // Step 4: we check if there are single cycles that // connected all the zero-equivalent variables between them. for (dimension_type i = 0; i <= space_dim; ++i) { @@ -1127,8 +1184,9 @@ v_con = var_conn[v_con]; // If we re-pass to an already considered variable, // then we haven't a single cycle. - if (just_checked[v_con]) + if (just_checked[v_con]) { return false; + } } } } @@ -1147,16 +1205,16 @@ // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); const dimension_type space_dim = space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((from_above ? "bounds_from_above(e)" : "bounds_from_below(e)"), "e", expr); - + } shortest_path_closure_assign(); // A zero-dimensional or empty BDS bounds everything. - if (space_dim == 0 || marked_empty()) + if (space_dim == 0 || marked_empty()) { return true; - + } // The constraint `c' is used to check if `expr' is a difference // bounded and, in this case, to select the cell. const Constraint& c = from_above ? expr <= 0 : expr >= 0; @@ -1166,9 +1224,10 @@ PPL_DIRTY_TEMP_COEFFICIENT(coeff); // Check if `c' is a BD constraint. if (BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) { - if (num_vars == 0) + if (num_vars == 0) { // Dealing with a trivial constraint. return true; + } // Select the cell to be checked. const N& x = (coeff < 0) ? dbm[i][j] : dbm[j][i]; return !is_plus_infinity(x); @@ -1193,14 +1252,16 @@ // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } // Deal with zero-dim BDS first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -1211,9 +1272,9 @@ shortest_path_closure_assign(); // For an empty BDS we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; - + } // The constraint `c' is used to check if `expr' is a difference // bounded and, in this case, to select the cell. const Constraint& c = maximize ? expr <= 0 : expr >= 0; @@ -1231,9 +1292,10 @@ included = true; return true; } - else + else { // Here`expr' is unbounded in `*this'. return false; + } } else { // Here `expr' is a bounded difference. @@ -1261,8 +1323,9 @@ PPL_ASSERT(i != 0); const Coefficient& coeff_i = expr.get(Variable(i - 1)); const int sign_i = sgn(coeff_i); - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_expr, coeff_i, ROUND_UP); + } else { PPL_DIRTY_TEMP_COEFFICIENT(minus_coeff_i); neg_assign(minus_coeff_i, coeff_i); @@ -1271,8 +1334,9 @@ // Approximating the maximum/minimum of `expr'. add_mul_assign_r(d, coeff_expr, x, ROUND_UP); numer_denom(d, ext_n, ext_d); - if (!maximize) + if (!maximize) { neg_assign(ext_n); + } included = true; return true; } @@ -1293,14 +1357,16 @@ // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } // Deal with zero-dim BDS first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -1312,9 +1378,9 @@ shortest_path_closure_assign(); // For an empty BDS we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; - + } Optimization_Mode mode_max_min = maximize ? MAXIMIZATION : MINIMIZATION; MIP_Problem mip(space_dim, constraints(), expr, mode_max_min); @@ -1334,9 +1400,9 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (cg.space_dimension() > space_dim) + if (cg.space_dimension() > space_dim) { throw_dimension_incompatible("relation_with(cg)", cg); - + } // If the congruence is an equality, find the relation with // the equivalent equality constraint. if (cg.is_equality()) { @@ -1346,17 +1412,19 @@ shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); - + } if (space_dim == 0) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } } // Find the lower bound for a hyperplane with direction @@ -1369,9 +1437,9 @@ // If there is no lower bound, then some of the hyperplanes defined by // the congruence will strictly intersect the shape. - if (!bounded_below) + if (!bounded_below) { return Poly_Con_Relation::strictly_intersects(); - + } // TODO: Consider adding a max_and_min() method, performing both // maximization and minimization so as to possibly exploit // incrementality of the MIP solver. @@ -1385,9 +1453,9 @@ // If there is no upper bound, then some of the hyperplanes defined by // the congruence will strictly intersect the shape. - if (!bounded_above) + if (!bounded_above) { return Poly_Con_Relation::strictly_intersects(); - + } PPL_DIRTY_TEMP_COEFFICIENT(signed_distance); // Find the position value for the hyperplane that satisfies the congruence @@ -1397,25 +1465,27 @@ const Coefficient& modulus = cg.modulus(); signed_distance = min_value % modulus; min_value -= signed_distance; - if (min_value * min_denom < min_numer) + if (min_value * min_denom < min_numer) { min_value += modulus; - + } // Find the position value for the hyperplane that satisfies the congruence // and is below the upper bound for the shape. PPL_DIRTY_TEMP_COEFFICIENT(max_value); max_value = max_numer / max_denom; signed_distance = max_value % modulus; max_value += signed_distance; - if (max_value * max_denom > max_numer) + if (max_value * max_denom > max_numer) { max_value -= modulus; - + } // If the upper bound value is less than the lower bound value, // then there is an empty intersection with the congruence; // otherwise it will strictly intersect. - if (max_value < min_value) + if (max_value < min_value) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } } @@ -1426,33 +1496,37 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dim) + if (c_space_dim > space_dim) { throw_dimension_incompatible("relation_with(c)", c); - + } shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); - + } if (space_dim == 0) { if ((c.is_equality() && c.inhomogeneous_term() != 0) - || (c.is_inequality() && c.inhomogeneous_term() < 0)) + || (c.is_inequality() && c.inhomogeneous_term() < 0)) { return Poly_Con_Relation::is_disjoint(); - else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) + } + else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) { // The constraint 0 > 0 implicitly defines the hyperplane 0 = 0; // thus, the zero-dimensional point also saturates it. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else if (c.is_equality() || c.inhomogeneous_term() == 0) + } + else if (c.is_equality() || c.inhomogeneous_term() == 0) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); - else + } + else { // The zero-dimensional point saturates // neither the positivity constraint 1 >= 0, // nor the strict positivity constraint 1 > 0. return Poly_Con_Relation::is_included(); + } } dimension_type num_vars = 0; @@ -1469,26 +1543,29 @@ Linear_Expression le(c.expression()); le.set_inhomogeneous_term(Coefficient_zero()); - PPL_DIRTY_TEMP(Coefficient, max_numer); - PPL_DIRTY_TEMP(Coefficient, max_denom); + PPL_DIRTY_TEMP_COEFFICIENT(max_numer); + PPL_DIRTY_TEMP_COEFFICIENT(max_denom); bool max_included; - PPL_DIRTY_TEMP(Coefficient, min_numer); - PPL_DIRTY_TEMP(Coefficient, min_denom); + PPL_DIRTY_TEMP_COEFFICIENT(min_numer); + PPL_DIRTY_TEMP_COEFFICIENT(min_denom); bool min_included; bool bounded_above = maximize(le, max_numer, max_denom, max_included); bool bounded_below = minimize(le, min_numer, min_denom, min_included); if (!bounded_above) { - if (!bounded_below) + if (!bounded_below) { return Poly_Con_Relation::strictly_intersects(); + } min_numer += c.inhomogeneous_term() * min_denom; switch (sgn(min_numer)) { case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::is_included(); case 0: - if (c.is_strict_inequality() || c.is_equality()) + if (c.is_strict_inequality() || c.is_equality()) { return Poly_Con_Relation::strictly_intersects(); + } return Poly_Con_Relation::is_included(); case -1: return Poly_Con_Relation::strictly_intersects(); @@ -1500,8 +1577,9 @@ case 1: return Poly_Con_Relation::strictly_intersects(); case 0: - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::strictly_intersects(); case -1: return Poly_Con_Relation::is_disjoint(); @@ -1514,14 +1592,17 @@ case 1: switch (sgn(min_numer)) { case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::is_included(); case 0: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::strictly_intersects(); - if (c.is_strict_inequality()) + } + if (c.is_strict_inequality()) { return Poly_Con_Relation::strictly_intersects(); + } return Poly_Con_Relation::is_included(); case -1: return Poly_Con_Relation::strictly_intersects(); @@ -1530,14 +1611,16 @@ break; case 0: if (min_numer == 0) { - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint() && Poly_Con_Relation::saturates(); + } return Poly_Con_Relation::is_included() && Poly_Con_Relation::saturates(); } - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::strictly_intersects(); case -1: return Poly_Con_Relation::is_disjoint(); @@ -1552,17 +1635,21 @@ case -1: return Poly_Con_Relation::is_disjoint(); case 0: - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::is_included(); + } } } @@ -1571,8 +1658,9 @@ const bool negative = (coeff < 0); const N& x = negative ? dbm[i][j] : dbm[j][i]; const N& y = negative ? dbm[j][i] : dbm[i][j]; - if (negative) + if (negative) { neg_assign(coeff); + } // Deduce the relation/s of the constraint `c' of the form // `coeff*v - coeff*u d' (`-y >= d' if c is a strict equality), i.e. if // `y < d1' (`y <= d1' if c is a strict equality). - if (q_y < d1) + if (q_y < d1) { return Poly_Con_Relation::is_disjoint(); - if (q_y == d1 && c.is_strict_inequality()) + } + if (q_y == d1 && c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } } // Here `y' can be also plus-infinity. // If `c' is an equality, `*this' is disjoint from `c' if // `x < d'. if (d > q_x) { - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::is_included(); + } } - if (d == q_x && c.is_nonstrict_inequality()) + if (d == q_x && c.is_nonstrict_inequality()) { return Poly_Con_Relation::is_included(); - + } // In all other cases `*this' intersects `c'. return Poly_Con_Relation::strictly_intersects(); } @@ -1670,19 +1766,19 @@ const dimension_type g_space_dim = g.space_dimension(); // Dimension-compatibility check. - if (space_dim < g_space_dim) + if (space_dim < g_space_dim) { throw_dimension_incompatible("relation_with(g)", g); - + } shortest_path_closure_assign(); // The empty BDS cannot subsume a generator. - if (marked_empty()) + if (marked_empty()) { return Poly_Gen_Relation::nothing(); - + } // A universe BDS in a zero-dimensional space subsumes // all the generators of a zero-dimensional space. - if (space_dim == 0) + if (space_dim == 0) { return Poly_Gen_Relation::subsumes(); - + } const bool is_line = g.is_line(); const bool is_line_or_ray = g.is_line_or_ray(); @@ -1714,10 +1810,12 @@ product = g_coeff_y; product -= g_coeff_x; product *= denom; - if (!is_line_or_ray) + if (!is_line_or_ray) { add_mul_assign(product, numer, g.divisor()); - if (product != 0) + } + if (product != 0) { return Poly_Gen_Relation::nothing(); + } } else { // We have 0, 1 or 2 binary inequality constraint/s. @@ -1729,17 +1827,21 @@ product = g_coeff_y; product -= g_coeff_x; product *= denom; - if (!is_line_or_ray) + if (!is_line_or_ray) { add_mul_assign(product, numer, g.divisor()); + } if (is_line) { - if (product != 0) + if (product != 0) { // Lines must saturate all constraints. return Poly_Gen_Relation::nothing(); + } } - else + else { // `g' is either a ray, a point or a closure point. - if (product < 0) + if (product < 0) { return Poly_Gen_Relation::nothing(); + } + } } if (!is_plus_infinity(dbm_ji)) { @@ -1749,17 +1851,21 @@ product = 0; add_mul_assign(product, denom, g_coeff_x); add_mul_assign(product, -denom, g_coeff_y); - if (!is_line_or_ray) + if (!is_line_or_ray) { add_mul_assign(product, numer, g.divisor()); + } if (is_line) { - if (product != 0) + if (product != 0) { // Lines must saturate all constraints. return Poly_Gen_Relation::nothing(); + } } - else + else { // `g' is either a ray, a point or a closure point. - if (product < 0) + if (product < 0) { return Poly_Gen_Relation::nothing(); + } + } } } } @@ -1773,13 +1879,14 @@ void BD_Shape::shortest_path_closure_assign() const { // Do something only if necessary. - if (marked_empty() || marked_shortest_path_closed()) + if (marked_empty() || marked_shortest_path_closed()) { return; + } const dimension_type num_dimensions = space_dimension(); // Zero-dimensional BDSs are necessarily shortest-path closed. - if (num_dimensions == 0) + if (num_dimensions == 0) { return; - + } // Even though the BDS will not change, its internal representation // is going to be modified by the Floyd-Warshall algorithm. BD_Shape& x = const_cast&>(*this); @@ -1796,7 +1903,7 @@ for (dimension_type i = num_dimensions + 1; i-- > 0; ) { DB_Row& x_dbm_i = x.dbm[i]; const N& x_dbm_i_k = x_dbm_i[k]; - if (!is_plus_infinity(x_dbm_i_k)) + if (!is_plus_infinity(x_dbm_i_k)) { for (dimension_type j = num_dimensions + 1; j-- > 0; ) { const N& x_dbm_k_j = x_dbm_k[j]; if (!is_plus_infinity(x_dbm_k_j)) { @@ -1805,6 +1912,7 @@ min_assign(x_dbm_i[j], sum); } } + } } } @@ -1831,8 +1939,9 @@ void BD_Shape::incremental_shortest_path_closure_assign(Variable var) const { // Do something only if necessary. - if (marked_empty() || marked_shortest_path_closed()) + if (marked_empty() || marked_shortest_path_closed()) { return; + } const dimension_type num_dimensions = space_dimension(); PPL_ASSERT(var.id() < num_dimensions); @@ -1897,9 +2006,10 @@ } } } - else + else { // Here both x_v_k and x_k_v are infinite. continue; + } } // Step 2: improve the other bounds by using the precise bounds @@ -1941,21 +2051,21 @@ void BD_Shape::shortest_path_reduction_assign() const { // Do something only if necessary. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { return; - + } const dimension_type space_dim = space_dimension(); // Zero-dimensional BDSs are necessarily reduced. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // First find the tightest constraints for this BDS. shortest_path_closure_assign(); // If `*this' is empty, then there is nothing to reduce. - if (marked_empty()) + if (marked_empty()) { return; - + } // Step 1: compute zero-equivalence classes. // Variables corresponding to indices `i' and `j' are zero-equivalent // if they lie on a zero-weight loop; since the matrix is shortest-path @@ -1970,11 +2080,12 @@ // Init all constraints to be redundant. // TODO: provide an appropriate method to set multiple bits. Bit_Row& red_0 = redundancy[0]; - for (dimension_type j = space_dim + 1; j-- > 0; ) + for (dimension_type j = space_dim + 1; j-- > 0; ) { red_0.set(j); - for (dimension_type i = space_dim + 1; i-- > 0; ) + } + for (dimension_type i = space_dim + 1; i-- > 0; ) { redundancy[i] = red_0; - + } // Step 2: flag non-redundant constraints in the (zero-cycle-free) // subsystem of bounded differences having only leaders as variables. PPL_DIRTY_TEMP(N, c); @@ -2003,7 +2114,7 @@ // Each equivalence class must have a single 0-cycle connecting // all the equivalent variables in increasing order. std::deque dealt_with(space_dim + 1, false); - for (dimension_type i = space_dim + 1; i-- > 0; ) + for (dimension_type i = space_dim + 1; i-- > 0; ) { // We only need to deal with non-singleton zero-equivalence classes // that haven't already been dealt with. if (i != predecessor[i] && !dealt_with[i]) { @@ -2025,7 +2136,7 @@ j = predecessor_j; } } - + } // Even though shortest-path reduction is not going to change the BDS, // it might change its internal representation. BD_Shape& x = const_cast&>(*this); @@ -2042,13 +2153,14 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("upper_bound_assign(y)", y); - + } // The upper bound of a BD shape `bd' with an empty shape is `bd'. y.shortest_path_closure_assign(); - if (y.marked_empty()) + if (y.marked_empty()) { return; + } shortest_path_closure_assign(); if (marked_empty()) { *this = y; @@ -2064,14 +2176,16 @@ for (dimension_type j = space_dim + 1; j-- > 0; ) { N& dbm_ij = dbm_i[j]; const N& y_dbm_ij = y_dbm_i[j]; - if (dbm_ij < y_dbm_ij) + if (dbm_ij < y_dbm_ij) { dbm_ij = y_dbm_ij; + } } } // Shortest-path closure is maintained (if it was holding). // TODO: see whether reduction can be (efficiently!) maintained too. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } PPL_ASSERT(OK()); } @@ -2095,8 +2209,9 @@ *this = y; return true; } - else if (y.is_empty()) + else if (y.is_empty()) { return true; + } else if (x.is_empty()) { *this = y; return true; @@ -2128,23 +2243,28 @@ const DB_Row& x_dbm_i = x.dbm[i]; const DB_Row& y_dbm_i = y.dbm[i]; for (dimension_type j = x_space_dim + 1; j-- > 0; ) { - if (x_red_i[j] && y_red_i[j]) + if (x_red_i[j] && y_red_i[j]) { continue; + } if (!x_red_i[j]) { const N& x_dbm_ij = x_dbm_i[j]; PPL_ASSERT(!is_plus_infinity(x_dbm_ij)); numer_denom(x_dbm_ij, numer, denom); // Build skeleton DB constraint (having the right space dimension). db_expr = zero_expr; - if (i > 0) + if (i > 0) { db_expr += Variable(i-1); - if (j > 0) + } + if (j > 0) { db_expr -= Variable(j-1); - if (denom != 1) + } + if (denom != 1) { db_expr *= denom; + } db_expr += numer; - if (x_dbm_ij >= y_dbm_i[j]) + if (x_dbm_ij >= y_dbm_i[j]) { env_cs.insert(db_expr >= 0); + } else { db_expr += epsilon; x_cs_removed.insert(db_expr == 0); @@ -2157,17 +2277,21 @@ numer_denom(y_dbm_ij, numer, denom); // Build skeleton DB constraint (having the right space dimension). db_expr = zero_expr; - if (i > 0) + if (i > 0) { db_expr += Variable(i-1); - if (j > 0) + } + if (j > 0) { db_expr -= Variable(j-1); - if (denom != 1) + } + if (denom != 1) { db_expr *= denom; + } db_expr += numer; if (y_dbm_ij >= x_dbm_ij) { // Check if same constraint was added when considering x_dbm_ij. - if (!x_red_i[j] && x_dbm_ij == y_dbm_ij) + if (!x_red_i[j] && x_dbm_ij == y_dbm_ij) { continue; + } env_cs.insert(db_expr >= 0); } else { @@ -2178,9 +2302,10 @@ } } - if (x_cs_removed.empty()) + if (x_cs_removed.empty()) { // No constraint of x was removed: y is included in x. return true; + } if (y_cs_removed.empty()) { // No constraint of y was removed: x is included in y. *this = y; @@ -2201,8 +2326,9 @@ MIP_Problem lp_i(env_lp); lp_i.add_constraint(*i); // Pre-solve to exploit incrementality. - if (lp_i.solve() == UNFEASIBLE_MIP_PROBLEM) + if (lp_i.solve() == UNFEASIBLE_MIP_PROBLEM) { continue; + } for (Constraint_System::const_iterator j = y_cs_removed.begin(), j_end = y_cs_removed.end(); j != j_end; ++j) { MIP_Problem lp_ij(lp_i); @@ -2217,8 +2343,9 @@ return false; case OPTIMIZED_MIP_PROBLEM: lp_ij.optimal_value(numer, denom); - if (numer > 0) + if (numer > 0) { return false; + } break; } } @@ -2258,8 +2385,9 @@ *this = y; return true; } - else if (y.is_empty()) + else if (y.is_empty()) { return true; + } else if (x.is_empty()) { *this = y; return true; @@ -2279,9 +2407,9 @@ PPL_DIRTY_TEMP(N, temp_zero); assign_r(temp_zero, 0, ROUND_NOT_NEEDED); PPL_DIRTY_TEMP(N, temp_one); - if (integer_upper_bound) + if (integer_upper_bound) { assign_r(temp_one, 1, ROUND_NOT_NEEDED); - + } for (dimension_type i = x_space_dim + 1; i-- > 0; ) { const DB_Row& x_i = x.dbm[i]; const Bit_Row& x_red_i = x.redundancy_dbm[i]; @@ -2289,8 +2417,9 @@ const DB_Row& ub_i = ub.dbm[i]; for (dimension_type j = x_space_dim + 1; j-- > 0; ) { // Check redundancy of x_i_j. - if (x_red_i[j]) + if (x_red_i[j]) { continue; + } // By non-redundancy, we know that i != j. PPL_ASSERT(i != j); const N& x_i_j = x_i[j]; @@ -2303,8 +2432,9 @@ const N& ub_k_j = (k == j) ? temp_zero : ub_k[j]; for (dimension_type ell = x_space_dim + 1; ell-- > 0; ) { // Check redundancy of y_k_ell. - if (y_red_k[ell]) + if (y_red_k[ell]) { continue; + } // By non-redundancy, we know that k != ell. PPL_ASSERT(k != ell); const N& y_k_ell = y_k[ell]; @@ -2320,8 +2450,9 @@ add_assign_r(lhs, lhs, temp_one, ROUND_NOT_NEEDED); } // Testing for < in both the rational and integer case. - if (lhs < rhs) + if (lhs < rhs) { return false; + } } } } @@ -2340,9 +2471,9 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("difference_assign(y)", y); - + } BD_Shape new_bd_shape(space_dim, EMPTY); BD_Shape& x = *this; @@ -2350,14 +2481,15 @@ x.shortest_path_closure_assign(); // The difference of an empty bounded difference shape // and of a bounded difference shape `p' is empty. - if (x.marked_empty()) + if (x.marked_empty()) { return; + } y.shortest_path_closure_assign(); // The difference of a bounded difference shape `p' // and an empty bounded difference shape is `p'. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } // If both bounded difference shapes are zero-dimensional, // then at this point they are necessarily universe system of // bounded differences, so that their difference is empty. @@ -2386,18 +2518,21 @@ // would result in the empty bounded difference shape, // and as we would obtain a result that is less precise // than the bds-difference. - if (x.relation_with(c).implies(Poly_Con_Relation::is_included())) + if (x.relation_with(c).implies(Poly_Con_Relation::is_included())) { continue; + } BD_Shape z = x; const Linear_Expression e(c.expression()); z.add_constraint(e <= 0); - if (!z.is_empty()) + if (!z.is_empty()) { new_bd_shape.upper_bound_assign(z); + } if (c.is_equality()) { z = x; z.add_constraint(e >= 0); - if (!z.is_empty()) + if (!z.is_empty()) { new_bd_shape.upper_bound_assign(z); + } } } *this = new_bd_shape; @@ -2410,17 +2545,18 @@ BD_Shape& x = *this; const dimension_type dim = x.space_dimension(); // Dimension-compatibility check. - if (dim != y.space_dimension()) + if (dim != y.space_dimension()) { throw_dimension_incompatible("simplify_using_context_assign(y)", y); - + } // Filter away the zero-dimensional case. if (dim == 0) { if (y.marked_empty()) { x.set_zero_dim_univ(); return false; } - else + else { return !x.marked_empty(); + } } // Filter away the case where `x' contains `y' @@ -2442,29 +2578,33 @@ i = 0; const DB_Row& y_dbm_0 = y.dbm[0]; for (j = 1; j <= dim; ++j) { - if (!is_plus_infinity(y_dbm_0[j])) + if (!is_plus_infinity(y_dbm_0[j])) { // FIXME: if N is a float or bounded integer type, then // we also need to check that we are actually able to construct // a constraint inconsistent with respect to this one. goto found; + } } j = 0; for (i = 1; i <= dim; ++i) { - if (!is_plus_infinity(y.dbm[i][0])) + if (!is_plus_infinity(y.dbm[i][0])) { // FIXME: if N is a float or bounded integer type, then // we also need to check that we are actually able to construct // a constraint inconsistent with respect to this one. goto found; + } } // Then search binary constraints. for (i = 1; i <= dim; ++i) { const DB_Row& y_dbm_i = y.dbm[i]; - for (j = 1; j <= dim; ++j) - if (!is_plus_infinity(y_dbm_i[j])) + for (j = 1; j <= dim; ++j) { + if (!is_plus_infinity(y_dbm_i[j])) { // FIXME: if N is a float or bounded integer type, then // we also need to check that we are actually able to construct // a constraint inconsistent with respect to this one. goto found; + } + } } // Not found: we were not able to build a constraint contradicting // one of the constraints in `y': `x' cannot be enlarged. @@ -2495,8 +2635,9 @@ x.shortest_path_reduction_assign(); // ... count the non-redundant constraints. dimension_type x_num_non_redundant = (dim+1)*(dim+1); - for (dimension_type i = dim + 1; i-- > 0; ) + for (dimension_type i = dim + 1; i-- > 0; ) { x_num_non_redundant -= x.redundancy_dbm[i].count_ones(); + } PPL_ASSERT(x_num_non_redundant > 0); // Let `yy' be a copy of `y': we will keep adding to `yy' @@ -2520,8 +2661,9 @@ for (dimension_type j = 1; j <= dim; ++j) { // Unary equality constraints are encoded in entries dbm_0j and dbm_j0 // provided index j has special variable index 0 as its leader. - if (x_leaders[j] != 0) + if (x_leaders[j] != 0) { continue; + } PPL_ASSERT(!is_plus_infinity(x_dbm_0[j])); if (x_dbm_0[j] < yy_dbm_0[j]) { res_dbm_0[j] = x_dbm_0[j]; @@ -2557,8 +2699,9 @@ // Note: no need to consider the case i == 1. for (dimension_type i = 2; i <= dim; ++i) { const dimension_type j = x_leaders[i]; - if (j == i || j == 0) + if (j == i || j == 0) { continue; + } PPL_ASSERT(!is_plus_infinity(x.dbm[i][j])); if (x.dbm[i][j] < yy.dbm[i][j]) { res.dbm[i][j] = x.dbm[i][j]; @@ -2593,15 +2736,17 @@ // Finally go through the (proper) inequality constraints: // both indices i and j should be leaders. for (dimension_type i = 0; i <= dim; ++i) { - if (i != x_leaders[i]) + if (i != x_leaders[i]) { continue; + } const DB_Row& x_dbm_i = x.dbm[i]; const Bit_Row& x_redundancy_dbm_i = x.redundancy_dbm[i]; DB_Row& yy_dbm_i = yy.dbm[i]; DB_Row& res_dbm_i = res.dbm[i]; for (dimension_type j = 0; j <= dim; ++j) { - if (j != x_leaders[j] || x_redundancy_dbm_i[j]) + if (j != x_leaders[j] || x_redundancy_dbm_i[j]) { continue; + } N& yy_dbm_ij = yy_dbm_i[j]; const N& x_dbm_ij = x_dbm_i[j]; if (x_dbm_ij < yy_dbm_ij) { @@ -2633,9 +2778,9 @@ void BD_Shape::add_space_dimensions_and_embed(const dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; - + } const dimension_type space_dim = space_dimension(); const dimension_type new_space_dim = space_dim + m; const bool was_zero_dim_univ = (!marked_empty() && space_dim == 0); @@ -2647,14 +2792,14 @@ // Shortest-path closure is maintained (if it was holding). // TODO: see whether reduction can be (efficiently!) maintained too. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - + } // If `*this' was the zero-dim space universe BDS, // the we can set the shortest-path closure flag. - if (was_zero_dim_univ) + if (was_zero_dim_univ) { set_shortest_path_closed(); - + } PPL_ASSERT(OK()); } @@ -2662,9 +2807,9 @@ void BD_Shape::add_space_dimensions_and_project(const dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; - + } const dimension_type space_dim = space_dimension(); // If `*this' was zero-dimensional, then we add `m' rows and columns. @@ -2675,9 +2820,11 @@ if (!marked_empty()) { for (dimension_type i = m + 1; i-- > 0; ) { DB_Row& dbm_i = dbm[i]; - for (dimension_type j = m + 1; j-- > 0; ) - if (i != j) + for (dimension_type j = m + 1; j-- > 0; ) { + if (i != j) { assign_r(dbm_i[j], 0, ROUND_NOT_NEEDED); + } + } } set_shortest_path_closed(); } @@ -2699,8 +2846,9 @@ assign_r(dbm_0[i], 0, ROUND_NOT_NEEDED); } - if (marked_shortest_path_closed()) + if (marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -2719,9 +2867,9 @@ // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (old_space_dim < min_space_dim) + if (old_space_dim < min_space_dim) { throw_dimension_incompatible("remove_space_dimensions(vs)", min_space_dim); - + } // Shortest-path closure is necessary to keep precision. shortest_path_closure_assign(); @@ -2730,9 +2878,10 @@ const dimension_type new_space_dim = old_space_dim - vars.size(); if (new_space_dim == 0) { dbm.resize_no_copy(1); - if (!marked_empty()) + if (!marked_empty()) { // We set the zero_dim_univ flag. set_zero_dim_univ(); + } PPL_ASSERT(OK()); return; } @@ -2746,9 +2895,9 @@ // Shortest-path closure is maintained. // TODO: see whether reduction can be (efficiently!) maintained too. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - + } // For each variable to remove, we fill the corresponding column and // row by shifting respectively left and above those // columns and rows, that will not be removed. @@ -2796,9 +2945,9 @@ BD_Shape::map_space_dimensions(const Partial_Function& pfunc) { const dimension_type space_dim = space_dimension(); // TODO: this implementation is just an executable specification. - if (space_dim == 0) + if (space_dim == 0) { return; - + } if (pfunc.has_empty_codomain()) { // All dimensions vanish: the BDS becomes zero_dimensional. remove_higher_space_dimensions(0); @@ -2808,9 +2957,9 @@ const dimension_type new_space_dim = pfunc.max_in_codomain() + 1; // If we are going to actually reduce the space dimension, // then shortest-path closure is required to keep precision. - if (new_space_dim < space_dim) + if (new_space_dim < space_dim) { shortest_path_closure_assign(); - + } // If the BDS is empty, then it is sufficient to adjust the // space dimension of the bounded difference shape. if (marked_empty()) { @@ -2820,9 +2969,9 @@ // Shortest-path closure is maintained (if it was holding). // TODO: see whether reduction can be (efficiently!) maintained too. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - + } // We create a new matrix with the new space dimension. DB_Matrix x(new_space_dim+1); // First of all we must map the unary constraints, because @@ -2866,13 +3015,14 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("intersection_assign(y)", y); - + } // If one of the two bounded difference shapes is empty, // the intersection is empty. - if (marked_empty()) + if (marked_empty()) { return; + } if (y.marked_empty()) { set_empty(); return; @@ -2881,9 +3031,9 @@ // If both bounded difference shapes are zero-dimensional, // then at this point they are necessarily non-empty, // so that their intersection is non-empty too. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // To intersect two bounded difference shapes we compare // the constraints and we choose the less values. bool changed = false; @@ -2900,8 +3050,9 @@ } } - if (changed && marked_shortest_path_closed()) + if (changed && marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -2914,33 +3065,35 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("CC76_extrapolation_assign(y)", y); - + } // We assume that `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If both bounded difference shapes are zero-dimensional, // since `*this' contains `y', we simply return `*this'. - if (space_dim == 0) + if (space_dim == 0) { return; - + } shortest_path_closure_assign(); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } y.shortest_path_closure_assign(); // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } // If there are tokens available, work on a temporary copy. if (tp != 0 && *tp > 0) { BD_Shape x_tmp(*this); x_tmp.CC76_extrapolation_assign(y, first, last, 0); // If the widening was not precise, use one of the available tokens. - if (!contains(x_tmp)) + if (!contains(x_tmp)) { --(*tp); + } return; } @@ -2961,11 +3114,13 @@ if (y_dbm_ij < dbm_ij) { Iterator k = std::lower_bound(first, last, dbm_ij); if (k != last) { - if (dbm_ij < *k) + if (dbm_ij < *k) { assign_r(dbm_ij, *k, ROUND_UP); + } } - else + else { assign_r(dbm_ij, PLUS_INFINITY, ROUND_NOT_NEEDED); + } } } } @@ -3000,8 +3155,9 @@ const N& x = negative ? dbm[i][j] : dbm[j][i]; const N& y = negative ? dbm[j][i] : dbm[i][j]; DB_Matrix& ls_dbm = limiting_shape.dbm; - if (negative) + if (negative) { neg_assign(coeff); + } // Compute the bound for `x', rounding towards plus infinity. div_round_up(d, c.inhomogeneous_term(), coeff); if (x <= d) { @@ -3032,8 +3188,9 @@ // In general, adding a constraint does not preserve the shortest-path // closure of the bounded difference shape. - if (changed && limiting_shape.marked_shortest_path_closed()) + if (changed && limiting_shape.marked_shortest_path_closed()) { limiting_shape.reset_shortest_path_closed(); + } } template @@ -3043,38 +3200,40 @@ unsigned* tp) { // Dimension-compatibility check. const dimension_type space_dim = space_dimension(); - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("limited_CC76_extrapolation_assign(y, cs)", y); - + } // `cs' must be dimension-compatible with the two systems // of bounded differences. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_invalid_argument("limited_CC76_extrapolation_assign(y, cs)", "cs is space_dimension incompatible"); + } // Strict inequalities not allowed. - if (cs.has_strict_inequalities()) + if (cs.has_strict_inequalities()) { throw_invalid_argument("limited_CC76_extrapolation_assign(y, cs)", "cs has strict inequalities"); - + } // The limited CC76-extrapolation between two systems of bounded // differences in a zero-dimensional space is a system of bounded // differences in a zero-dimensional space, too. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // We assume that `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } BD_Shape limiting_shape(space_dim, UNIVERSE); get_limiting_shape(cs, limiting_shape); CC76_extrapolation_assign(y, tp); @@ -3087,9 +3246,9 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("BHMZ05_widening_assign(y)", y); - + } // We assume that `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); @@ -3098,23 +3257,24 @@ // If the affine dimension of `y' is zero, then either `y' is // zero-dimensional, or it is empty, or it is a singleton. // In all cases, due to the inclusion hypothesis, the result is `*this'. - if (y_affine_dim == 0) + if (y_affine_dim == 0) { return; - + } // If the affine dimension has changed, due to the inclusion hypothesis, // the result is `*this'. const dimension_type x_affine_dim = affine_dimension(); PPL_ASSERT(x_affine_dim >= y_affine_dim); - if (x_affine_dim != y_affine_dim) + if (x_affine_dim != y_affine_dim) { return; - + } // If there are tokens available, work on a temporary copy. if (tp != 0 && *tp > 0) { BD_Shape x_tmp(*this); x_tmp.BHMZ05_widening_assign(y, 0); // If the widening was not precise, use one of the available tokens. - if (!contains(x_tmp)) + if (!contains(x_tmp)) { --(*tp); + } return; } @@ -3133,8 +3293,9 @@ // Note: in the following line the use of `!=' (as opposed to // the use of `<' that would seem -but is not- equivalent) is // intentional. - if (y_redundancy_i[j] || y_dbm_i[j] != dbm_ij) + if (y_redundancy_i[j] || y_dbm_i[j] != dbm_ij) { assign_r(dbm_ij, PLUS_INFINITY, ROUND_NOT_NEEDED); + } } } // NOTE: this will also reset the shortest-path reduction flag, @@ -3152,37 +3313,39 @@ unsigned* tp) { // Dimension-compatibility check. const dimension_type space_dim = space_dimension(); - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("limited_BHMZ05_extrapolation_assign(y, cs)", y); + } // `cs' must be dimension-compatible with the two systems // of bounded differences. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_invalid_argument("limited_BHMZ05_extrapolation_assign(y, cs)", "cs is space-dimension incompatible"); - + } // Strict inequalities are not allowed. - if (cs.has_strict_inequalities()) + if (cs.has_strict_inequalities()) { throw_invalid_argument("limited_BHMZ05_extrapolation_assign(y, cs)", "cs has strict inequalities"); - + } // The limited BHMZ05-extrapolation between two systems of bounded // differences in a zero-dimensional space is a system of bounded // differences in a zero-dimensional space, too. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // We assume that `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } BD_Shape limiting_shape(space_dim, UNIVERSE); get_limiting_shape(cs, limiting_shape); BHMZ05_widening_assign(y, tp); @@ -3195,26 +3358,27 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("CC76_narrowing_assign(y)", y); - + } // We assume that `*this' is contained in or equal to `y'. PPL_EXPECT_HEAVY(copy_contains(y, *this)); // If both bounded difference shapes are zero-dimensional, // since `y' contains `*this', we simply return `*this'. - if (space_dim == 0) + if (space_dim == 0) { return; - + } y.shortest_path_closure_assign(); // If `y' is empty, since `y' contains `this', `*this' is empty too. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } shortest_path_closure_assign(); // If `*this' is empty, we return. - if (marked_empty()) + if (marked_empty()) { return; - + } // Replace each constraint in `*this' by the corresponding constraint // in `y' if the corresponding inhomogeneous terms are both finite. bool changed = false; @@ -3232,8 +3396,9 @@ } } } - if (changed && marked_shortest_path_closed()) + if (changed && marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -3266,15 +3431,18 @@ for (Linear_Expression::const_iterator u = sc_expr.begin(), u_end = sc_expr.lower_bound(Variable(last_v)); u != u_end; ++u) { const dimension_type u_dim = u.variable().space_dimension(); - if (u_dim == v) + if (u_dim == v) { continue; + } const Coefficient& expr_u = *u; - if (expr_u < 0) + if (expr_u < 0) { continue; + } PPL_ASSERT(expr_u > 0); - if (expr_u >= sc_denom) + if (expr_u >= sc_denom) { // Deducing `v - u <= ub_v - ub_u'. sub_assign_r(dbm[u_dim][v], ub_v, dbm_0[u_dim], ROUND_UP); + } else { DB_Row& dbm_u = dbm[u_dim]; const N& dbm_u0 = dbm_u[0]; @@ -3333,16 +3501,19 @@ u_end = sc_expr.lower_bound(Variable(last_v)); u != u_end; ++u) { const Variable u_var = u.variable(); const dimension_type u_dim = u_var.space_dimension(); - if (u_var.space_dimension() == v) + if (u_var.space_dimension() == v) { continue; + } const Coefficient& expr_u = *u; - if (expr_u < 0) + if (expr_u < 0) { continue; + } PPL_ASSERT(expr_u > 0); - if (expr_u >= sc_denom) + if (expr_u >= sc_denom) { // Deducing `u - v <= lb_u - lb_v', // i.e., `u - v <= (-lb_v) - (-lb_u)'. sub_assign_r(dbm_v[u_dim], minus_lb_v, dbm[u_dim][0], ROUND_UP); + } else { const N& dbm_0u = dbm_0[u_dim]; if (!is_plus_infinity(dbm_0u)) { @@ -3395,17 +3566,17 @@ BD_Shape::unconstrain(const Variable var) { // Dimension-compatibility check. const dimension_type var_space_dim = var.space_dimension(); - if (space_dimension() < var_space_dim) + if (space_dimension() < var_space_dim) { throw_dimension_incompatible("unconstrain(var)", var_space_dim); - + } // Shortest-path closure is necessary to detect emptiness // and all (possibly implicit) constraints. shortest_path_closure_assign(); // If the shape is empty, this is a no-op. - if (marked_empty()) + if (marked_empty()) { return; - + } forget_all_dbm_constraints(var_space_dim); // Shortest-path closure is preserved, but not reduction. reset_shortest_path_reduced(); @@ -3417,25 +3588,26 @@ BD_Shape::unconstrain(const Variables_Set& vars) { // The cylindrification with respect to no dimensions is a no-op. // This case captures the only legal cylindrification in a 0-dim space. - if (vars.empty()) + if (vars.empty()) { return; - + } // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("unconstrain(vs)", min_space_dim); - + } // Shortest-path closure is necessary to detect emptiness // and all (possibly implicit) constraints. shortest_path_closure_assign(); // If the shape is empty, this is a no-op. - if (marked_empty()) + if (marked_empty()) { return; - + } for (Variables_Set::const_iterator vsi = vars.begin(), - vsi_end = vars.end(); vsi != vsi_end; ++vsi) + vsi_end = vars.end(); vsi != vsi_end; ++vsi) { forget_all_dbm_constraints(*vsi + 1); + } // Shortest-path closure is preserved, but not reduction. reset_shortest_path_reduced(); PPL_ASSERT(OK()); @@ -3463,8 +3635,9 @@ if (w != 0) { ++t; - if (!expr.all_zeroes(1, w)) + if (!expr.all_zeroes(1, w)) { ++t; + } } // Since we are only able to record bounded differences, we can @@ -3472,9 +3645,9 @@ // coefficient (taking into account the denominator) is 1. // If this is not the case, we fall back to the general case // so as to over-approximate the constraint. - if (t == 1 && expr.get(Variable(w - 1)) != denominator) + if (t == 1 && expr.get(Variable(w - 1)) != denominator) { t = 2; - + } // Now we know the form of `expr': // - If t == 0, then expr == b, with `b' a constant; // - If t == 1, then expr == a*w + b, where `w != v' and `a == denominator'; @@ -3555,8 +3728,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, sum); @@ -3600,8 +3774,9 @@ // Approximating `sc_expr'. if (pinf_count <= 1) { const N& approx_i = dbm_0[i_dim]; - if (!is_plus_infinity(approx_i)) + if (!is_plus_infinity(approx_i)) { add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP); + } else { ++pinf_count; pinf_index = i_dim; @@ -3610,8 +3785,9 @@ // Approximating `-sc_expr'. if (neg_pinf_count <= 1) { const N& approx_minus_i = dbm[i_dim][0]; - if (!is_plus_infinity(approx_minus_i)) + if (!is_plus_infinity(approx_minus_i)) { add_mul_assign_r(neg_sum, coeff_i, approx_minus_i, ROUND_UP); + } else { ++neg_pinf_count; neg_pinf_index = i_dim; @@ -3626,8 +3802,9 @@ // Approximating `sc_expr'. if (pinf_count <= 1) { const N& approx_minus_i = dbm[i_dim][0]; - if (!is_plus_infinity(approx_minus_i)) + if (!is_plus_infinity(approx_minus_i)) { add_mul_assign_r(sum, coeff_i, approx_minus_i, ROUND_UP); + } else { ++pinf_count; pinf_index = i_dim; @@ -3636,8 +3813,9 @@ // Approximating `-sc_expr'. if (neg_pinf_count <= 1) { const N& approx_i = dbm_0[i_dim]; - if (!is_plus_infinity(approx_i)) + if (!is_plus_infinity(approx_i)) { add_mul_assign_r(neg_sum, coeff_i, approx_i, ROUND_UP); + } else { ++neg_pinf_count; neg_pinf_index = i_dim; @@ -3665,8 +3843,9 @@ // Exploit the upper approximation, if possible. if (pinf_count <= 1) { // Compute quotient (if needed). - if (down_sc_denom != 1) + if (down_sc_denom != 1) { div_assign_r(sum, sum, down_sc_denom, ROUND_UP); + } // Add the upper bound constraint, if meaningful. if (pinf_count == 0) { // Add the constraint `v <= sum'. @@ -3674,19 +3853,22 @@ // Deduce constraints of the form `v - u', where `u != v'. deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, sum); } - else + else { // Here `pinf_count == 1'. if (pinf_index != v - && sc_expr.get(Variable(pinf_index - 1)) == sc_denom) + && sc_expr.get(Variable(pinf_index - 1)) == sc_denom) { // Add the constraint `v - pinf_index <= sum'. dbm[pinf_index][v] = sum; + } + } } // Exploit the lower approximation, if possible. if (neg_pinf_count <= 1) { // Compute quotient (if needed). - if (down_sc_denom != 1) + if (down_sc_denom != 1) { div_assign_r(neg_sum, neg_sum, down_sc_denom, ROUND_UP); + } // Add the lower bound constraint, if meaningful. if (neg_pinf_count == 0) { // Add the constraint `v >= -neg_sum', i.e., `-v <= neg_sum'. @@ -3695,13 +3877,13 @@ // Deduce constraints of the form `u - v', where `u != v'. deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, neg_sum); } - else - // Here `neg_pinf_count == 1'. - if (neg_pinf_index != v - && sc_expr.get(Variable(neg_pinf_index - 1)) == sc_denom) + // Here `neg_pinf_count == 1'. + else if (neg_pinf_index != v + && sc_expr.get(Variable(neg_pinf_index - 1)) == sc_denom) { // Add the constraint `v - neg_pinf_index >= -neg_sum', // i.e., `neg_pinf_index - v <= neg_sum'. dbm[v][neg_pinf_index] = neg_sum; + } } } break; @@ -3725,13 +3907,15 @@ // Choose carefully: we are approximating `sc_expr'. const N& approx_i = (sign_i > 0) ? dbm_0[i_dim] : dbm[i_dim][0]; if (is_plus_infinity(approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = i_dim; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -3757,10 +3941,12 @@ // Deduce constraints of the form `v - u', where `u != v'. deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) - if (expr.get(Variable(pinf_index - 1)) == denominator) + else if (pinf_count == 1) { + if (expr.get(Variable(pinf_index - 1)) == denominator) { // Add the constraint `v - pinf_index <= sum'. add_dbm_constraint(pinf_index, v, sum); + } + } break; case GREATER_OR_EQUAL: @@ -3781,13 +3967,15 @@ // Choose carefully: we are approximating `-sc_expr'. const N& approx_i = (sign_i > 0) ? dbm[i_dim][0] : dbm_0[i_dim]; if (is_plus_infinity(approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = i_dim; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -3813,12 +4001,14 @@ // Deduce constraints of the form `u - v', where `u != v'. deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) + else if (pinf_count == 1) { if (pinf_index != v - && expr.get(Variable(pinf_index - 1)) == denominator) + && expr.get(Variable(pinf_index - 1)) == denominator) { // Add the constraint `v - pinf_index >= -sum', // i.e., `pinf_index - v <= sum'. add_dbm_constraint(v, pinf_index, sum); + } + } break; default: @@ -3836,27 +4026,27 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_image(v, e, d)", "d == 0"); - + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "e", expr); - + } // `var' should be one of the dimensions of the shape. const dimension_type v = var.id() + 1; - if (v > space_dim) + if (v > space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", var.id()); - + } // The image of an empty BDS is empty too. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } const Coefficient& b = expr.inhomogeneous_term(); // Number of non-zero coefficients in `expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -3866,8 +4056,9 @@ if (w != 0) { ++t; - if (!expr.all_zeroes(1, w)) + if (!expr.all_zeroes(1, w)) { ++t; + } } // Now we know the form of `expr': @@ -3885,8 +4076,9 @@ // Remove all constraints on `var'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } // Add the constraint `var == b/denominator'. add_dbm_constraint(0, v, b, denominator); add_dbm_constraint(v, 0, b, minus_denom); @@ -3902,9 +4094,10 @@ if (w == v) { // `expr' is of the form: a*v + b. if (a == denominator) { - if (b == 0) + if (b == 0) { // The transformation is the identity function. return; + } else { // Translate all the constraints on `var', // adding or subtracting the value `b/denominator'. @@ -3951,8 +4144,9 @@ // Remove all constraints on `var'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } if (a == denominator) { // Add the new constraint `v - w == b/denominator'. add_dbm_constraint(w, v, b, denominator); @@ -4008,8 +4202,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, pos_sum); @@ -4043,8 +4238,9 @@ // Approximating `sc_expr'. if (pos_pinf_count <= 1) { const N& up_approx_i = dbm_0[i_dim]; - if (!is_plus_infinity(up_approx_i)) + if (!is_plus_infinity(up_approx_i)) { add_mul_assign_r(pos_sum, coeff_i, up_approx_i, ROUND_UP); + } else { ++pos_pinf_count; pos_pinf_index = i_dim; @@ -4053,8 +4249,9 @@ // Approximating `-sc_expr'. if (neg_pinf_count <= 1) { const N& up_approx_minus_i = dbm[i_dim][0]; - if (!is_plus_infinity(up_approx_minus_i)) + if (!is_plus_infinity(up_approx_minus_i)) { add_mul_assign_r(neg_sum, coeff_i, up_approx_minus_i, ROUND_UP); + } else { ++neg_pinf_count; neg_pinf_index = i_dim; @@ -4069,8 +4266,9 @@ // Approximating `sc_expr'. if (pos_pinf_count <= 1) { const N& up_approx_minus_i = dbm[i_dim][0]; - if (!is_plus_infinity(up_approx_minus_i)) + if (!is_plus_infinity(up_approx_minus_i)) { add_mul_assign_r(pos_sum, coeff_i, up_approx_minus_i, ROUND_UP); + } else { ++pos_pinf_count; pos_pinf_index = i_dim; @@ -4079,8 +4277,9 @@ // Approximating `-sc_expr'. if (neg_pinf_count <= 1) { const N& up_approx_i = dbm_0[i_dim]; - if (!is_plus_infinity(up_approx_i)) + if (!is_plus_infinity(up_approx_i)) { add_mul_assign_r(neg_sum, coeff_i, up_approx_i, ROUND_UP); + } else { ++neg_pinf_count; neg_pinf_index = i_dim; @@ -4092,8 +4291,9 @@ // Remove all constraints on 'v'. forget_all_dbm_constraints(v); // Shortest-path closure is maintained, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } // Return immediately if no approximation could be computed. if (pos_pinf_count > 1 && neg_pinf_count > 1) { PPL_ASSERT(OK()); @@ -4122,13 +4322,12 @@ dbm[0][v] = pos_sum; // Deduce constraints of the form `v - u', where `u != v'. deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, pos_sum); - } - else - // Here `pos_pinf_count == 1'. - if (pos_pinf_index != v - && sc_expr.get(Variable(pos_pinf_index - 1)) == sc_denom) + } // Here `pos_pinf_count == 1'. + else if (pos_pinf_index != v + && sc_expr.get(Variable(pos_pinf_index - 1)) == sc_denom) { // Add the constraint `v - pos_pinf_index <= pos_sum'. dbm[pos_pinf_index][v] = pos_sum; + } } // Exploit the lower approximation, if possible. @@ -4152,13 +4351,13 @@ // Deduce constraints of the form `u - v', where `u != v'. deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, neg_sum); } - else - // Here `neg_pinf_count == 1'. - if (neg_pinf_index != v - && sc_expr.get(Variable(neg_pinf_index - 1)) == sc_denom) + // Here `neg_pinf_count == 1'. + else if (neg_pinf_index != v + && sc_expr.get(Variable(neg_pinf_index - 1)) == sc_denom) { // Add the constraint `v - neg_pinf_index >= -neg_sum', // i.e., `neg_pinf_index - v <= neg_sum'. dbm[v][neg_pinf_index] = neg_sum; + } } PPL_ASSERT(OK()); @@ -4180,33 +4379,35 @@ // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type lf_space_dim = lf.space_dimension(); - if (space_dim < lf_space_dim) + if (space_dim < lf_space_dim) { throw_dimension_incompatible("affine_form_image(var_id, l)", "l", lf); - + } // `var' should be one of the dimensions of the shape. const dimension_type var_id = var.id() + 1; - if (space_dim < var_id) + if (space_dim < var_id) { throw_dimension_incompatible("affine_form_image(var_id, l)", var.id()); - + } // The image of an empty BDS is empty too. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } // Number of non-zero coefficients in `lf': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type t = 0; // Index of the last non-zero coefficient in `lf', if any. dimension_type w_id = 0; // Get information about the number of non-zero coefficients in `lf'. - for (dimension_type i = lf_space_dim; i-- > 0; ) + for (dimension_type i = lf_space_dim; i-- > 0; ) { if (lf.coefficient(Variable(i)) != 0) { - if (t++ == 1) + if (t++ == 1) { break; - else + } + else { w_id = i + 1; + } } - + } typedef Interval FP_Interval_Type; const FP_Interval_Type& b = lf.inhomogeneous_term(); @@ -4249,12 +4450,13 @@ // Remove all constraints on `var'. forget_all_dbm_constraints(var_id); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - // Add the constraint `var >= lb && var <= ub'. - add_dbm_constraint(0, var_id, b_ub); - add_dbm_constraint(var_id, 0, b_mlb); - return; + } + // Add the constraint `var >= lb && var <= ub'. + add_dbm_constraint(0, var_id, b_ub); + add_dbm_constraint(var_id, 0, b_mlb); + return; } // case 2: var = (+/-1) * w + [-b_mlb, b_ub], where `w' can be `var' @@ -4281,9 +4483,10 @@ bool is_b_zero = (b_mlb == 0 && b_ub == 0); // Here `lf' is of the form: [+/-1, +/-1] * v + b. if (is_w_coeff_one) { - if (is_b_zero) + if (is_b_zero) { // The transformation is the identity function. return; + } else { // Translate all the constraints on `var' by adding the value // `b_ub' or subtracting the value `b_mlb'. @@ -4321,8 +4524,9 @@ // Remove all constraints on `var'. forget_all_dbm_constraints(var_id); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } if (is_w_coeff_one) { // Add the new constraints `var - w >= b_mlb' // `and var - w <= b_ub'. @@ -4360,9 +4564,9 @@ const Linear_Form< Interval >& lf, const dimension_type& space_dim) { // Shortest-path closure is maintained, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - + } reset_shortest_path_closed(); Linear_Form< Interval > minus_lf(lf); @@ -4414,15 +4618,15 @@ // dimension of `*this'. const dimension_type left_space_dim = left.space_dimension(); const dimension_type space_dim = space_dimension(); - if (space_dim < left_space_dim) + if (space_dim < left_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(left, right)", "left", left); - + } const dimension_type right_space_dim = right.space_dimension(); - if (space_dim < right_space_dim) + if (space_dim < right_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(left, right)", "right", right); - + } // Number of non-zero coefficients in `left': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type left_t = 0; @@ -4437,22 +4641,28 @@ typedef Interval FP_Interval_Type; // Get information about the number of non-zero coefficients in `left'. - for (dimension_type i = left_space_dim; i-- > 0; ) + for (dimension_type i = left_space_dim; i-- > 0; ) { if (left.coefficient(Variable(i)) != 0) { - if (left_t++ == 1) + if (left_t++ == 1) { break; - else + } + else { left_w_id = i; + } } + } // Get information about the number of non-zero coefficients in `right'. - for (dimension_type i = right_space_dim; i-- > 0; ) + for (dimension_type i = right_space_dim; i-- > 0; ) { if (right.coefficient(Variable(i)) != 0) { - if (right_t++ == 1) + if (right_t++ == 1) { break; - else + } + else { right_w_id = i; + } } + } const FP_Interval_Type& left_w_coeff = left.coefficient(Variable(left_w_id)); @@ -4493,9 +4703,10 @@ BD_Shape ::export_interval_constraints(U& dest) const { const dimension_type space_dim = space_dimension(); - if (space_dim > dest.space_dimension()) + if (space_dim > dest.space_dimension()) { throw std::invalid_argument( "BD_Shape::export_interval_constraints"); + } // Expose all the interval constraints. shortest_path_closure_assign(); @@ -4511,16 +4722,18 @@ for (dimension_type i = space_dim; i-- > 0; ) { // Set the upper bound. const N& u = dbm_0[i+1]; - if (!is_plus_infinity(u)) - if (!dest.restrict_upper(i, u.raw_value())) + if (!is_plus_infinity(u)) { + if (!dest.restrict_upper(i, u.raw_value())) { return; - + } + } // Set the lower bound. const N& negated_l = dbm[i+1][0]; if (!is_plus_infinity(negated_l)) { neg_assign_r(tmp, negated_l, ROUND_DOWN); - if (!dest.restrict_lower(i, tmp.raw_value())) + if (!dest.restrict_lower(i, tmp.raw_value())) { return; + } } } @@ -4756,13 +4969,15 @@ if (low_coeff != 0 || high_coeff != 0) { assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } } else { @@ -4771,13 +4986,15 @@ if (low_coeff != 0 || high_coeff != 0) { assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } } } @@ -4808,13 +5025,15 @@ bool do_update = false; assign_r(low_coeff, lv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } if (do_update) { @@ -4914,28 +5133,28 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_preimage(v, e, d)", "d == 0"); - + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr); - + } // `var' should be one of the dimensions of // the bounded difference shapes. const dimension_type v = var.id() + 1; - if (v > space_dim) + if (v > space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", var.id()); - + } // The image of an empty BDS is empty too. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } const Coefficient& b = expr.inhomogeneous_term(); // Number of non-zero coefficients in `expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -4945,8 +5164,9 @@ if (j != 0) { ++t; - if (!expr.all_zeroes(1, j)) + if (!expr.all_zeroes(1, j)) { ++t; + } } // Now we know the form of `expr': @@ -4960,8 +5180,9 @@ // Case 1: expr = n; remove all constraints on `var'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } PPL_ASSERT(OK()); return; } @@ -4971,16 +5192,18 @@ const Coefficient& a = expr.get(Variable(j - 1)); if (a == denominator || a == -denominator) { // Case 2: expr = a*w + b, with a = +/- denominator. - if (j == var.space_dimension()) + if (j == var.space_dimension()) { // Apply affine_image() on the inverse of this transformation. affine_image(var, denominator*var - b, a); + } else { // `expr == a*w + b', where `w != v'. // Remove all constraints on `var'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } PPL_ASSERT(OK()); } return; @@ -5002,8 +5225,9 @@ // Transformation not invertible: all constraints on `var' are lost. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } } PPL_ASSERT(OK()); } @@ -5016,32 +5240,34 @@ const Linear_Expression& ub_expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0"); - + } // Dimension-compatibility checks. // `var' should be one of the dimensions of the BD_Shape. const dimension_type bds_space_dim = space_dimension(); const dimension_type v = var.id() + 1; - if (v > bds_space_dim) + if (v > bds_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "v", var); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (bds_space_dim < lb_space_dim) + if (bds_space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (bds_space_dim < ub_space_dim) + if (bds_space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "ub", ub_expr); - + } // Any image of an empty BDS is empty. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } const Coefficient& b = ub_expr.inhomogeneous_term(); // Number of non-zero coefficients in `ub_expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -5051,8 +5277,9 @@ if (w != 0) { ++t; - if (!ub_expr.all_zeroes(1, w)) + if (!ub_expr.all_zeroes(1, w)) { ++t; + } } // Now we know the form of `ub_expr': @@ -5153,8 +5380,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -ub_expr; + } const Linear_Expression& sc_expr = is_sc ? ub_expr : minus_expr; PPL_DIRTY_TEMP(N, pos_sum); @@ -5183,8 +5411,9 @@ // Approximating `sc_expr'. if (pos_pinf_count <= 1) { const N& up_approx_i = dbm_0[i_dim]; - if (!is_plus_infinity(up_approx_i)) + if (!is_plus_infinity(up_approx_i)) { add_mul_assign_r(pos_sum, coeff_i, up_approx_i, ROUND_UP); + } else { ++pos_pinf_count; pos_pinf_index = i_dim; @@ -5199,8 +5428,9 @@ // Approximating `sc_expr'. if (pos_pinf_count <= 1) { const N& up_approx_minus_i = dbm[i_dim][0]; - if (!is_plus_infinity(up_approx_minus_i)) + if (!is_plus_infinity(up_approx_minus_i)) { add_mul_assign_r(pos_sum, coeff_i, up_approx_minus_i, ROUND_UP); + } else { ++pos_pinf_count; pos_pinf_index = i_dim; @@ -5241,12 +5471,12 @@ // Deduce constraints of the form `v - u', where `u != v'. deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, pos_sum); } - else - // Here `pos_pinf_count == 1'. - if (pos_pinf_index != v - && sc_expr.get(Variable(pos_pinf_index - 1)) == sc_denom) + // Here `pos_pinf_count == 1'. + else if (pos_pinf_index != v + && sc_expr.get(Variable(pos_pinf_index - 1)) == sc_denom) { // Add the constraint `v - pos_pinf_index <= pos_sum'. dbm[pos_pinf_index][v] = pos_sum; + } } PPL_ASSERT(OK()); } @@ -5259,32 +5489,34 @@ const Linear_Expression& ub_expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0"); - + } // Dimension-compatibility checks. // `var' should be one of the dimensions of the BD_Shape. const dimension_type space_dim = space_dimension(); const dimension_type v = var.id() + 1; - if (v > space_dim) + if (v > space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "v", var); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "ub", ub_expr); - + } // Any preimage of an empty BDS is empty. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } if (ub_expr.coefficient(var) == 0) { refine(var, LESS_OR_EQUAL, ub_expr, denominator); generalized_affine_preimage(var, GREATER_OR_EQUAL, @@ -5312,10 +5544,12 @@ PPL_ASSERT(!marked_empty()); generalized_affine_preimage(var, LESS_OR_EQUAL, ub_expr, denominator); - if (sgn(denominator) == sgn(lb_inverse_denom)) + if (sgn(denominator) == sgn(lb_inverse_denom)) { add_constraint(var >= new_var); - else + } + else { add_constraint(var <= new_var); + } // Remove the temporarily added dimension. remove_higher_space_dimensions(space_dim); } @@ -5328,33 +5562,34 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "d == 0"); - + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "e", expr); - + } // `var' should be one of the dimensions of the BDS. const dimension_type v = var.id() + 1; - if (v > space_dim) + if (v > space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", var.id()); - + } // The relation symbol cannot be a strict relation symbol. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is the disequality relation symbol"); - + } if (relsym == EQUAL) { // The relation symbol is "=": // this is just an affine image computation. @@ -5364,9 +5599,9 @@ // The image of an empty BDS is empty too. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } const Coefficient& b = expr.inhomogeneous_term(); // Number of non-zero coefficients in `expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -5376,8 +5611,9 @@ if (w != 0) { ++t; - if (!expr.all_zeroes(1, w)) + if (!expr.all_zeroes(1, w)) { ++t; + } } // Now we know the form of `expr': @@ -5457,11 +5693,13 @@ // Remove all constraints on `v'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - if (a == denominator) + } + if (a == denominator) { // Add the new constraint `v - w <= b/denominator'. add_dbm_constraint(w, v, d); + } else { // Here a == -denominator, so that we should be adding // the constraint `v <= b/denominator - w'. @@ -5510,12 +5748,14 @@ // Remove all constraints on `v'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - if (a == denominator) + } + if (a == denominator) { // Add the new constraint `v - w >= b/denominator', // i.e., `w - v <= -b/denominator'. add_dbm_constraint(v, w, d); + } else { // Here a == -denominator, so that we should be adding // the constraint `v >= -w + b/denominator', @@ -5560,8 +5800,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, sum); @@ -5593,13 +5834,15 @@ // Choose carefully: we are approximating `sc_expr'. const N& approx_i = (sign_i > 0) ? dbm_0[i_dim] : dbm[i_dim][0]; if (is_plus_infinity(approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = i_dim; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -5610,8 +5853,9 @@ // Remove all constraints on `v'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } // Return immediately if no approximation could be computed. if (pinf_count > 1) { PPL_ASSERT(OK()); @@ -5636,10 +5880,13 @@ // Deduce constraints of the form `v - u', where `u != v'. deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) - if (pinf_index != v && expr.get(Variable(pinf_index - 1)) == denominator) + else if (pinf_count == 1) { + if (pinf_index != v + && expr.get(Variable(pinf_index - 1)) == denominator) { // Add the constraint `v - pinf_index <= sum'. add_dbm_constraint(pinf_index, v, sum); + } + } break; case GREATER_OR_EQUAL: @@ -5659,13 +5906,15 @@ // Choose carefully: we are approximating `-sc_expr'. const N& approx_i = (sign_i > 0) ? dbm[i_dim][0] : dbm_0[i_dim]; if (is_plus_infinity(approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = i_dim; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -5676,8 +5925,9 @@ // Remove all constraints on `var'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } // Return immediately if no approximation could be computed. if (pinf_count > 1) { PPL_ASSERT(OK()); @@ -5702,11 +5952,14 @@ // Deduce constraints of the form `u - v', where `u != v'. deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) - if (pinf_index != v && expr.get(Variable(pinf_index - 1)) == denominator) + else if (pinf_count == 1) { + if (pinf_index != v + && expr.get(Variable(pinf_index - 1)) == denominator) { // Add the constraint `v - pinf_index >= -sum', // i.e., `pinf_index - v <= sum'. add_dbm_constraint(v, pinf_index, sum); + } + } break; default: @@ -5727,31 +5980,32 @@ // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type lhs_space_dim = lhs.space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e1", lhs); - + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e2", rhs); - + } // Strict relation symbols are not admitted for BDSs. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is the disequality relation symbol"); - + } // The image of an empty BDS is empty. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } // Number of non-zero coefficients in `lhs': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type t_lhs = 0; @@ -5760,8 +6014,9 @@ if (j_lhs != 0) { ++t_lhs; - if (!lhs.all_zeroes(1, j_lhs)) + if (!lhs.all_zeroes(1, j_lhs)) { ++t_lhs; + } --j_lhs; } @@ -5800,10 +6055,12 @@ const Coefficient& denom = lhs.coefficient(v); Relation_Symbol new_relsym = relsym; if (denom < 0) { - if (relsym == LESS_OR_EQUAL) + if (relsym == LESS_OR_EQUAL) { new_relsym = GREATER_OR_EQUAL; - else if (relsym == GREATER_OR_EQUAL) + } + else if (relsym == GREATER_OR_EQUAL) { new_relsym = LESS_OR_EQUAL; + } } Linear_Expression expr = rhs - b_lhs; generalized_affine_image(v, new_relsym, expr, denom); @@ -5813,15 +6070,16 @@ // Compute the set of variables occurring in `lhs'. std::vector lhs_vars; for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end(); - i != i_end; ++i) + i != i_end; ++i) { lhs_vars.push_back(i.variable()); - + } const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim); if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) { // `lhs' and `rhs' variables are disjoint. // Existentially quantify all variables in the lhs. - for (dimension_type i = lhs_vars.size(); i-- > 0; ) + for (dimension_type i = lhs_vars.size(); i-- > 0; ) { forget_all_dbm_constraints(lhs_vars[i].id() + 1); + } // Constrain the left hand side expression so that it is related to // the right hand side expression as dictated by `relsym'. // TODO: if the following constraint is NOT a bounded difference, @@ -5847,9 +6105,9 @@ #if 1 // Simplified computation (see the TODO note below). - for (dimension_type i = lhs_vars.size(); i-- > 0; ) + for (dimension_type i = lhs_vars.size(); i-- > 0; ) { forget_all_dbm_constraints(lhs_vars[i].id() + 1); - + } #else // Currently unnecessarily complex computation. // More accurate computation that is worth doing only if @@ -5867,8 +6125,9 @@ // NOTE: enforce shortest-path closure for precision. shortest_path_closure_assign(); PPL_ASSERT(!marked_empty()); - for (dimension_type i = lhs_vars.size(); i-- > 0; ) + for (dimension_type i = lhs_vars.size(); i-- > 0; ) { forget_all_dbm_constraints(lhs_vars[i].id() + 1); + } // Constrain the new dimension so that it is related to // the left hand side as dictated by `relsym'. // TODO: each one of the following constraints is definitely NOT @@ -5907,34 +6166,35 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "d == 0"); - + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", "e", expr); - + } // `var' should be one of the dimensions of the BDS. const dimension_type v = var.id() + 1; - if (v > space_dim) + if (v > space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", var.id()); - + } // The relation symbol cannot be a strict relation symbol. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is the disequality relation symbol"); - + } if (relsym == EQUAL) { // The relation symbol is "=": // this is just an affine preimage computation. @@ -5944,9 +6204,9 @@ // The preimage of an empty BDS is empty too. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } // Check whether the preimage of this affine relation can be easily // computed as the image of its inverse relation. const Coefficient& expr_v = expr.coefficient(var); @@ -5965,14 +6225,16 @@ refine(var, relsym, expr, denominator); // If the shrunk BD_Shape is empty, its preimage is empty too; ... - if (is_empty()) + if (is_empty()) { return; + } // ... otherwise, since the relation was not invertible, // we just forget all constraints on `v'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } PPL_ASSERT(OK()); } @@ -5986,31 +6248,32 @@ // of `*this'. const dimension_type bds_space_dim = space_dimension(); const dimension_type lhs_space_dim = lhs.space_dimension(); - if (bds_space_dim < lhs_space_dim) + if (bds_space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)", "e1", lhs); - + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (bds_space_dim < rhs_space_dim) + if (bds_space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)", "e2", rhs); - + } // Strict relation symbols are not admitted for BDSs. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2)", "r is the disequality relation symbol"); - + } // The preimage of an empty BDS is empty. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } // Number of non-zero coefficients in `lhs': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type t_lhs = 0; @@ -6019,8 +6282,9 @@ if (j_lhs != 0) { ++t_lhs; - if (!lhs.all_zeroes(1, j_lhs)) + if (!lhs.all_zeroes(1, j_lhs)) { ++t_lhs; + } --j_lhs; } @@ -6041,10 +6305,12 @@ const Coefficient& denom = lhs.coefficient(v); Relation_Symbol new_relsym = relsym; if (denom < 0) { - if (relsym == LESS_OR_EQUAL) + if (relsym == LESS_OR_EQUAL) { new_relsym = GREATER_OR_EQUAL; - else if (relsym == GREATER_OR_EQUAL) + } + else if (relsym == GREATER_OR_EQUAL) { new_relsym = LESS_OR_EQUAL; + } } Linear_Expression expr = rhs - b_lhs; generalized_affine_preimage(v, new_relsym, expr, denom); @@ -6054,9 +6320,9 @@ // Compute the set of variables occurring in `lhs'. std::vector lhs_vars; for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end(); - i != i_end; ++i) + i != i_end; ++i) { lhs_vars.push_back(i.variable()); - + } const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim); if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) { // `lhs' and `rhs' variables are disjoint. @@ -6082,11 +6348,13 @@ } // If the shrunk BD_Shape is empty, its preimage is empty too; ... - if (is_empty()) + if (is_empty()) { return; + } // Existentially quantify all variables in the lhs. - for (dimension_type i = lhs_vars.size(); i-- > 0; ) + for (dimension_type i = lhs_vars.size(); i-- > 0; ) { forget_all_dbm_constraints(lhs_vars[i].id() + 1); + } } else { @@ -6103,8 +6371,9 @@ // NOTE: enforce shortest-path closure for precision. shortest_path_closure_assign(); PPL_ASSERT(!marked_empty()); - for (dimension_type i = lhs_vars.size(); i-- > 0; ) + for (dimension_type i = lhs_vars.size(); i-- > 0; ) { forget_all_dbm_constraints(lhs_vars[i].id() + 1); + } // Constrain the new dimension so that it is related to // the left hand side as dictated by `relsym'. // Note: if `rhs == a_rhs*v + b_rhs' where `a_rhs' is in {0, 1}, @@ -6143,8 +6412,9 @@ cs.set_space_dimension(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cs = Constraint_System::zero_dim_empty(); + } return cs; } @@ -6223,8 +6493,9 @@ cs.set_space_dimension(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cs = Constraint_System::zero_dim_empty(); + } return cs; } @@ -6303,20 +6574,21 @@ BD_Shape::expand_space_dimension(Variable var, dimension_type m) { dimension_type old_dim = space_dimension(); // `var' should be one of the dimensions of the vector space. - if (var.space_dimension() > old_dim) + if (var.space_dimension() > old_dim) { throw_dimension_incompatible("expand_space_dimension(v, m)", "v", var); + } // The space dimension of the resulting BDS should not // overflow the maximum allowed space dimension. - if (m > max_space_dimension() - space_dimension()) + if (m > max_space_dimension() - space_dimension()) { throw_invalid_argument("expand_dimension(v, m)", "adding m new space dimensions exceeds " "the maximum allowed space dimension"); - + } // Nothing to do, if no dimensions must be added. - if (m == 0) + if (m == 0) { return; - + } // Add the required new dimensions. add_space_dimensions_and_embed(m); @@ -6336,8 +6608,9 @@ } // In general, adding a constraint does not preserve the shortest-path // closure or reduction of the bounded difference shape. - if (marked_shortest_path_closed()) + if (marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -6347,24 +6620,24 @@ Variable dest) { const dimension_type space_dim = space_dimension(); // `dest' should be one of the dimensions of the BDS. - if (dest.space_dimension() > space_dim) + if (dest.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", "v", dest); - + } // The folding of no dimensions is a no-op. - if (vars.empty()) + if (vars.empty()) { return; - + } // All variables in `vars' should be dimensions of the BDS. - if (vars.space_dimension() > space_dim) + if (vars.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", vars.space_dimension()); - + } // Moreover, `dest.id()' should not occur in `vars'. - if (vars.find(dest.id()) != vars.end()) + if (vars.find(dest.id()) != vars.end()) { throw_invalid_argument("fold_space_dimensions(vs, v)", "v should not occur in vs"); - + } shortest_path_closure_assign(); if (!marked_empty()) { // Recompute the elements of the row and the column corresponding @@ -6389,19 +6662,21 @@ template void BD_Shape::drop_some_non_integer_points(Complexity_Class) { - if (std::numeric_limits::is_integer) + if (std::numeric_limits::is_integer) { return; - + } const dimension_type space_dim = space_dimension(); shortest_path_closure_assign(); - if (space_dim == 0 || marked_empty()) + if (space_dim == 0 || marked_empty()) { return; - + } for (dimension_type i = space_dim + 1; i-- > 0; ) { DB_Row& dbm_i = dbm[i]; - for (dimension_type j = space_dim + 1; j-- > 0; ) - if (i != j) + for (dimension_type j = space_dim + 1; j-- > 0; ) { + if (i != j) { drop_some_non_integer_points_helper(dbm_i[j]); + } + } } PPL_ASSERT(OK()); } @@ -6413,17 +6688,17 @@ // Dimension-compatibility check. const dimension_type space_dim = space_dimension(); const dimension_type min_space_dim = vars.space_dimension(); - if (space_dim < min_space_dim) + if (space_dim < min_space_dim) { throw_dimension_incompatible("drop_some_non_integer_points(vs, cmpl)", min_space_dim); - - if (std::numeric_limits::is_integer || min_space_dim == 0) + } + if (std::numeric_limits::is_integer || min_space_dim == 0) { return; - + } shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } const Variables_Set::const_iterator v_begin = vars.begin(); const Variables_Set::const_iterator v_end = vars.end(); PPL_ASSERT(v_begin != v_end); @@ -6441,8 +6716,9 @@ DB_Row& dbm_i = dbm[i]; for (Variables_Set::const_iterator v_j = v_begin; v_j != v_end; ++v_j) { const dimension_type j = *v_j + 1; - if (i != j) + if (i != j) { drop_some_non_integer_points_helper(dbm_i[j]); + } } } PPL_ASSERT(OK()); @@ -6453,26 +6729,30 @@ std::ostream& IO_Operators::operator<<(std::ostream& s, const BD_Shape& bds) { typedef typename BD_Shape::coefficient_type N; - if (bds.is_universe()) + if (bds.is_universe()) { s << "true"; + } else { // We control empty bounded difference shape. dimension_type n = bds.space_dimension(); - if (bds.marked_empty()) + if (bds.marked_empty()) { s << "false"; + } else { PPL_DIRTY_TEMP(N, v); bool first = true; - for (dimension_type i = 0; i <= n; ++i) + for (dimension_type i = 0; i <= n; ++i) { for (dimension_type j = i + 1; j <= n; ++j) { const N& c_i_j = bds.dbm[i][j]; const N& c_j_i = bds.dbm[j][i]; if (is_additive_inverse(c_j_i, c_i_j)) { // We will print an equality. - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } if (i == 0) { // We have got a equality constraint with one variable. s << Variable(j - 1); @@ -6497,10 +6777,12 @@ else { // We will print a non-strict inequality. if (!is_plus_infinity(c_j_i)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } if (i == 0) { // We have got a constraint with only one variable. s << Variable(j - 1); @@ -6525,10 +6807,12 @@ } } if (!is_plus_infinity(c_i_j)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } if (i == 0) { // We have got a constraint with only one variable. s << Variable(j - 1); @@ -6553,6 +6837,7 @@ } } } + } } } return s; @@ -6573,12 +6858,15 @@ template bool BD_Shape::ascii_load(std::istream& s) { - if (!status.ascii_load(s)) + if (!status.ascii_load(s)) { return false; - if (!dbm.ascii_load(s)) + } + if (!dbm.ascii_load(s)) { return false; - if (!redundancy_dbm.ascii_load(s)) + } + if (!redundancy_dbm.ascii_load(s)) { return false; + } return true; } @@ -6593,20 +6881,20 @@ bool BD_Shape::OK() const { // Check whether the difference-bound matrix is well-formed. - if (!dbm.OK()) + if (!dbm.OK()) { return false; - + } // Check whether the status information is legal. - if (!status.OK()) + if (!status.OK()) { return false; - + } // An empty BDS is OK. - if (marked_empty()) + if (marked_empty()) { return true; - + } // MINUS_INFINITY cannot occur at all. - for (dimension_type i = dbm.num_rows(); i-- > 0; ) - for (dimension_type j = dbm.num_rows(); j-- > 0; ) + for (dimension_type i = dbm.num_rows(); i-- > 0; ) { + for (dimension_type j = dbm.num_rows(); j-- > 0; ) { if (is_minus_infinity(dbm[i][j])) { #ifndef NDEBUG using namespace Parma_Polyhedra_Library::IO_Operators; @@ -6616,9 +6904,10 @@ #endif return false; } - + } + } // On the main diagonal only PLUS_INFINITY can occur. - for (dimension_type i = dbm.num_rows(); i-- > 0; ) + for (dimension_type i = dbm.num_rows(); i-- > 0; ) { if (!is_plus_infinity(dbm[i][i])) { #ifndef NDEBUG using namespace Parma_Polyhedra_Library::IO_Operators; @@ -6628,7 +6917,7 @@ #endif return false; } - + } // Check whether the shortest-path closure information is legal. if (marked_shortest_path_closed()) { BD_Shape x = *this; @@ -6651,8 +6940,8 @@ // Check whether the shortest-path reduction information is legal. if (marked_shortest_path_reduced()) { // A non-redundant constraint cannot be equal to PLUS_INFINITY. - for (dimension_type i = dbm.num_rows(); i-- > 0; ) - for (dimension_type j = dbm.num_rows(); j-- > 0; ) + for (dimension_type i = dbm.num_rows(); i-- > 0; ) { + for (dimension_type j = dbm.num_rows(); j-- > 0; ) { if (!redundancy_dbm[i][j] && is_plus_infinity(dbm[i][j])) { #ifndef NDEBUG using namespace Parma_Polyhedra_Library::IO_Operators; @@ -6662,7 +6951,8 @@ #endif return false; } - + } + } BD_Shape x = *this; x.reset_shortest_path_reduced(); x.shortest_path_reduction_assign(); diff -Nru ppl-1.1/src/BD_Shape_types.hh ppl-1.2/src/BD_Shape_types.hh --- ppl-1.1/src/BD_Shape_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BD_Shape_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/BDS_Status.cc ppl-1.2/src/BDS_Status.cc --- ppl-1.1/src/BDS_Status.cc 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/src/BDS_Status.cc 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,42 @@ +/* BD_Shape::Status class implementation: data objects. + Copyright (C) 2001-2010 Roberto Bagnara + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) + +This file is part of the Parma Polyhedra Library (PPL). + +The PPL is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The PPL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. + +For the most up-to-date information see the Parma Polyhedra Library +site: http://bugseng.com/products/ppl/ . */ + +#include "ppl-config.h" + +namespace Parma_Polyhedra_Library { + +namespace Implementation { + +namespace BD_Shapes { + +// These are the keywords that indicate the individual assertions. +const char* zero_dim_univ = "ZE"; +const char* empty = "EM"; +const char* sp_closed = "SPC"; +const char* sp_reduced = "SPR"; + +} // namespace BD_Shapes + +} // namespace Implementation + +} // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/src/BDS_Status_idefs.hh ppl-1.2/src/BDS_Status_idefs.hh --- ppl-1.1/src/BDS_Status_idefs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BDS_Status_idefs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* BD_Shape::Status class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/BDS_Status_inlines.hh ppl-1.2/src/BDS_Status_inlines.hh --- ppl-1.1/src/BDS_Status_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BDS_Status_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* BD_Shape::Status class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -72,9 +72,10 @@ inline void BD_Shape::Status::reset_zero_dim_univ() { // This is a no-op if the current status is not zero-dim. - if (flags == ZERO_DIM_UNIV) + if (flags == ZERO_DIM_UNIV) { // In the zero-dim space, if it is not the universe it is empty. flags = EMPTY; + } } template @@ -143,15 +144,17 @@ template bool BD_Shape::Status::OK() const { - if (test_zero_dim_univ()) + if (test_zero_dim_univ()) { // Zero-dim universe is OK. return true; + } if (test_empty()) { Status copy = *this; copy.reset_empty(); - if (copy.test_zero_dim_univ()) + if (copy.test_zero_dim_univ()) { return true; + } else { #ifndef NDEBUG std::cerr << "The empty flag is incompatible with any other one." @@ -163,8 +166,9 @@ // Shortest-path reduction implies shortest-path closure. if (test_shortest_path_reduced()) { - if (test_shortest_path_closed()) + if (test_shortest_path_closed()) { return true; + } else { #ifndef NDEBUG std::cerr << "The shortest-path reduction flag should also imply " @@ -185,10 +189,10 @@ namespace BD_Shapes { // These are the keywords that indicate the individual assertions. -const std::string zero_dim_univ = "ZE"; -const std::string empty = "EM"; -const std::string sp_closed = "SPC"; -const std::string sp_reduced = "SPR"; +extern const char* zero_dim_univ; +extern const char* empty; +extern const char* sp_closed; +extern const char* sp_reduced; const char yes = '+'; const char no = '-'; const char separator = ' '; @@ -201,12 +205,13 @@ is on; it is set to false otherwise. */ inline bool -get_field(std::istream& s, const std::string& keyword, bool& positive) { +get_field(std::istream& s, const char* keyword, bool& positive) { std::string str; if (!(s >> str) || (str[0] != yes && str[0] != no) - || str.substr(1) != keyword) + || str.substr(1) != keyword) { return false; + } positive = (str[0] == yes); return true; } @@ -234,29 +239,39 @@ using namespace Implementation::BD_Shapes; PPL_UNINITIALIZED(bool, positive); - if (!get_field(s, zero_dim_univ, positive)) + if (!get_field(s, zero_dim_univ, positive)) { return false; - if (positive) + } + if (positive) { set_zero_dim_univ(); + } - if (!get_field(s, empty, positive)) + if (!get_field(s, empty, positive)) { return false; - if (positive) + } + if (positive) { set_empty(); + } - if (!get_field(s, sp_closed, positive)) + if (!get_field(s, sp_closed, positive)) { return false; - if (positive) + } + if (positive) { set_shortest_path_closed(); - else + } + else { reset_shortest_path_closed(); + } - if (!get_field(s, sp_reduced, positive)) + if (!get_field(s, sp_reduced, positive)) { return false; - if (positive) + } + if (positive) { set_shortest_path_reduced(); - else + } + else { reset_shortest_path_reduced(); + } // Check invariants. PPL_ASSERT(OK()); diff -Nru ppl-1.1/src/BHRZ03_Certificate.cc ppl-1.2/src/BHRZ03_Certificate.cc --- ppl-1.1/src/BHRZ03_Certificate.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BHRZ03_Certificate.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* BHRZ03_Certificate class implementation (non-inline member functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,7 +24,7 @@ #include "ppl-config.h" #include "BHRZ03_Certificate_defs.hh" #include "Polyhedron_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace PPL = Parma_Polyhedra_Library; @@ -53,15 +53,16 @@ for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { ++num_constraints; - if (i->is_equality()) + if (i->is_equality()) { --affine_dim; + } } PPL_ASSERT(lin_space_dim == 0); PPL_ASSERT(num_points == 0); const Generator_System& gs = ph.minimized_generators(); for (Generator_System::const_iterator i = gs.begin(), - gs_end = gs.end(); i != gs_end; ++i) + gs_end = gs.end(); i != gs_end; ++i) { switch (i->type()) { case Generator::POINT: // Intentionally fall through. @@ -80,6 +81,7 @@ ++lin_space_dim; break; } + } PPL_ASSERT(OK()); // TODO: this is an inefficient workaround. @@ -89,29 +91,35 @@ // We have to reinforce the (normal) minimization of the constraint // system. The future, lazy implementation of the strong minimization // process will solve this problem. - if (!ph.is_necessarily_closed()) + if (!ph.is_necessarily_closed()) { ph.minimize(); + } } int PPL::BHRZ03_Certificate::compare(const BHRZ03_Certificate& y) const { PPL_ASSERT(OK() && y.OK()); - if (affine_dim != y.affine_dim) + if (affine_dim != y.affine_dim) { return (affine_dim > y.affine_dim) ? 1 : -1; - if (lin_space_dim != y.lin_space_dim) + } + if (lin_space_dim != y.lin_space_dim) { return (lin_space_dim > y.lin_space_dim) ? 1 : -1; - if (num_constraints != y.num_constraints) + } + if (num_constraints != y.num_constraints) { return (num_constraints > y.num_constraints) ? 1 : -1; - if (num_points != y.num_points) + } + if (num_points != y.num_points) { return (num_points > y.num_points) ? 1 : -1; - + } const dimension_type space_dim = num_rays_null_coord.size(); PPL_ASSERT(num_rays_null_coord.size() == y.num_rays_null_coord.size()); // Note: iterating upwards, because we have to check first // the number of rays having more NON-zero coordinates. - for (dimension_type i = 0; i < space_dim; ++i) - if (num_rays_null_coord[i] != y.num_rays_null_coord[i]) + for (dimension_type i = 0; i < space_dim; ++i) { + if (num_rays_null_coord[i] != y.num_rays_null_coord[i]) { return (num_rays_null_coord[i] > y.num_rays_null_coord[i]) ? 1 : -1; + } + } // All components are equal. return 0; } @@ -142,8 +150,9 @@ for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { ++ph_num_constraints; - if (i->is_equality()) + if (i->is_equality()) { --ph_affine_dim; + } } // TODO: this is an inefficient workaround. // For NNC polyhedra, constraints might be no longer up-to-date @@ -152,13 +161,13 @@ // We have to reinforce the (normal) minimization of the constraint // system. The future, lazy implementation of the strong minimization // process will solve this problem. - if (!ph.is_necessarily_closed()) + if (!ph.is_necessarily_closed()) { ph.minimize(); - + } // If the dimension of `ph' is increasing, the chain is stabilizing. - if (ph_affine_dim > affine_dim) + if (ph_affine_dim > affine_dim) { return 1; - + } // At this point the two polyhedra must have the same dimension. PPL_ASSERT(ph_affine_dim == affine_dim); @@ -169,7 +178,7 @@ dimension_type ph_num_points = 0; const Generator_System& gs = ph.minimized_generators(); for (Generator_System::const_iterator i = gs.begin(), - gs_end = gs.end(); i != gs_end; ++i) + gs_end = gs.end(); i != gs_end; ++i) { switch (i->type()) { case Generator::POINT: // Intentionally fall through. @@ -184,6 +193,7 @@ ++ph_lin_space_dim; break; } + } // TODO: this is an inefficient workaround. // For NNC polyhedra, constraints might be no longer up-to-date // (and hence, neither minimized) due to the strong minimization @@ -191,14 +201,14 @@ // We have to reinforce the (normal) minimization of the constraint // system. The future, lazy implementation of the strong minimization // process will solve this problem. - if (!ph.is_necessarily_closed()) + if (!ph.is_necessarily_closed()) { ph.minimize(); - + } // If the dimension of the lineality space is increasing, // then the chain is stabilizing. - if (ph_lin_space_dim > lin_space_dim) + if (ph_lin_space_dim > lin_space_dim) { return 1; - + } // At this point the lineality space of the two polyhedra must have // the same dimension. PPL_ASSERT(ph_lin_space_dim == lin_space_dim); @@ -206,29 +216,31 @@ // If the number of constraints of `ph' is decreasing, then the chain // is stabilizing. If it is increasing, the chain is not stabilizing. // If they are equal, further investigation is needed. - if (ph_num_constraints != num_constraints) + if (ph_num_constraints != num_constraints) { return (ph_num_constraints < num_constraints) ? 1 : -1; - + } // If the number of points of `ph' is decreasing, then the chain // is stabilizing. If it is increasing, the chain is not stabilizing. // If they are equal, further investigation is needed. - if (ph_num_points != num_points) + if (ph_num_points != num_points) { return (ph_num_points < num_points) ? 1 : -1; - + } // The speculative optimization was not worth: // compute information about rays. std::vector ph_num_rays_null_coord(ph.space_dim, 0); for (Generator_System::const_iterator i = gs.begin(), - gs_end = gs.end(); i != gs_end; ++i) - if (i->is_ray()) + gs_end = gs.end(); i != gs_end; ++i) { + if (i->is_ray()) { ++ph_num_rays_null_coord[i->expression().num_zeroes(1, space_dim + 1)]; - + } + } // Compare (lexicographically) the two vectors: // if ph_num_rays_null_coord < num_rays_null_coord the chain is stabilizing. - for (dimension_type i = 0; i < space_dim; ++i) - if (ph_num_rays_null_coord[i] != num_rays_null_coord[i]) + for (dimension_type i = 0; i < space_dim; ++i) { + if (ph_num_rays_null_coord[i] != num_rays_null_coord[i]) { return (ph_num_rays_null_coord[i] < num_rays_null_coord[i]) ? 1 : -1; - + } + } // All components are equal. return 0; } diff -Nru ppl-1.1/src/BHRZ03_Certificate_defs.hh ppl-1.2/src/BHRZ03_Certificate_defs.hh --- ppl-1.1/src/BHRZ03_Certificate_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BHRZ03_Certificate_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* BHRZ03_Certificate class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,6 @@ #include "BHRZ03_Certificate_types.hh" #include "Polyhedron_types.hh" #include "globals_defs.hh" -#include "assert.hh" #include //! The convergence certificate for the BHRZ03 widening operator. diff -Nru ppl-1.1/src/BHRZ03_Certificate_inlines.hh ppl-1.2/src/BHRZ03_Certificate_inlines.hh --- ppl-1.1/src/BHRZ03_Certificate_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BHRZ03_Certificate_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* BHRZ03_Certificate class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,6 +24,8 @@ #ifndef PPL_BHRZ03_Certificate_inlines_hh #define PPL_BHRZ03_Certificate_inlines_hh 1 +#include "assertions.hh" + namespace Parma_Polyhedra_Library { inline diff -Nru ppl-1.1/src/BHRZ03_Certificate_types.hh ppl-1.2/src/BHRZ03_Certificate_types.hh --- ppl-1.1/src/BHRZ03_Certificate_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/BHRZ03_Certificate_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Bit_Matrix.cc ppl-1.2/src/Bit_Matrix.cc --- ppl-1.1/src/Bit_Matrix.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Bit_Matrix.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Bit_Matrix class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -33,7 +33,7 @@ namespace PPL = Parma_Polyhedra_Library; PPL::Bit_Matrix& -PPL::Bit_Matrix::operator=(const Bit_Matrix& y){ +PPL::Bit_Matrix::operator=(const Bit_Matrix& y) { rows = y.rows; row_size = y.row_size; PPL_ASSERT(OK()); @@ -43,9 +43,9 @@ void PPL::Bit_Matrix::sort_rows() { const dimension_type num_elems = rows.size(); - if (num_elems < 2) + if (num_elems < 2) { return; - + } // Build the function objects implementing indirect sort comparison, // indirect unique comparison and indirect swap operation. using namespace Implementation; @@ -82,16 +82,18 @@ dimension_type i = new_rows_size-1; new_rows[i].m_swap(row); // Steal the old rows. - while (i-- > 0) + while (i-- > 0) { new_rows[i].m_swap(rows[i]); + } // Put the new rows into place. using std::swap; swap(rows, new_rows); } - else + else { // Reallocation will NOT take place: append an empty row // and swap it with the new row. rows.insert(rows.end(), Bit_Row())->m_swap(row); + } PPL_ASSERT(OK()); } @@ -101,10 +103,12 @@ const dimension_type nrows = num_rows(); const dimension_type ncols = num_columns(); Bit_Matrix tmp(ncols, nrows); - for (dimension_type i = nrows; i-- > 0; ) + for (dimension_type i = nrows; i-- > 0; ) { for (unsigned long j = x[i].last(); - j != C_Integer::max; j = x[i].prev(j)) + j != C_Integer::max; j = x[i].prev(j)) { tmp[j].set(i); + } + } m_swap(tmp); PPL_ASSERT(OK()); } @@ -114,10 +118,12 @@ const dimension_type y_num_rows = y.num_rows(); const dimension_type y_num_columns = y.num_columns(); Bit_Matrix tmp(y_num_columns, y_num_rows); - for (dimension_type i = y_num_rows; i-- > 0; ) + for (dimension_type i = y_num_rows; i-- > 0; ) { for (unsigned long j = y[i].last(); - j != C_Integer::max; j = y[i].prev(j)) + j != C_Integer::max; j = y[i].prev(j)) { tmp[j].set(i); + } + } m_swap(tmp); PPL_ASSERT(OK()); } @@ -131,8 +137,9 @@ const dimension_type num_preserved_rows = std::min(old_num_rows, new_n_rows); Bit_Matrix& x = *this; - for (dimension_type i = num_preserved_rows; i-- > 0; ) + for (dimension_type i = num_preserved_rows; i-- > 0; ) { x[i].clear_from(new_n_columns); + } } row_size = new_n_columns; if (new_n_rows > old_num_rows) { @@ -142,19 +149,22 @@ new_rows.reserve(compute_capacity(new_n_rows, max_num_rows())); new_rows.insert(new_rows.end(), new_n_rows, Bit_Row()); // Steal the old rows. - for (dimension_type i = old_num_rows; i-- > 0; ) + for (dimension_type i = old_num_rows; i-- > 0; ) { new_rows[i].m_swap(rows[i]); + } // Put the new vector into place. using std::swap; swap(rows, new_rows); } - else + else { // Reallocation will NOT take place. rows.insert(rows.end(), new_n_rows - old_num_rows, Bit_Row()); + } } - else if (new_n_rows < old_num_rows) + else if (new_n_rows < old_num_rows) { // Drop some rows. rows.resize(new_n_rows); + } PPL_ASSERT(OK()); } @@ -166,8 +176,9 @@ s << num_rows() << separator << 'x' << separator << num_columns() << "\n"; for (dimension_type i = 0; i < num_rows(); ++i) { - for (dimension_type j = 0; j < num_columns(); ++j) + for (dimension_type j = 0; j < num_columns(); ++j) { s << x[i][j] << separator; + } s << "\n"; } } @@ -180,25 +191,31 @@ dimension_type nrows; dimension_type ncols; std::string str; - if (!(s >> nrows)) + if (!(s >> nrows)) { return false; - if (!(s >> str) || str != "x") + } + if (!(s >> str) || str != "x") { return false; - if (!(s >> ncols)) + } + if (!(s >> ncols)) { return false; + } resize(nrows, ncols); - for (dimension_type i = 0; i < num_rows(); ++i) + for (dimension_type i = 0; i < num_rows(); ++i) { for (dimension_type j = 0; j < num_columns(); ++j) { int bit; - if (!(s >> bit)) + if (!(s >> bit)) { return false; - if (bit != 0) + } + if (bit != 0) { x[i].set(j); - else + } + else { x[i].clear(j); + } } - + } // Check invariants. PPL_ASSERT(OK()); return true; @@ -207,8 +224,9 @@ PPL::memory_size_type PPL::Bit_Matrix::external_memory_in_bytes() const { memory_size_type n = rows.capacity() * sizeof(Dense_Row); - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { n += rows[i].external_memory_in_bytes(); + } return n; } @@ -222,8 +240,9 @@ const Bit_Matrix& x = *this; for (dimension_type i = num_rows(); i-- > 0; ) { const Bit_Row& row = x[i]; - if (!row.OK()) + if (!row.OK()) { return false; + } else if (row.last() != C_Integer::max && row.last() >= row_size) { #ifndef NDEBUG @@ -243,9 +262,11 @@ bool PPL::Bit_Matrix::check_sorted() const { const Bit_Matrix& x = *this; - for (dimension_type i = num_rows(); i-- > 1; ) - if (compare(x[i-1], x[i]) > 0) + for (dimension_type i = num_rows(); i-- > 1; ) { + if (compare(x[i-1], x[i]) > 0) { return false; + } + } return true; } #endif @@ -255,11 +276,13 @@ PPL::operator==(const Bit_Matrix& x, const Bit_Matrix& y) { const dimension_type x_num_rows = x.num_rows(); if (x_num_rows != y.num_rows() - || x.num_columns() != y.num_columns()) + || x.num_columns() != y.num_columns()) { return false; - for (dimension_type i = x_num_rows; i-- > 0; ) - if (x[i] != y[i]) + } + for (dimension_type i = x_num_rows; i-- > 0; ) { + if (x[i] != y[i]) { return false; + } + } return true; } - diff -Nru ppl-1.1/src/Bit_Matrix_defs.hh ppl-1.2/src/Bit_Matrix_defs.hh --- ppl-1.1/src/Bit_Matrix_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Bit_Matrix_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Bit_Matrix class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Bit_Matrix_inlines.hh ppl-1.2/src/Bit_Matrix_inlines.hh --- ppl-1.1/src/Bit_Matrix_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Bit_Matrix_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Bit_Matrix class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,8 +24,8 @@ #ifndef PPL_Bit_Matrix_inlines_hh #define PPL_Bit_Matrix_inlines_hh 1 +#include "assertions.hh" #include -#include "assert.hh" namespace Parma_Polyhedra_Library { @@ -62,8 +62,9 @@ // The number of rows to be erased cannot be greater // than the actual number of the rows of the matrix. PPL_ASSERT(n <= rows.size()); - if (n != 0) + if (n != 0) { rows.resize(rows.size() - n); + } PPL_ASSERT(OK()); } @@ -78,9 +79,8 @@ inline void Bit_Matrix::m_swap(Bit_Matrix& y) { - using std::swap; - swap(row_size, y.row_size); - swap(rows, y.rows); + std::swap(row_size, y.row_size); + std::swap(rows, y.rows); } inline Bit_Row& @@ -109,8 +109,7 @@ Bit_Matrix::clear() { // Clear `rows' and minimize its capacity. std::vector tmp; - using std::swap; - swap(tmp, rows); + std::swap(tmp, rows); row_size = 0; } diff -Nru ppl-1.1/src/Bit_Matrix_types.hh ppl-1.2/src/Bit_Matrix_types.hh --- ppl-1.1/src/Bit_Matrix_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Bit_Matrix_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Bit_Row.cc ppl-1.2/src/Bit_Row.cc --- ppl-1.1/src/Bit_Row.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Bit_Row.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Bit_Row class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -23,7 +23,7 @@ #include "ppl-config.h" #include "Bit_Row_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include "C_Integer.hh" namespace PPL = Parma_Polyhedra_Library; @@ -35,9 +35,10 @@ mp_srcptr p = vec->_mp_d; for (mp_size_t li = 0; li < vec_size; ++li, ++p) { const mp_limb_t limb = *p; - if (limb != 0) + if (limb != 0) { return static_cast(li) * PPL_BITS_PER_GMP_LIMB + Implementation::first_one(limb); + } } return C_Integer::max; } @@ -46,21 +47,24 @@ PPL::Bit_Row::next(unsigned long position) const { ++position; - // The alternative implementation using the mpz_scan1() function - // of GMP was measured to be slower that ours. Here it is, in - // case mpz_scan1() is improved. - // - // - // unsigned long r = mpz_scan1(vec, position); - // return (r == C_Integer::max) ? -1 : r; - // + /* + The alternative implementation using the mpz_scan1() function + of GMP was measured to be slower that ours. Here it is, in + case mpz_scan1() is improved: + + + unsigned long r = mpz_scan1(vec, position); + return (r == C_Integer::max) ? -1 : r; + + */ const unsigned long uli = position / PPL_BITS_PER_GMP_LIMB; mp_size_t li = static_cast(uli); const mp_size_t vec_size = vec->_mp_size; PPL_ASSERT(vec_size >= 0); - if (li >= vec_size) + if (li >= vec_size) { return C_Integer::max; + } // Get the first limb. mp_srcptr p = vec->_mp_d + li; @@ -70,12 +74,14 @@ = *p & ((~static_cast(0)) << (position % PPL_BITS_PER_GMP_LIMB)); while (true) { - if (limb != 0) + if (limb != 0) { return static_cast(li) * PPL_BITS_PER_GMP_LIMB + Implementation::first_one(limb); + } ++li; - if (li == vec_size) + if (li == vec_size) { break; + } ++p; limb = *p; } @@ -86,8 +92,9 @@ PPL::Bit_Row::last() const { mp_size_t li = vec->_mp_size; PPL_ASSERT(li >= 0); - if (li == 0) + if (li == 0) { return C_Integer::max; + } --li; const mp_srcptr p = vec->_mp_d + li; const mp_limb_t limb = *p; @@ -98,8 +105,9 @@ unsigned long PPL::Bit_Row::prev(unsigned long position) const { - if (position == 0) + if (position == 0) { return C_Integer::max; + } --position; @@ -126,11 +134,13 @@ } while (true) { - if (limb != 0) - return static_cast(li) * PPL_BITS_PER_GMP_LIMB + if (limb != 0) { + return static_cast(li) * PPL_BITS_PER_GMP_LIMB + Implementation::last_one(limb); - if (li == 0) + } + if (li == 0) { break; + } --li; --p; limb = *p; @@ -144,8 +154,9 @@ PPL_ASSERT(vec_size >= 0); const unsigned long i = k / static_cast(GMP_NUMB_BITS); - if (i >= static_cast(vec_size)) + if (i >= static_cast(vec_size)) { return false; + } const mp_limb_t limb = *(vec->_mp_d + i); return ((limb >> (k % static_cast(GMP_NUMB_BITS))) & 1U) != 0; @@ -154,8 +165,9 @@ void PPL::Bit_Row::set_until(unsigned long k) { // FIXME, TODO: this is an inefficient implementation. - while (k-- > 0) + while (k-- > 0) { mpz_setbit(vec, k); + } } /*! \relates Parma_Polyhedra_Library::Bit_Row */ @@ -192,13 +204,15 @@ PPL_ASSERT(x_size >= 0); const mp_size_t y_size = y.vec->_mp_size; PPL_ASSERT(y_size >= 0); - if (x_size > y_size) + if (x_size > y_size) { return false; + } mp_srcptr xp = x.vec->_mp_d; mp_srcptr yp = y.vec->_mp_d; while (x_size > 0) { - if ((*xp & ~*yp) != 0) + if ((*xp & ~*yp) != 0) { return false; + } ++xp; ++yp; --x_size; @@ -214,8 +228,9 @@ PPL_ASSERT(x_size >= 0); const mp_size_t y_size = y.vec->_mp_size; PPL_ASSERT(y_size >= 0); - if (x_size > y_size) + if (x_size > y_size) { return false; + } mp_srcptr xp = x.vec->_mp_d; mp_srcptr yp = y.vec->_mp_d; strict_subset = (x_size < y_size); @@ -225,8 +240,9 @@ while (x_size > 0) { xl = *xp; yl = *yp; - if ((xl & ~yl) != 0) + if ((xl & ~yl) != 0) { return false; + } strict_subset_next: ++xp; ++yp; @@ -238,8 +254,9 @@ xl = *xp; yl = *yp; if (xl != yl) { - if ((xl & ~yl) != 0) + if ((xl & ~yl) != 0) { return false; + } strict_subset = true; goto strict_subset_next; } @@ -258,18 +275,21 @@ PPL_ASSERT(x_size >= 0); const mp_size_t y_size = y.vec->_mp_size; PPL_ASSERT(y_size >= 0); - if (x_size > y_size) + if (x_size > y_size) { return false; + } bool different = (x_size < y_size); mp_srcptr xp = x.vec->_mp_d; mp_srcptr yp = y.vec->_mp_d; while (x_size > 0) { const mp_limb_t xl = *xp; const mp_limb_t yl = *yp; - if ((xl & ~yl) != 0) + if ((xl & ~yl) != 0) { return false; - if (!different && xl != yl) + } + if (!different && xl != yl) { different = true; + } ++xp; ++yp; --x_size; @@ -285,8 +305,9 @@ const mp_size_t y_vec_size = y.vec->_mp_size; PPL_ASSERT(y_vec_size >= 0); - if (x_vec_size != y_vec_size) + if (x_vec_size != y_vec_size) { return false; + } return mpn_cmp(x.vec->_mp_d, y.vec->_mp_d, x_vec_size) == 0; } @@ -299,8 +320,9 @@ const mp_size_t y_vec_size = y.vec->_mp_size; PPL_ASSERT(y_vec_size >= 0); - if (x_vec_size != y_vec_size) + if (x_vec_size != y_vec_size) { return true; + } return mpn_cmp(x.vec->_mp_d, y.vec->_mp_d, x_vec_size) != 0; } diff -Nru ppl-1.1/src/Bit_Row_defs.hh ppl-1.2/src/Bit_Row_defs.hh --- ppl-1.1/src/Bit_Row_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Bit_Row_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Bit_Row class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Bit_Row_inlines.hh ppl-1.2/src/Bit_Row_inlines.hh --- ppl-1.1/src/Bit_Row_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Bit_Row_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Bit_Row class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -26,7 +26,7 @@ #include "compiler.hh" #include "globals_defs.hh" -#include "assert.hh" +#include "assertions.hh" // For the declaration of ffs(3). #if defined(PPL_HAVE_STRINGS_H) diff -Nru ppl-1.1/src/Bit_Row_types.hh ppl-1.2/src/Bit_Row_types.hh --- ppl-1.1/src/Bit_Row_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Bit_Row_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Boundary_defs.hh ppl-1.2/src/Boundary_defs.hh --- ppl-1.1/src/Boundary_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Boundary_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Interval boundary functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -33,7 +33,7 @@ struct Property { enum Type { SPECIAL_, - OPEN_, + OPEN_ }; typedef bool Value; static const Value default_value = true; @@ -54,10 +54,12 @@ inline Rounding_Dir round_dir_check(Boundary_Type t, bool check = false) { - if (check) + if (check) { return static_cast(t) | ROUND_STRICT_RELATION; - else + } + else { return static_cast(t); + } } template @@ -77,21 +79,25 @@ template inline bool normal_is_open(Boundary_Type type, const T& x, const Info& info) { - if (Info::store_open) + if (Info::store_open) { return info.get_boundary_property(type, OPEN); - else + } + else { return !Info::store_special && !Info::may_contain_infinity && normal_is_boundary_infinity(type, x, info); + } } template inline bool is_open(Boundary_Type type, const T& x, const Info& info) { - if (Info::store_open) + if (Info::store_open) { return info.get_boundary_property(type, OPEN); - else + } + else { return !Info::may_contain_infinity && is_boundary_infinity(type, x, info); + } } template @@ -102,14 +108,18 @@ || std::numeric_limits::has_infinity, "unbounded is not representable"); Result r; - if (Info::store_special) + if (Info::store_special) { r = special_set_boundary_infinity(type, x, info); - else if (type == LOWER) + } + else if (type == LOWER) { r = assign_r(x, MINUS_INFINITY, ROUND_UP); - else + } + else { r = assign_r(x, PLUS_INFINITY, ROUND_DOWN); - if (result_relation(r) == VR_EQ && !Info::may_contain_infinity) + } + if (result_relation(r) == VR_EQ && !Info::may_contain_infinity) { info.set_boundary_property(type, OPEN); + } return r; } @@ -131,8 +141,9 @@ r = assign_r(x, MINUS_INFINITY, round_dir_check(type)); PPL_ASSERT(result_representable(r)); } - if (open || result_relation(r) != VR_EQ) + if (open || result_relation(r) != VR_EQ) { info.set_boundary_property(type, OPEN); + } return r; } @@ -154,8 +165,9 @@ r = assign_r(x, PLUS_INFINITY, round_dir_check(type)); PPL_ASSERT(result_representable(r)); } - if (open || result_relation(r) != VR_EQ) + if (open || result_relation(r) != VR_EQ) { info.set_boundary_property(type, OPEN); + } return r; } @@ -164,99 +176,125 @@ set_boundary_infinity(Boundary_Type type, T& x, Info& info, bool open = false) { PPL_ASSERT(open || Info::may_contain_infinity); Result r; - if (Info::store_special) + if (Info::store_special) { r = special_set_boundary_infinity(type, x, info); - else if (type == LOWER) + } + else if (type == LOWER) { r = assign_r(x, MINUS_INFINITY, round_dir_check(type)); - else + } + else { r = assign_r(x, PLUS_INFINITY, round_dir_check(type)); + } PPL_ASSERT(result_representable(r)); - if (open) + if (open) { info.set_boundary_property(type, OPEN); + } return r; } template inline bool is_domain_inf(Boundary_Type type, const T& x, const Info& info) { - if (Info::store_special && type == LOWER) + if (Info::store_special && type == LOWER) { return info.get_boundary_property(type, SPECIAL); - else if (std::numeric_limits::has_infinity) + } + else if (std::numeric_limits::has_infinity) { return Parma_Polyhedra_Library::is_minus_infinity(x); - else if (std::numeric_limits::is_bounded) + } + else if (std::numeric_limits::is_bounded) { return x == std::numeric_limits::min(); - else + } + else { return false; + } } template inline bool is_domain_sup(Boundary_Type type, const T& x, const Info& info) { - if (Info::store_special && type == UPPER) + if (Info::store_special && type == UPPER) { return info.get_boundary_property(type, SPECIAL); - else if (std::numeric_limits::has_infinity) + } + else if (std::numeric_limits::has_infinity) { return Parma_Polyhedra_Library::is_plus_infinity(x); - else if (std::numeric_limits::is_bounded) + } + else if (std::numeric_limits::is_bounded) { return x == std::numeric_limits::max(); - else + } + else { return false; + } } template inline bool normal_is_boundary_infinity(Boundary_Type type, const T& x, const Info&) { - if (!std::numeric_limits::has_infinity) + if (!std::numeric_limits::has_infinity) { return false; - if (type == LOWER) + } + if (type == LOWER) { return Parma_Polyhedra_Library::is_minus_infinity(x); - else + } + else { return Parma_Polyhedra_Library::is_plus_infinity(x); + } } template inline bool is_boundary_infinity(Boundary_Type type, const T& x, const Info& info) { - if (Info::store_special) + if (Info::store_special) { return info.get_boundary_property(type, SPECIAL); - else + } + else { return normal_is_boundary_infinity(type, x, info); + } } template inline bool normal_is_reverse_infinity(Boundary_Type type, const T& x, const Info&) { - if (!Info::may_contain_infinity) + if (!Info::may_contain_infinity) { return false; - else if (type == LOWER) + } + else if (type == LOWER) { return Parma_Polyhedra_Library::is_plus_infinity(x); - else + } + else { return Parma_Polyhedra_Library::is_minus_infinity(x); + } } template inline bool is_minus_infinity(Boundary_Type type, const T& x, const Info& info) { if (type == LOWER) { - if (Info::store_special) + if (Info::store_special) { return info.get_boundary_property(type, SPECIAL); - else + } + else { return normal_is_boundary_infinity(type, x, info); + } } - else + else { return !Info::store_special && normal_is_reverse_infinity(type, x, info); + } } template inline bool is_plus_infinity(Boundary_Type type, const T& x, const Info& info) { if (type == UPPER) { - if (Info::store_special) + if (Info::store_special) { return info.get_boundary_property(type, SPECIAL); - else + } + else { return normal_is_boundary_infinity(type, x, info); + } } - else + else { return !Info::store_special && normal_is_reverse_infinity(type, x, info); + } } template @@ -268,12 +306,15 @@ template inline int infinity_sign(Boundary_Type type, const T& x, const Info& info) { - if (is_boundary_infinity(type, x, info)) + if (is_boundary_infinity(type, x, info)) { return (type == LOWER) ? -1 : 1; - else if (is_reverse_infinity(type, x, info)) + } + else if (is_reverse_infinity(type, x, info)) { return (type == UPPER) ? -1 : 1; - else + } + else { return 0; + } } template @@ -294,22 +335,26 @@ template inline int sgn_b(Boundary_Type type, const T& x, const Info& info) { - if (info.get_boundary_property(type, SPECIAL)) + if (info.get_boundary_property(type, SPECIAL)) { return (type == LOWER) ? -1 : 1; - else + } + else { // The following Parma_Polyhedra_Library:: qualification is to work // around a bug of GCC 4.0.x. return Parma_Polyhedra_Library::sgn(x); + } } template inline int sgn(Boundary_Type type, const T& x, const Info& info) { int sign = sgn_b(type, x, info); - if (x == 0 && info.get_boundary_property(type, OPEN)) + if (x == 0 && info.get_boundary_property(type, OPEN)) { return (type == LOWER) ? -1 : 1; - else + } + else { return sign; + } } template @@ -318,21 +363,27 @@ Boundary_Type type2, const T2& x2, const Info2& info2) { if (type1 == type2) { if (is_open(type1, x1, info1) - != is_open(type2, x2, info2)) + != is_open(type2, x2, info2)) { return false; + } } else if (is_open(type1, x1, info1) - || is_open(type2, x2, info2)) + || is_open(type2, x2, info2)) { return false; - if (is_minus_infinity(type1, x1, info1)) + } + if (is_minus_infinity(type1, x1, info1)) { return is_minus_infinity(type2, x2, info2); - else if (is_plus_infinity(type1, x1, info1)) + } + else if (is_plus_infinity(type1, x1, info1)) { return is_plus_infinity(type2, x2, info2); + } else if (is_minus_infinity(type2, x2, info2) - || is_plus_infinity(type2, x2, info2)) + || is_plus_infinity(type2, x2, info2)) { return false; - else + } + else { return equal(x1, x2); + } } template @@ -342,29 +393,36 @@ if (is_open(type1, x1, info1)) { if (type1 == UPPER && (type2 == LOWER - || !is_open(type2, x2, info2))) + || !is_open(type2, x2, info2))) { goto le; + } } else if (type2 == LOWER && is_open(type2, x2, info2)) { le: if (is_minus_infinity(type1, x1, info1) - || is_plus_infinity(type2, x2, info2)) + || is_plus_infinity(type2, x2, info2)) { return true; + } if (is_plus_infinity(type1, x1, info1) - || is_minus_infinity(type2, x2, info2)) + || is_minus_infinity(type2, x2, info2)) { return false; - else + } + else { return less_or_equal(x1, x2); + } } if (is_plus_infinity(type1, x1, info1) - || is_minus_infinity(type2, x2, info2)) + || is_minus_infinity(type2, x2, info2)) { return false; + } if (is_minus_infinity(type1, x1, info1) - || is_plus_infinity(type2, x2, info2)) + || is_plus_infinity(type2, x2, info2)) { return true; - else + } + else { return less_than(x1, x2); + } } template @@ -399,18 +457,21 @@ open = true; /* Fall through */ case V_EQ_MINUS_INFINITY: - if (!Info::store_special) + if (!Info::store_special) { return r; - if (open) + } + if (open) { info.set_boundary_property(type, OPEN); + } return special_set_boundary_infinity(type, x, info); case V_GT: open = true; /* Fall through */ case V_GE: case V_EQ: - if (open) + if (open) { info.set_boundary_property(type, OPEN); + } return r; default: PPL_UNREACHABLE; @@ -423,18 +484,21 @@ open = true; /* Fall through */ case V_EQ_PLUS_INFINITY: - if (!Info::store_special) + if (!Info::store_special) { return r; - if (open) + } + if (open) { info.set_boundary_property(type, OPEN); + } return special_set_boundary_infinity(type, x, info); case V_LT: open = true; /* Fall through */ case V_LE: case V_EQ: - if (open) + if (open) { info.set_boundary_property(type, OPEN); + } return r; default: PPL_UNREACHABLE; @@ -451,10 +515,12 @@ bool should_shrink; if (info.get_boundary_property(type, SPECIAL)) { should_shrink = !special_is_open(type, x, info); - if (type == LOWER) + if (type == LOWER) { return set_minus_infinity(to_type, to, to_info, should_shrink); - else + } + else { return set_plus_infinity(to_type, to, to_info, should_shrink); + } } should_shrink = !normal_is_open(type, x, info); bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open)); @@ -495,10 +561,12 @@ min_assign(Boundary_Type to_type, To& to, To_Info& to_info, Boundary_Type type1, const T1& x1, const Info1& info1, Boundary_Type type2, const T2& x2, const Info2& info2) { - if (lt(type1, x1, info1, type2, x2, info2)) + if (lt(type1, x1, info1, type2, x2, info2)) { return assign(to_type, to, to_info, type1, x1, info1); - else + } + else { return assign(to_type, to, to_info, type2, x2, info2); + } } template @@ -517,10 +585,12 @@ max_assign(Boundary_Type to_type, To& to, To_Info& to_info, Boundary_Type type1, const T1& x1, const Info1& info1, Boundary_Type type2, const T2& x2, const Info2& info2) { - if (gt(type1, x1, info1, type2, x2, info2)) + if (gt(type1, x1, info1, type2, x2, info2)) { return assign(to_type, to, to_info, type1, x1, info1); - else + } + else { return assign(to_type, to, to_info, type2, x2, info2); + } } template @@ -629,12 +699,14 @@ Boundary_Type type2, const T2& x2, const Info2& info2, int x2s) { bool should_shrink; if (x1s != 0) { - if (x2s != 0) + if (x2s != 0) { return mul_assign(to_type, to, to_info, type1, x1, info1, type2, x2, info2); - else + } + else { should_shrink = info2.get_boundary_property(type2, OPEN); + } } else { should_shrink = (info1.get_boundary_property(type1, OPEN) @@ -673,10 +745,11 @@ Boundary_Type type1, const T1& x1, const Info1& info1, int x1s, Boundary_Type type2, const T2& x2, const Info2& info2, int x2s) { if (x1s != 0) { - if (x2s != 0) + if (x2s != 0) { return div_assign(to_type, to, to_info, type1, x1, info1, type2, x2, info2); + } else { return set_boundary_infinity(to_type, to, to_info, true); } diff -Nru ppl-1.1/src/Box.cc ppl-1.2/src/Box.cc --- ppl-1.1/src/Box.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Box.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Box class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -34,9 +34,10 @@ PPL_ASSERT(c_num_vars == 0 && c_only_var == 0); c_only_var = c.expression().first_nonzero(1, c.space_dimension() + 1); - if (c_only_var == c.space_dimension() + 1) + if (c_only_var == c.space_dimension() + 1) { // All the inhomogeneous coefficients are zero. return true; + } ++c_num_vars; --c_only_var; @@ -53,9 +54,10 @@ PPL_ASSERT(cg.is_equality()); cg_only_var = cg.expression().first_nonzero(1, cg.space_dimension() + 1); - if (cg_only_var == cg.space_dimension() + 1) + if (cg_only_var == cg.space_dimension() + 1) { // All the inhomogeneous coefficients are zero. return true; + } ++cg_num_vars; --cg_only_var; diff -Nru ppl-1.1/src/Box_defs.hh ppl-1.2/src/Box_defs.hh --- ppl-1.1/src/Box_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Box_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Box class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -1746,10 +1746,11 @@ ::IO_Operators::operator<<<>(std::ostream& s, const Box& box); template - friend bool Parma_Polyhedra_Library::l_m_distance_assign - (Checked_Number& r, - const Box& x, const Box& y, const Rounding_Dir dir, - Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::l_m_distance_assign(Checked_Number& r, + const Box& x, const Box& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); //! The type of sequence used to implement the box. typedef std::vector Sequence; @@ -2238,7 +2239,8 @@ interval_relation(const ITV& i, const Constraint::Type constraint_type, Coefficient_traits::const_reference numer, - Coefficient_traits::const_reference denom = 1); + Coefficient_traits::const_reference denom + = Coefficient_one()); class Box_Helpers { public: diff -Nru ppl-1.1/src/Box_inlines.hh ppl-1.2/src/Box_inlines.hh --- ppl-1.1/src/Box_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Box_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Box class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -148,9 +148,9 @@ template inline const ITV& Box::get_interval(const Variable var) const { - if (space_dimension() < var.space_dimension()) + if (space_dimension() < var.space_dimension()) { throw_dimension_incompatible("get_interval(v)", "v", var); - + } if (is_empty()) { static ITV empty_interval(EMPTY); return empty_interval; @@ -163,14 +163,15 @@ inline void Box::set_interval(const Variable var, const ITV& i) { const dimension_type space_dim = space_dimension(); - if (space_dim < var.space_dimension()) + if (space_dim < var.space_dimension()) { throw_dimension_incompatible("set_interval(v, i)", "v", var); + } - if (is_empty() && space_dim >= 2) + if (is_empty() && space_dim >= 2) { // If the box is empty, and has dimension >= 2, setting only one // interval will not make it non-empty. return; - + } seq[var.id()] = i; reset_empty_up_to_date(); @@ -240,15 +241,17 @@ const dimension_type m) { const dimension_type space_dim = space_dimension(); // `var' should be one of the dimensions of the vector space. - if (var.space_dimension() > space_dim) + if (var.space_dimension() > space_dim) { throw_dimension_incompatible("expand_space_dimension(v, m)", "v", var); + } // The space dimension of the resulting Box should not // overflow the maximum allowed space dimension. - if (m > max_space_dimension() - space_dim) + if (m > max_space_dimension() - space_dim) { throw_invalid_argument("expand_dimension(v, m)", "adding m new space dimensions exceeds " "the maximum allowed space dimension"); + } // To expand the space dimension corresponding to variable `var', // we append to the box `m' copies of the corresponding interval. @@ -273,9 +276,9 @@ PPL_ASSERT(k < seq.size()); const ITV& seq_k = seq[k]; - if (seq_k.lower_is_boundary_infinity()) + if (seq_k.lower_is_boundary_infinity()) { return false; - + } closed = !seq_k.lower_is_open(); PPL_DIRTY_TEMP(mpq_class, lr); @@ -297,8 +300,9 @@ PPL_ASSERT(k < seq.size()); const ITV& seq_k = seq[k]; - if (seq_k.upper_is_boundary_infinity()) + if (seq_k.upper_is_boundary_infinity()) { return false; + } closed = !seq_k.upper_is_open(); @@ -315,8 +319,9 @@ Box::add_constraint(const Constraint& c) { const dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dimension()) + if (c_space_dim > space_dimension()) { throw_dimension_incompatible("add_constraint(c)", c); + } add_constraint_no_check(c); } @@ -325,8 +330,9 @@ inline void Box::add_constraints(const Constraint_System& cs) { // Dimension-compatibility check. - if (cs.space_dimension() > space_dimension()) + if (cs.space_dimension() > space_dimension()) { throw_dimension_incompatible("add_constraints(cs)", cs); + } add_constraints_no_check(cs); } @@ -342,8 +348,9 @@ Box::add_congruence(const Congruence& cg) { const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dimension()) + if (cg_space_dim > space_dimension()) { throw_dimension_incompatible("add_congruence(cg)", cg); + } add_congruence_no_check(cg); } @@ -351,8 +358,9 @@ template inline void Box::add_congruences(const Congruence_System& cgs) { - if (cgs.space_dimension() > space_dimension()) + if (cgs.space_dimension() > space_dimension()) { throw_dimension_incompatible("add_congruences(cgs)", cgs); + } add_congruences_no_check(cgs); } @@ -451,12 +459,14 @@ Box::refine_with_constraint(const Constraint& c) { const dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dimension()) + if (c_space_dim > space_dimension()) { throw_dimension_incompatible("refine_with_constraint(c)", c); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; + } refine_no_check(c); } @@ -465,13 +475,14 @@ inline void Box::refine_with_constraints(const Constraint_System& cs) { // Dimension-compatibility check. - if (cs.space_dimension() > space_dimension()) + if (cs.space_dimension() > space_dimension()) { throw_dimension_incompatible("refine_with_constraints(cs)", cs); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; - + } refine_no_check(cs); } @@ -480,13 +491,13 @@ Box::refine_with_congruence(const Congruence& cg) { const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dimension()) + if (cg_space_dim > space_dimension()) { throw_dimension_incompatible("refine_with_congruence(cg)", cg); - + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; - + } refine_no_check(cg); } @@ -494,12 +505,14 @@ inline void Box::refine_with_congruences(const Congruence_System& cgs) { // Dimension-compatibility check. - if (cgs.space_dimension() > space_dimension()) + if (cgs.space_dimension() > space_dimension()) { throw_dimension_incompatible("refine_with_congruences(cgs)", cgs); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; + } refine_no_check(cgs); } @@ -509,13 +522,14 @@ Box::propagate_constraint(const Constraint& c) { const dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dimension()) + if (c_space_dim > space_dimension()) { throw_dimension_incompatible("propagate_constraint(c)", c); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; - + } propagate_constraint_no_check(c); } @@ -524,12 +538,14 @@ Box::propagate_constraints(const Constraint_System& cs, const dimension_type max_iterations) { // Dimension-compatibility check. - if (cs.space_dimension() > space_dimension()) + if (cs.space_dimension() > space_dimension()) { throw_dimension_incompatible("propagate_constraints(cs)", cs); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; + } propagate_constraints_no_check(cs, max_iterations); } @@ -539,20 +555,24 @@ Box::unconstrain(const Variable var) { const dimension_type var_id = var.id(); // Dimension-compatibility check. - if (space_dimension() < var_id + 1) + if (space_dimension() < var_id + 1) { throw_dimension_incompatible("unconstrain(var)", var_id + 1); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; + } // Here the box might still be empty (but we haven't detected it yet): // check emptiness of the interval for `var' before cylindrification. ITV& seq_var = seq[var_id]; - if (seq_var.is_empty()) + if (seq_var.is_empty()) { set_empty(); - else + } + else { seq_var.assign(UNIVERSE); + } PPL_ASSERT(OK()); } diff -Nru ppl-1.1/src/Box_Status.cc ppl-1.2/src/Box_Status.cc --- ppl-1.1/src/Box_Status.cc 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/src/Box_Status.cc 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,41 @@ +/* Box::Status class implementation: data objects. + Copyright (C) 2001-2010 Roberto Bagnara + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) + +This file is part of the Parma Polyhedra Library (PPL). + +The PPL is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The PPL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. + +For the most up-to-date information see the Parma Polyhedra Library +site: http://bugseng.com/products/ppl/ . */ + +#include "ppl-config.h" + +namespace Parma_Polyhedra_Library { + +namespace Implementation { + +namespace Boxes { + +// These are the keywords that indicate the individual assertions. +const char* empty_up_to_date = "EUP"; +const char* empty = "EM"; +const char* universe = "UN"; + +} // namespace Boxes + +} // namespace Implementation + +} // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/src/Box_Status_idefs.hh ppl-1.2/src/Box_Status_idefs.hh --- ppl-1.1/src/Box_Status_idefs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Box_Status_idefs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Box::Status class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Box_Status_inlines.hh ppl-1.2/src/Box_Status_inlines.hh --- ppl-1.1/src/Box_Status_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Box_Status_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Box::Status class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -155,9 +155,9 @@ namespace Boxes { // These are the keywords that indicate the individual assertions. -const std::string empty_up_to_date = "EUP"; -const std::string empty = "EM"; -const std::string universe = "UN"; +extern const char* empty_up_to_date; +extern const char* empty; +extern const char* universe; const char yes = '+'; const char no = '-'; const char separator = ' '; @@ -170,12 +170,13 @@ is on; it is set to false otherwise. */ inline bool -get_field(std::istream& s, const std::string& keyword, bool& positive) { +get_field(std::istream& s, const char* keyword, bool& positive) { std::string str; if (!(s >> str) || (str[0] != yes && str[0] != no) - || str.substr(1) != keyword) + || str.substr(1) != keyword) { return false; + } positive = (str[0] == yes); return true; } @@ -201,22 +202,28 @@ using namespace Implementation::Boxes; PPL_UNINITIALIZED(bool, positive); - if (!get_field(s, Implementation::Boxes::empty_up_to_date, positive)) + if (!get_field(s, Implementation::Boxes::empty_up_to_date, positive)) { return false; - if (positive) + } + if (positive) { set_empty_up_to_date(); + } - if (!get_field(s, Implementation::Boxes::empty, positive)) + if (!get_field(s, Implementation::Boxes::empty, positive)) { return false; - if (positive) + } + if (positive) { set_empty(); - - if (!get_field(s, universe, positive)) + } + if (!get_field(s, universe, positive)) { return false; - if (positive) + } + if (positive) { set_universe(); - else + } + else { reset_universe(); + } // Check invariants. PPL_ASSERT(OK()); diff -Nru ppl-1.1/src/Box_templates.hh ppl-1.2/src/Box_templates.hh --- ppl-1.1/src/Box_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Box_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Box class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -58,12 +58,14 @@ // In a box that is marked empty the intervals are completely // meaningless: we exploit this by avoiding their initialization. if (kind == UNIVERSE) { - for (dimension_type i = num_dimensions; i-- > 0; ) + for (dimension_type i = num_dimensions; i-- > 0; ) { seq[i].assign(UNIVERSE); + } set_empty_up_to_date(); } - else + else { set_empty(); + } PPL_ASSERT(OK()); } @@ -78,8 +80,9 @@ "allowed space dimension")), status() { // FIXME: check whether we can avoid the double initialization. - for (dimension_type i = cs.space_dimension(); i-- > 0; ) + for (dimension_type i = cs.space_dimension(); i-- > 0; ) { seq[i].assign(UNIVERSE); + } add_constraints_no_check(cs); } @@ -94,8 +97,9 @@ "allowed space dimension")), status() { // FIXME: check whether we can avoid the double initialization. - for (dimension_type i = cgs.space_dimension(); i-- > 0; ) + for (dimension_type i = cgs.space_dimension(); i-- > 0; ) { seq[i].assign(UNIVERSE); + } add_congruences_no_check(cgs); } @@ -108,12 +112,15 @@ // status(y.status) { status() { // FIXME: remove when the above is fixed. - if (y.marked_empty()) + if (y.marked_empty()) { set_empty(); + } - if (!y.marked_empty()) - for (dimension_type k = y.space_dimension(); k-- > 0; ) + if (!y.marked_empty()) { + for (dimension_type k = y.space_dimension(); k-- > 0; ) { seq[k].assign(y.seq[k]); + } + } PPL_ASSERT(OK()); } @@ -176,11 +183,12 @@ } } - if (!point_seen) + if (!point_seen) { // The generator system is not empty, but contains no points. throw std::invalid_argument("PPL::Box::Box(gs):\n" "the non-empty generator system gs " "contains no points."); + } // Going through all the lines, rays and closure points. for (Generator_System::const_iterator gs_i = gs_begin; @@ -190,13 +198,14 @@ case Generator::LINE: for (Generator::expr_type::const_iterator i = g.expression().begin(), i_end = g.expression().end(); - i != i_end; ++i) + i != i_end; ++i) { seq[i.variable().id()].assign(UNIVERSE); + } break; case Generator::RAY: for (Generator::expr_type::const_iterator i = g.expression().begin(), i_end = g.expression().end(); - i != i_end; ++i) + i != i_end; ++i) { switch (sgn(*i)) { case 1: seq[i.variable().id()].upper_extend(); @@ -208,6 +217,7 @@ PPL_UNREACHABLE; break; } + } break; case Generator::CLOSURE_POINT: { @@ -270,8 +280,9 @@ // Set the upper bound. const Coeff& u = dbm_0[i+1]; - if (!is_plus_infinity(u)) + if (!is_plus_infinity(u)) { upper.set(LESS_OR_EQUAL, u, true); + } // Set the lower bound. const Coeff& negated_l = bds.dbm[i+1][0]; @@ -306,8 +317,9 @@ set_empty_up_to_date(); const dimension_type space_dim = space_dimension(); - if (space_dim == 0) + if (space_dim == 0) { return; + } PPL_DIRTY_TEMP(mpq_class, lower_bound); PPL_DIRTY_TEMP(mpq_class, upper_bound); @@ -360,8 +372,9 @@ // b) the polyhedron is zero-dimensional; or ... const dimension_type space_dim = ph.space_dimension(); - if (space_dim == 0) + if (space_dim == 0) { return; + } // c) the polyhedron is already described by a generator system. if (ph.generators_are_up_to_date() && !ph.has_pending_constraints()) { @@ -375,8 +388,9 @@ if (complexity == POLYNOMIAL_COMPLEXITY) { // FIXME: is there a way to avoid this initialization? - for (dimension_type i = space_dim; i-- > 0; ) + for (dimension_type i = space_dim; i-- > 0; ) { seq[i].assign(UNIVERSE); + } // Get a simplified version of the constraints. const Constraint_System cs = ph.simplified_constraints(); // Propagate easy-to-find bounds from the constraints, @@ -388,9 +402,10 @@ else if (complexity == SIMPLEX_COMPLEXITY) { MIP_Problem lp(space_dim); const Constraint_System& ph_cs = ph.constraints(); - if (!ph_cs.has_strict_inequalities()) + if (!ph_cs.has_strict_inequalities()) { lp.add_constraints(ph_cs); - else + } + else { // Adding to `lp' a topologically closed version of `ph_cs'. for (Constraint_System::const_iterator i = ph_cs.begin(), ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) { @@ -399,9 +414,11 @@ const Linear_Expression expr(c.expression()); lp.add_constraint(expr >= 0); } - else + else { lp.add_constraint(c); + } } + } // Check for unsatisfiability. if (!lp.is_satisfiable()) { set_empty(); @@ -411,8 +428,8 @@ Generator g(point()); PPL_DIRTY_TEMP(mpq_class, lower_bound); PPL_DIRTY_TEMP(mpq_class, upper_bound); - PPL_DIRTY_TEMP(Coefficient, bound_numer); - PPL_DIRTY_TEMP(Coefficient, bound_denom); + PPL_DIRTY_TEMP_COEFFICIENT(bound_numer); + PPL_DIRTY_TEMP_COEFFICIENT(bound_denom); for (dimension_type i = space_dim; i-- > 0; ) { I_Constraint lower; I_Constraint upper; @@ -443,8 +460,9 @@ } else { PPL_ASSERT(complexity == ANY_COMPLEXITY); - if (ph.is_empty()) + if (ph.is_empty()) { set_empty(); + } else { Box tmp(ph.generators()); m_swap(tmp); @@ -472,8 +490,9 @@ const dimension_type space_dim = gr.space_dimension(); - if (space_dim == 0) + if (space_dim == 0) { return; + } if (!gr.generators_are_up_to_date() && !gr.update_generators()) { // Updating found the grid empty. @@ -487,8 +506,8 @@ // of the interval to the value of the associated coefficient in a // generator point. PPL_DIRTY_TEMP(mpq_class, bound); - PPL_DIRTY_TEMP(Coefficient, bound_numer); - PPL_DIRTY_TEMP(Coefficient, bound_denom); + PPL_DIRTY_TEMP_COEFFICIENT(bound_numer); + PPL_DIRTY_TEMP_COEFFICIENT(bound_denom); for (dimension_type i = space_dim; i-- > 0; ) { ITV& seq_i = seq[i]; Variable var(i); @@ -499,8 +518,9 @@ bound.canonicalize(); seq_i.build(i_constraint(EQUAL, bound)); } - else + else { seq_i.assign(UNIVERSE); + } } } @@ -525,8 +545,9 @@ inline void Box::add_space_dimensions_and_embed(const dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; + } check_space_dimension_overflow(m, max_space_dimension() - space_dimension(), "PPL::Box::", "add_space_dimensions_and_embed(m)", @@ -542,8 +563,9 @@ inline void Box::add_space_dimensions_and_project(const dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; + } check_space_dimension_overflow(m, max_space_dimension() - space_dimension(), "PPL::Box::", "add_space_dimensions_and_project(m)", @@ -558,18 +580,23 @@ bool operator==(const Box& x, const Box& y) { const dimension_type x_space_dim = x.space_dimension(); - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } - if (x.is_empty()) + if (x.is_empty()) { return y.is_empty(); + } - if (y.is_empty()) + if (y.is_empty()) { return x.is_empty(); + } - for (dimension_type k = x_space_dim; k-- > 0; ) - if (x.seq[k] != y.seq[k]) + for (dimension_type k = x_space_dim; k-- > 0; ) { + if (x.seq[k] != y.seq[k]) { return false; + } + } return true; } @@ -579,14 +606,15 @@ // `expr' should be dimension-compatible with `*this'. const dimension_type expr_space_dim = expr.space_dimension(); const dimension_type space_dim = space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((from_above ? "bounds_from_above(e)" : "bounds_from_below(e)"), "e", expr); + } // A zero-dimensional or empty Box bounds everything. - if (space_dim == 0 || is_empty()) + if (space_dim == 0 || is_empty()) { return true; - + } const int from_above_sign = from_above ? 1 : -1; // TODO: This loop can be optimized more, if needed, exploiting the // (possible) sparseness of expr. @@ -595,15 +623,17 @@ const Variable v = i.variable(); switch (sgn(*i) * from_above_sign) { case 1: - if (seq[v.id()].upper_is_boundary_infinity()) + if (seq[v.id()].upper_is_boundary_infinity()) { return false; + } break; case 0: PPL_UNREACHABLE; break; case -1: - if (seq[v.id()].lower_is_boundary_infinity()) + if (seq[v.id()].lower_is_boundary_infinity()) { return false; + } break; } } @@ -617,8 +647,9 @@ Coefficient_traits::const_reference numer, Coefficient_traits::const_reference denom) { - if (i.is_universe()) + if (i.is_universe()) { return Poly_Con_Relation::strictly_intersects(); + } PPL_DIRTY_TEMP(mpq_class, bound); assign_r(bound.get_num(), numer, ROUND_NOT_NEEDED); @@ -651,15 +682,18 @@ case 1: return Poly_Con_Relation::is_disjoint(); case 0: - if (i.lower_is_open()) + if (i.lower_is_open()) { return Poly_Con_Relation::is_disjoint(); - if (i.is_singleton()) + } + if (i.is_singleton()) { return Poly_Con_Relation::is_included() && Poly_Con_Relation::saturates(); + } return Poly_Con_Relation::strictly_intersects(); case -1: - if (i.upper_is_boundary_infinity()) + if (i.upper_is_boundary_infinity()) { return Poly_Con_Relation::strictly_intersects(); + } else { assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED); sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED); @@ -667,10 +701,12 @@ case 1: return Poly_Con_Relation::strictly_intersects(); case 0: - if (i.upper_is_open()) + if (i.upper_is_open()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } case -1: return Poly_Con_Relation::is_disjoint(); } @@ -690,10 +726,12 @@ return Poly_Con_Relation::strictly_intersects(); case 0: if (constraint_type == Constraint::STRICT_INEQUALITY - || i.upper_is_open()) + || i.upper_is_open()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } case -1: return Poly_Con_Relation::is_disjoint(); } @@ -708,22 +746,26 @@ if (constraint_type == Constraint::NONSTRICT_INEQUALITY || i.lower_is_open()) { Poly_Con_Relation result = Poly_Con_Relation::is_included(); - if (i.is_singleton()) + if (i.is_singleton()) { result = result && Poly_Con_Relation::saturates(); + } return result; } else { PPL_ASSERT(constraint_type == Constraint::STRICT_INEQUALITY && !i.lower_is_open()); - if (i.is_singleton()) + if (i.is_singleton()) { return Poly_Con_Relation::is_disjoint() && Poly_Con_Relation::saturates(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } } case -1: - if (i.upper_is_boundary_infinity()) + if (i.upper_is_boundary_infinity()) { return Poly_Con_Relation::strictly_intersects(); + } else { assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED); sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED); @@ -732,10 +774,12 @@ return Poly_Con_Relation::strictly_intersects(); case 0: if (constraint_type == Constraint::STRICT_INEQUALITY - || i.upper_is_open()) + || i.upper_is_open()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } case -1: return Poly_Con_Relation::is_disjoint(); } @@ -745,8 +789,9 @@ } else { // `c' is an upper bound. - if (i.upper_is_boundary_infinity()) + if (i.upper_is_boundary_infinity()) { return Poly_Con_Relation::strictly_intersects(); + } else { assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED); sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED); @@ -757,22 +802,26 @@ if (constraint_type == Constraint::NONSTRICT_INEQUALITY || i.upper_is_open()) { Poly_Con_Relation result = Poly_Con_Relation::is_included(); - if (i.is_singleton()) + if (i.is_singleton()) { result = result && Poly_Con_Relation::saturates(); + } return result; } else { PPL_ASSERT(constraint_type == Constraint::STRICT_INEQUALITY && !i.upper_is_open()); - if (i.is_singleton()) + if (i.is_singleton()) { return Poly_Con_Relation::is_disjoint() && Poly_Con_Relation::saturates(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } } case 1: - if (i.lower_is_boundary_infinity()) + if (i.lower_is_boundary_infinity()) { return Poly_Con_Relation::strictly_intersects(); + } else { assign_r(bound_diff, i.lower(), ROUND_NOT_NEEDED); sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED); @@ -781,10 +830,12 @@ return Poly_Con_Relation::strictly_intersects(); case 0: if (constraint_type == Constraint::STRICT_INEQUALITY - || i.lower_is_open()) + || i.lower_is_open()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } case 1: return Poly_Con_Relation::is_disjoint(); } @@ -805,20 +856,23 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dim) + if (cg_space_dim > space_dim) { throw_dimension_incompatible("relation_with(cg)", cg); - - if (is_empty()) + } + if (is_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } } if (cg.is_equality()) { @@ -841,9 +895,9 @@ r += t; } - if (r.lower_is_boundary_infinity() || r.upper_is_boundary_infinity()) + if (r.lower_is_boundary_infinity() || r.upper_is_boundary_infinity()) { return Poly_Con_Relation::strictly_intersects(); - + } // Find the value that satisfies the congruence and is // nearest to the lower bound such that the point lies on or above it. @@ -855,8 +909,9 @@ v = cg.inhomogeneous_term() % mod; assign_r(lower, r.lower(), ROUND_DOWN); v -= ((lower / mod) * mod); - if (v + lower > 0) + if (v + lower > 0) { v -= mod; + } return interval_relation(r, Constraint::EQUALITY, v); } @@ -867,52 +922,61 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dim) + if (c_space_dim > space_dim) { throw_dimension_incompatible("relation_with(c)", c); + } - if (is_empty()) + if (is_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { if ((c.is_equality() && c.inhomogeneous_term() != 0) - || (c.is_inequality() && c.inhomogeneous_term() < 0)) + || (c.is_inequality() && c.inhomogeneous_term() < 0)) { return Poly_Con_Relation::is_disjoint(); - else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) + } + else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) { // The constraint 0 > 0 implicitly defines the hyperplane 0 = 0; // thus, the zero-dimensional point also saturates it. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else if (c.is_equality() || c.inhomogeneous_term() == 0) + } + else if (c.is_equality() || c.inhomogeneous_term() == 0) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); - else + } + else { // The zero-dimensional point saturates // neither the positivity constraint 1 >= 0, // nor the strict positivity constraint 1 > 0. return Poly_Con_Relation::is_included(); + } } dimension_type c_num_vars = 0; dimension_type c_only_var = 0; - if (Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) - if (c_num_vars == 0) + if (Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) { + if (c_num_vars == 0) { // c is a trivial constraint. switch (sgn(c.inhomogeneous_term())) { case -1: return Poly_Con_Relation::is_disjoint(); case 0: - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } case 1: return Poly_Con_Relation::is_included(); } + } else { // c is an interval constraint. return interval_relation(seq[c_only_var], @@ -920,6 +984,7 @@ c.inhomogeneous_term(), c.coefficient(Variable(c_only_var))); } + } else { // Deal with a non-trivial and non-interval constraint. PPL_DIRTY_TEMP(Rational_Interval, r); @@ -953,25 +1018,30 @@ const dimension_type g_space_dim = g.space_dimension(); // Dimension-compatibility check. - if (space_dim < g_space_dim) + if (space_dim < g_space_dim) { throw_dimension_incompatible("relation_with(g)", g); + } // The empty box cannot subsume a generator. - if (is_empty()) + if (is_empty()) { return Poly_Gen_Relation::nothing(); + } // A universe box in a zero-dimensional space subsumes // all the generators of a zero-dimensional space. - if (space_dim == 0) + if (space_dim == 0) { return Poly_Gen_Relation::subsumes(); + } if (g.is_line_or_ray()) { if (g.is_line()) { const Generator::expr_type& e = g.expression(); for (Generator::expr_type::const_iterator i = e.begin(), i_end = e.end(); - i != i_end; ++i) - if (!seq[i.variable().id()].is_universe()) + i != i_end; ++i) { + if (!seq[i.variable().id()].is_universe()) { return Poly_Gen_Relation::nothing(); + } + } return Poly_Gen_Relation::subsumes(); } else { @@ -982,15 +1052,17 @@ const Variable v = i.variable(); switch (sgn(*i)) { case 1: - if (!seq[v.id()].upper_is_boundary_infinity()) + if (!seq[v.id()].upper_is_boundary_infinity()) { return Poly_Gen_Relation::nothing(); + } break; case 0: PPL_UNREACHABLE; break; case -1: - if (!seq[v.id()].lower_is_boundary_infinity()) + if (!seq[v.id()].lower_is_boundary_infinity()) { return Poly_Gen_Relation::nothing(); + } break; } } @@ -1007,8 +1079,9 @@ // Generator::expr_type::const_iterator. for (dimension_type i = g_space_dim; i-- > 0; ) { const ITV& seq_i = seq[i]; - if (seq_i.is_universe()) + if (seq_i.is_universe()) { continue; + } assign_r(g_coord.get_num(), g.coefficient(Variable(i)), ROUND_NOT_NEEDED); assign_r(g_coord.get_den(), g_divisor, ROUND_NOT_NEEDED); g_coord.canonicalize(); @@ -1017,11 +1090,13 @@ assign_r(bound, seq_i.lower(), ROUND_NOT_NEEDED); if (g_coord <= bound) { if (seq_i.lower_is_open()) { - if (g.is_point() || g_coord != bound) + if (g.is_point() || g_coord != bound) { return Poly_Gen_Relation::nothing(); + } } - else if (g_coord != bound) + else if (g_coord != bound) { return Poly_Gen_Relation::nothing(); + } } } // Check upper bound. @@ -1029,11 +1104,13 @@ assign_r(bound, seq_i.upper(), ROUND_NOT_NEEDED); if (g_coord >= bound) { if (seq_i.upper_is_open()) { - if (g.is_point() || g_coord != bound) + if (g.is_point() || g_coord != bound) { return Poly_Gen_Relation::nothing(); + } } - else if (g_coord != bound) + else if (g_coord != bound) { return Poly_Gen_Relation::nothing(); + } } } } @@ -1050,14 +1127,17 @@ // `expr' should be dimension-compatible with `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } + // Deal with zero-dim Box first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -1067,8 +1147,9 @@ } // For an empty Box we simply return false. - if (is_empty()) + if (is_empty()) { return false; + } PPL_DIRTY_TEMP(mpq_class, result); assign_r(result, expr.inhomogeneous_term(), ROUND_NOT_NEEDED); @@ -1082,23 +1163,27 @@ assign_r(expr_i, *i, ROUND_NOT_NEEDED); switch (sgn(expr_i) * maximize_sign) { case 1: - if (seq_i.upper_is_boundary_infinity()) + if (seq_i.upper_is_boundary_infinity()) { return false; + } assign_r(bound_i, seq_i.upper(), ROUND_NOT_NEEDED); add_mul_assign_r(result, bound_i, expr_i, ROUND_NOT_NEEDED); - if (seq_i.upper_is_open()) + if (seq_i.upper_is_open()) { is_included = false; + } break; case 0: PPL_UNREACHABLE; break; case -1: - if (seq_i.lower_is_boundary_infinity()) + if (seq_i.lower_is_boundary_infinity()) { return false; + } assign_r(bound_i, seq_i.lower(), ROUND_NOT_NEEDED); add_mul_assign_r(result, bound_i, expr_i, ROUND_NOT_NEEDED); - if (seq_i.lower_is_open()) + if (seq_i.lower_is_open()) { is_included = false; + } break; } } @@ -1117,19 +1202,19 @@ Coefficient& ext_n, Coefficient& ext_d, bool& included, Generator& g) const { - if (!max_min(expr, maximize, ext_n, ext_d, included)) + if (!max_min(expr, maximize, ext_n, ext_d, included)) { return false; - + } // Compute generator `g'. Linear_Expression g_expr; - PPL_DIRTY_TEMP(Coefficient, g_divisor); + PPL_DIRTY_TEMP_COEFFICIENT(g_divisor); g_divisor = 1; const int maximize_sign = maximize ? 1 : -1; PPL_DIRTY_TEMP(mpq_class, g_coord); - PPL_DIRTY_TEMP(Coefficient, numer); - PPL_DIRTY_TEMP(Coefficient, denom); - PPL_DIRTY_TEMP(Coefficient, lcm); - PPL_DIRTY_TEMP(Coefficient, factor); + PPL_DIRTY_TEMP_COEFFICIENT(numer); + PPL_DIRTY_TEMP_COEFFICIENT(denom); + PPL_DIRTY_TEMP_COEFFICIENT(lcm); + PPL_DIRTY_TEMP_COEFFICIENT(factor); // TODO: Check if the following loop can be optimized to exploit the // (possible) sparseness of expr. for (dimension_type i = space_dimension(); i-- > 0; ) { @@ -1142,11 +1227,12 @@ // If 0 belongs to the interval, choose it // (and directly proceed to the next iteration). // FIXME: name qualification issue. - if (seq_i.contains(0)) + if (seq_i.contains(0)) { continue; - if (!seq_i.lower_is_boundary_infinity()) - if (seq_i.lower_is_open()) - if (!seq_i.upper_is_boundary_infinity()) + } + if (!seq_i.lower_is_boundary_infinity()) { + if (seq_i.lower_is_open()) { + if (!seq_i.upper_is_boundary_infinity()) { if (seq_i.upper_is_open()) { // Bounded and open interval: compute middle point. assign_r(g_coord, seq_i.lower(), ROUND_NOT_NEEDED); @@ -1155,24 +1241,30 @@ g_coord += q_seq_i_upper; g_coord /= 2; } - else + else { // The upper bound is in the interval. assign_r(g_coord, seq_i.upper(), ROUND_NOT_NEEDED); + } + } else { // Lower is open, upper is unbounded. assign_r(g_coord, seq_i.lower(), ROUND_NOT_NEEDED); ++g_coord; } - else + } + else { // The lower bound is in the interval. assign_r(g_coord, seq_i.lower(), ROUND_NOT_NEEDED); + } + } else { // Lower is unbounded, hence upper is bounded // (since we know that 0 does not belong to the interval). PPL_ASSERT(!seq_i.upper_is_boundary_infinity()); assign_r(g_coord, seq_i.upper(), ROUND_NOT_NEEDED); - if (seq_i.upper_is_open()) + if (seq_i.upper_is_open()) { --g_coord; + } } break; case -1: @@ -1199,21 +1291,26 @@ Box::contains(const Box& y) const { const Box& x = *this; // Dimension-compatibility check. - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { x.throw_dimension_incompatible("contains(y)", y); + } // If `y' is empty, then `x' contains `y'. - if (y.is_empty()) + if (y.is_empty()) { return true; + } // If `x' is empty, then `x' cannot contain `y'. - if (x.is_empty()) + if (x.is_empty()) { return false; + } - for (dimension_type k = x.seq.size(); k-- > 0; ) + for (dimension_type k = x.seq.size(); k-- > 0; ) { // FIXME: fix this name qualification issue. - if (!x.seq[k].contains(y.seq[k])) + if (!x.seq[k].contains(y.seq[k])) { return false; + } + } return true; } @@ -1222,18 +1319,22 @@ Box::is_disjoint_from(const Box& y) const { const Box& x = *this; // Dimension-compatibility check. - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { x.throw_dimension_incompatible("is_disjoint_from(y)", y); + } // If any of `x' or `y' is marked empty, then they are disjoint. // Note: no need to use `is_empty', as the following loop is anyway correct. - if (x.marked_empty() || y.marked_empty()) + if (x.marked_empty() || y.marked_empty()) { return true; + } - for (dimension_type k = x.seq.size(); k-- > 0; ) + for (dimension_type k = x.seq.size(); k-- > 0; ) { // FIXME: fix this name qualification issue. - if (x.seq[k].is_disjoint_from(y.seq[k])) + if (x.seq[k].is_disjoint_from(y.seq[k])) { return true; + } + } return false; } @@ -1243,12 +1344,14 @@ Box& x = *this; // Dimension-compatibility check. - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { x.throw_dimension_incompatible("upper_bound_assign_if_exact(y)", y); + } // The lub of a box with an empty box is equal to the first box. - if (y.is_empty()) + if (y.is_empty()) { return true; + } if (x.is_empty()) { x = y; return true; @@ -1261,28 +1364,34 @@ const ITV& x_seq_i = x.seq[i]; const ITV& y_seq_i = y.seq[i]; - if (!x_seq_i.can_be_exactly_joined_to(y_seq_i)) + if (!x_seq_i.can_be_exactly_joined_to(y_seq_i)) { return false; + } // Note: the use of `y_i_does_not_contain_x_i' is needed // because we want to temporarily preserve the old value // of `y_j_does_not_contain_x_j'. bool y_i_does_not_contain_x_i = !y_seq_i.contains(x_seq_i); - if (y_i_does_not_contain_x_i && x_j_does_not_contain_y_j) + if (y_i_does_not_contain_x_i && x_j_does_not_contain_y_j) { return false; + } if (!x_seq_i.contains(y_seq_i)) { - if (y_j_does_not_contain_x_j) + if (y_j_does_not_contain_x_j) { return false; - else + } + else { x_j_does_not_contain_y_j = true; + } } - if (y_i_does_not_contain_x_i) + if (y_i_does_not_contain_x_i) { y_j_does_not_contain_x_j = true; + } } // The upper bound is exact: compute it into *this. - for (dimension_type k = x.seq.size(); k-- > 0; ) + for (dimension_type k = x.seq.size(); k-- > 0; ) { x.seq[k].join_assign(y.seq[k]); + } return true; } @@ -1303,9 +1412,11 @@ // A box that is not marked empty must have meaningful intervals. if (!marked_empty()) { - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].OK()) + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].OK()) { return false; + } + } } return true; @@ -1316,16 +1427,20 @@ Box::affine_dimension() const { dimension_type d = space_dimension(); // A zero-space-dim box always has affine dimension zero. - if (d == 0) + if (d == 0) { return 0; + } // An empty box has affine dimension zero. - if (is_empty()) + if (is_empty()) { return 0; + } - for (dimension_type k = d; k-- > 0; ) - if (seq[k].is_singleton()) + for (dimension_type k = d; k-- > 0; ) { + if (seq[k].is_singleton()) { --d; + } + } return d; } @@ -1335,11 +1450,12 @@ Box::check_empty() const { PPL_ASSERT(!marked_empty()); Box& x = const_cast&>(*this); - for (dimension_type k = seq.size(); k-- > 0; ) + for (dimension_type k = seq.size(); k-- > 0; ) { if (seq[k].is_empty()) { x.set_empty(); return true; } + } x.set_nonempty(); return false; } @@ -1347,56 +1463,71 @@ template bool Box::is_universe() const { - if (marked_empty()) + if (marked_empty()) { return false; - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].is_universe()) + } + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].is_universe()) { return false; + } + } return true; } template bool Box::is_topologically_closed() const { - if (ITV::is_always_topologically_closed() || is_empty()) + if (ITV::is_always_topologically_closed() || is_empty()) { return true; + } - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].is_topologically_closed()) + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].is_topologically_closed()) { return false; + } + } return true; } template bool Box::is_discrete() const { - if (is_empty()) + if (is_empty()) { return true; - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].is_singleton()) + } + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].is_singleton()) { return false; + } + } return true; } template bool Box::is_bounded() const { - if (is_empty()) + if (is_empty()) { return true; - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].is_bounded()) + } + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].is_bounded()) { return false; + } + } return true; } template bool Box::contains_integer_point() const { - if (marked_empty()) + if (marked_empty()) { return false; - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].contains_integer_point()) + } + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].contains_integer_point()) { return false; + } + } return true; } @@ -1407,8 +1538,9 @@ Coefficient& val_n, Coefficient& val_d) const { dimension_type space_dim = space_dimension(); // The dimension of `expr' must be at most the dimension of *this. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("frequency(e, ...)", "e", expr); + } // Check if `expr' has a constant value. // If it is constant, set the frequency `freq_n' to 0 @@ -1418,8 +1550,9 @@ // Space dimension is 0: if empty, then return false; // otherwise the frequency is 0 and the value is the inhomogeneous term. if (space_dim == 0) { - if (is_empty()) + if (is_empty()) { return false; + } freq_n = 0; freq_d = 1; val_n = expr.inhomogeneous_term(); @@ -1428,8 +1561,9 @@ } // For an empty Box, we simply return false. - if (is_empty()) + if (is_empty()) { return false; + } // The Box has at least 1 dimension and is not empty. PPL_DIRTY_TEMP_COEFFICIENT(numer); @@ -1472,11 +1606,13 @@ Box::constrains(Variable var) const { // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dimension() < var_space_dim) + if (space_dimension() < var_space_dim) { throw_dimension_incompatible("constrains(v)", "v", var); + } - if (marked_empty() || !seq[var_space_dim-1].is_universe()) + if (marked_empty() || !seq[var_space_dim-1].is_universe()) { return true; + } // Now force an emptiness check. return is_empty(); } @@ -1487,17 +1623,19 @@ // The cylindrification with respect to no dimensions is a no-op. // This case also captures the only legal cylindrification // of a box in a 0-dim space. - if (vars.empty()) + if (vars.empty()) { return; + } // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("unconstrain(vs)", min_space_dim); - + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; + } // Here the box might still be empty (but we haven't detected it yet): // check emptiness of the interval for each of the variables in @@ -1505,8 +1643,9 @@ for (Variables_Set::const_iterator vsi = vars.begin(), vsi_end = vars.end(); vsi != vsi_end; ++vsi) { ITV& seq_vsi = seq[*vsi]; - if (!seq_vsi.is_empty()) + if (!seq_vsi.is_empty()) { seq_vsi.assign(UNIVERSE); + } else { set_empty(); break; @@ -1518,11 +1657,13 @@ template void Box::topological_closure_assign() { - if (ITV::is_always_topologically_closed() || is_empty()) + if (ITV::is_always_topologically_closed() || is_empty()) { return; + } - for (dimension_type k = seq.size(); k-- > 0; ) + for (dimension_type k = seq.size(); k-- > 0; ) { seq[k].topological_closure_assign(); + } } template @@ -1557,8 +1698,9 @@ // Wrapping no variable only requires refining with *cs_p, if any. if (vars.empty()) { - if (cs_p != 0) + if (cs_p != 0) { refine_with_constraints(*cs_p); + } return; } @@ -1574,8 +1716,9 @@ } // Wrapping an empty polyhedron is a no-op. - if (x.is_empty()) + if (x.is_empty()) { return; + } // FIXME: temporarily (ab-) using Coefficient. // Set `min_value' and `max_value' to the minimum and maximum values @@ -1615,8 +1758,9 @@ // No constraint refinement is needed here. switch (o) { case OVERFLOW_WRAPS: - for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) + for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) { x.seq[*i].wrap_assign(w, r, integer_quadrant_itv); + } reset_empty_up_to_date(); break; case OVERFLOW_UNDEFINED: @@ -1628,8 +1772,9 @@ } break; case OVERFLOW_IMPOSSIBLE: - for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) + for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) { x.seq[*i].intersect_assign(integer_quadrant_itv); + } reset_empty_up_to_date(); break; } @@ -1652,8 +1797,9 @@ // An interval constraint on variable index `c_only_var'. PPL_ASSERT(c_only_var < space_dim); // We do care about c if c_only_var is going to be wrapped. - if (vars.find(c_only_var) != vs_end) + if (vars.find(c_only_var) != vs_end) { var_cs_map[c_only_var].push_back(&c); + } } else { PPL_ASSERT(c_num_vars == 0); @@ -1691,8 +1837,9 @@ x_seq_v.wrap_assign(w, r, refinement_itv); break; case OVERFLOW_UNDEFINED: - if (!rational_quadrant_itv.contains(x_seq_v)) + if (!rational_quadrant_itv.contains(x_seq_v)) { x_seq_v.assign(UNIVERSE); + } break; case OVERFLOW_IMPOSSIBLE: x_seq_v.intersect_assign(refinement_itv); @@ -1707,14 +1854,17 @@ void Box::drop_some_non_integer_points(Complexity_Class) { if (std::numeric_limits::is_integer - && !ITV::info_type::store_open) + && !ITV::info_type::store_open) { return; + } - if (marked_empty()) + if (marked_empty()) { return; + } - for (dimension_type k = seq.size(); k-- > 0; ) + for (dimension_type k = seq.size(); k-- > 0; ) { seq[k].drop_some_non_integer_points(); + } PPL_ASSERT(OK()); } @@ -1725,20 +1875,23 @@ Complexity_Class) { // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("drop_some_non_integer_points(vs, cmpl)", min_space_dim); - + } if (std::numeric_limits::is_integer - && !ITV::info_type::store_open) + && !ITV::info_type::store_open) { return; + } - if (marked_empty()) + if (marked_empty()) { return; + } for (Variables_Set::const_iterator v_i = vars.begin(), - v_end = vars.end(); v_i != v_end; ++v_i) + v_end = vars.end(); v_i != v_end; ++v_i) { seq[*v_i].drop_some_non_integer_points(); + } PPL_ASSERT(OK()); } @@ -1750,12 +1903,14 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { x.throw_dimension_incompatible("intersection_assign(y)", y); + } // If one of the two boxes is empty, the intersection is empty. - if (x.marked_empty()) + if (x.marked_empty()) { return; + } if (y.marked_empty()) { x.set_empty(); return; @@ -1763,15 +1918,17 @@ // If both boxes are zero-dimensional, then at this point they are // necessarily non-empty, so that their intersection is non-empty too. - if (space_dim == 0) + if (space_dim == 0) { return; + } // FIXME: here we may conditionally exploit a capability of the // underlying interval to eagerly detect empty results. reset_empty_up_to_date(); - for (dimension_type k = space_dim; k-- > 0; ) + for (dimension_type k = space_dim; k-- > 0; ) { x.seq[k].intersect_assign(y.seq[k]); + } PPL_ASSERT(x.OK()); } @@ -1782,19 +1939,22 @@ Box& x = *this; // Dimension-compatibility check. - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { x.throw_dimension_incompatible("upper_bound_assign(y)", y); + } // The lub of a box with an empty box is equal to the first box. - if (y.is_empty()) + if (y.is_empty()) { return; + } if (x.is_empty()) { x = y; return; } - for (dimension_type k = x.seq.size(); k-- > 0; ) + for (dimension_type k = x.seq.size(); k-- > 0; ) { x.seq[k].join_assign(y.seq[k]); + } PPL_ASSERT(x.OK()); } @@ -1807,12 +1967,14 @@ const dimension_type y_space_dim = y.space_dimension(); // If `y' is marked empty, the result will be empty too. - if (y.marked_empty()) + if (y.marked_empty()) { x.set_empty(); + } // If `y' is a 0-dim space box, there is nothing left to do. - if (y_space_dim == 0) + if (y_space_dim == 0) { return; + } // The resulting space dimension must be at most the maximum. check_space_dimension_overflow(y.space_dimension(), max_space_dimension() - space_dimension(), @@ -1836,8 +1998,9 @@ std::copy(y.seq.begin(), y.seq.end(), std::back_insert_iterator(x.seq)); // Update the `empty_up_to_date' flag. - if (!y.status.test_empty_up_to_date()) + if (!y.status.test_empty_up_to_date()) { reset_empty_up_to_date(); + } PPL_ASSERT(x.OK()); } @@ -1848,13 +2011,14 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("difference_assign(y)", y); + } Box& x = *this; - if (x.is_empty() || y.is_empty()) + if (x.is_empty() || y.is_empty()) { return; - + } switch (space_dim) { case 0: // If `x' is zero-dimensional, then at this point both `x' and `y' @@ -1864,21 +2028,25 @@ case 1: x.seq[0].difference_assign(y.seq[0]); - if (x.seq[0].is_empty()) + if (x.seq[0].is_empty()) { x.set_empty(); + } break; default: { dimension_type index_non_contained = space_dim; dimension_type number_non_contained = 0; - for (dimension_type i = space_dim; i-- > 0; ) + for (dimension_type i = space_dim; i-- > 0; ) { if (!y.seq[i].contains(x.seq[i])) { - if (++number_non_contained == 1) + if (++number_non_contained == 1) { index_non_contained = i; - else + } + else { break; + } } + } switch (number_non_contained) { case 0: @@ -1888,8 +2056,9 @@ case 1: x.seq[index_non_contained] .difference_assign(y.seq[index_non_contained]); - if (x.seq[index_non_contained].is_empty()) + if (x.seq[index_non_contained].is_empty()) { x.set_empty(); + } break; default: // Nothing to do: the difference is `x'. @@ -1907,8 +2076,9 @@ Box& x = *this; const dimension_type num_dims = x.space_dimension(); // Dimension-compatibility check. - if (num_dims != y.space_dimension()) + if (num_dims != y.space_dimension()) { x.throw_dimension_incompatible("simplify_using_context_assign(y)", y); + } // Filter away the zero-dimensional case. if (num_dims == 0) { @@ -1916,14 +2086,16 @@ x.set_nonempty(); return false; } - else + else { return !x.marked_empty(); + } } // Filter away the case when `y' is empty. if (y.is_empty()) { - for (dimension_type i = num_dims; i-- > 0; ) + for (dimension_type i = num_dims; i-- > 0; ) { x.seq[i].assign(UNIVERSE); + } x.set_nonempty(); return false; } @@ -1931,8 +2103,9 @@ if (x.is_empty()) { // Find in `y' a non-universe interval, if any. for (dimension_type i = 0; i < num_dims; ++i) { - if (y.seq[i].is_universe()) + if (y.seq[i].is_universe()) { x.seq[i].assign(UNIVERSE); + } else { // Set x.seq[i] so as to contradict y.seq[i], if possible. ITV& seq_i = x.seq[i]; @@ -1945,8 +2118,9 @@ } // We assigned to `seq_i' a non-empty interval: // set the other intervals to universe and return. - for (++i; i < num_dims; ++i) + for (++i; i < num_dims; ++i) { x.seq[i].assign(UNIVERSE); + } x.set_nonempty(); PPL_ASSERT(x.OK()); return false; @@ -1964,10 +2138,12 @@ PPL_ASSERT(!x.seq[i].is_empty()); // The intersection of `x' and `y' is empty due to the i-th interval: // reset other intervals to UNIVERSE. - for (dimension_type j = num_dims; j-- > i; ) + for (dimension_type j = num_dims; j-- > i; ) { x.seq[j].assign(UNIVERSE); - for (dimension_type j = i; j-- > 0; ) + } + for (dimension_type j = i; j-- > 0; ) { x.seq[j].assign(UNIVERSE); + } PPL_ASSERT(x.OK()); return false; } @@ -1983,13 +2159,15 @@ const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { x.throw_dimension_incompatible("time_elapse_assign(y)", y); + } // Dealing with the zero-dimensional case. if (x_space_dim == 0) { - if (y.marked_empty()) + if (y.marked_empty()) { x.set_empty(); + } return; } @@ -2004,12 +2182,16 @@ for (dimension_type i = x_space_dim; i-- > 0; ) { ITV& x_seq_i = x.seq[i]; const ITV& y_seq_i = y.seq[i]; - if (!x_seq_i.lower_is_boundary_infinity()) - if (y_seq_i.lower_is_boundary_infinity() || y_seq_i.lower() < 0) + if (!x_seq_i.lower_is_boundary_infinity()) { + if (y_seq_i.lower_is_boundary_infinity() || y_seq_i.lower() < 0) { x_seq_i.lower_extend(); - if (!x_seq_i.upper_is_boundary_infinity()) - if (y_seq_i.upper_is_boundary_infinity() || y_seq_i.upper() > 0) + } + } + if (!x_seq_i.upper_is_boundary_infinity()) { + if (y_seq_i.upper_is_boundary_infinity() || y_seq_i.upper() > 0) { x_seq_i.upper_extend(); + } + } } PPL_ASSERT(x.OK()); } @@ -2029,9 +2211,10 @@ // Dimension-compatibility check. const dimension_type vsi_space_dim = vars.space_dimension(); - if (old_space_dim < vsi_space_dim) + if (old_space_dim < vsi_space_dim) { throw_dimension_incompatible("remove_space_dimensions(vs)", vsi_space_dim); + } const dimension_type new_space_dim = old_space_dim - vars.size(); @@ -2053,13 +2236,16 @@ for (++vsi; vsi != vsi_end; ++vsi) { const dimension_type vsi_next = *vsi; // All intervals in between are moved to the left. - while (src < vsi_next) + while (src < vsi_next) { swap(seq[dst++], seq[src++]); + } ++src; } + // Moving the remaining intervals. - while (src < old_space_dim) + while (src < old_space_dim) { swap(seq[dst++], seq[src++]); + } PPL_ASSERT(dst == new_space_dim); seq.resize(new_space_dim); @@ -2073,9 +2259,10 @@ // Dimension-compatibility check: the variable having // maximum index is the one occurring last in the set. const dimension_type space_dim = space_dimension(); - if (new_dimension > space_dim) + if (new_dimension > space_dim) { throw_dimension_incompatible("remove_higher_space_dimensions(nd)", new_dimension); + } // The removal of no dimensions from any box is a no-op. // Note that this case also captures the only legal removal of @@ -2094,8 +2281,9 @@ void Box::map_space_dimensions(const Partial_Function& pfunc) { const dimension_type space_dim = space_dimension(); - if (space_dim == 0) + if (space_dim == 0) { return; + } if (pfunc.has_empty_codomain()) { // All dimensions vanish: the box becomes zero_dimensional. @@ -2115,8 +2303,9 @@ // Map the intervals, exchanging the indexes. for (dimension_type i = 0; i < space_dim; ++i) { dimension_type new_i; - if (pfunc.maps(i, new_i)) + if (pfunc.maps(i, new_i)) { swap(seq[i], tmp.seq[new_i]); + } } m_swap(tmp); PPL_ASSERT(OK()); @@ -2128,22 +2317,25 @@ const Variable dest) { const dimension_type space_dim = space_dimension(); // `dest' should be one of the dimensions of the box. - if (dest.space_dimension() > space_dim) + if (dest.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", "v", dest); + } // The folding of no dimensions is a no-op. - if (vars.empty()) + if (vars.empty()) { return; + } // All variables in `vars' should be dimensions of the box. - if (vars.space_dimension() > space_dim) + if (vars.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", vars.space_dimension()); - + } // Moreover, `dest.id()' should not occur in `vars'. - if (vars.find(dest.id()) != vars.end()) + if (vars.find(dest.id()) != vars.end()) { throw_invalid_argument("fold_space_dimensions(vs, v)", "v should not occur in vs"); + } // Note: the check for emptiness is needed for correctness. if (!is_empty()) { @@ -2151,8 +2343,9 @@ // corresponding to the variables in `vars'. ITV& seq_v = seq[dest.id()]; for (Variables_Set::const_iterator i = vars.begin(), - vs_end = vars.end(); i != vs_end; ++i) + vs_end = vars.end(); i != vs_end; ++i) { seq_v.join_assign(seq[*i]); + } } remove_space_dimensions(vars); } @@ -2165,28 +2358,32 @@ dimension_type c_num_vars = 0; dimension_type c_only_var = 0; // Throw an exception if c is not an interval constraints. - if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) + if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) { throw_invalid_argument("add_constraint(c)", "c is not an interval constraint"); + } // Throw an exception if c is a nontrivial strict constraint // and ITV does not support open boundaries. if (c.is_strict_inequality() && c_num_vars != 0 - && ITV::is_always_topologically_closed()) + && ITV::is_always_topologically_closed()) { throw_invalid_argument("add_constraint(c)", "c is a nontrivial strict constraint"); + } // Avoid doing useless work if the box is known to be empty. - if (marked_empty()) + if (marked_empty()) { return; + } const Coefficient& n = c.inhomogeneous_term(); if (c_num_vars == 0) { // Dealing with a trivial constraint. if (n < 0 || (c.is_equality() && n != 0) - || (c.is_strict_inequality() && n == 0)) + || (c.is_strict_inequality() && n == 0)) { set_empty(); + } return; } @@ -2203,8 +2400,9 @@ // through all the constraints to fulfill the method's contract // for what concerns exception throwing. for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) + cs_end = cs.end(); i != cs_end; ++i) { add_constraint_no_check(*i); + } PPL_ASSERT(OK()); } @@ -2219,30 +2417,35 @@ set_empty(); return; } - else if (cg.is_tautological()) + else if (cg.is_tautological()) { return; - else + } + else { throw_invalid_argument("add_congruence(cg)", "cg is a nontrivial proper congruence"); + } } PPL_ASSERT(cg.is_equality()); dimension_type cg_num_vars = 0; dimension_type cg_only_var = 0; // Throw an exception if c is not an interval congruence. - if (!Box_Helpers::extract_interval_congruence(cg, cg_num_vars, cg_only_var)) + if (!Box_Helpers::extract_interval_congruence(cg, cg_num_vars, cg_only_var)) { throw_invalid_argument("add_congruence(cg)", "cg is not an interval congruence"); + } // Avoid doing useless work if the box is known to be empty. - if (marked_empty()) + if (marked_empty()) { return; + } const Coefficient& n = cg.inhomogeneous_term(); if (cg_num_vars == 0) { // Dealing with a trivial equality congruence. - if (n != 0) + if (n != 0) { set_empty(); + } return; } @@ -2259,8 +2462,9 @@ // through all the congruences to fulfill the method's contract // for what concerns exception throwing. for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); i != cgs_end; ++i) + cgs_end = cgs.end(); i != cgs_end; ++i) { add_congruence_no_check(*i); + } PPL_ASSERT(OK()); } @@ -2283,8 +2487,9 @@ // Dealing with a trivial constraint. if (n < 0 || (c.is_equality() && n != 0) - || (c.is_strict_inequality() && n == 0)) + || (c.is_strict_inequality() && n == 0)) { set_empty(); + } return; } @@ -2298,8 +2503,9 @@ Box::refine_no_check(const Constraint_System& cs) { PPL_ASSERT(cs.space_dimension() <= space_dimension()); for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) + cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) { refine_no_check(*i); + } PPL_ASSERT(OK()); } @@ -2313,8 +2519,9 @@ if (cg.is_proper_congruence()) { // A proper congruences is also an interval constraint // if and only if it is trivial. - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { set_empty(); + } return; } @@ -2328,8 +2535,9 @@ Box::refine_no_check(const Congruence_System& cgs) { PPL_ASSERT(cgs.space_dimension() <= space_dimension()); for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) + cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) { refine_no_check(*i); + } PPL_ASSERT(OK()); } @@ -2351,8 +2559,9 @@ return false; case V_LE: case V_GE: - if (open == T_NO) + if (open == T_NO) { open = T_MAYBE; + } return false; case V_EQ: return false; @@ -2389,8 +2598,9 @@ // Constraint c is trivial: check if it is inconsistent. if (c_inhomogeneous_term < 0 || (c_inhomogeneous_term == 0 - && c_type != Constraint::NONSTRICT_INEQUALITY)) + && c_type != Constraint::NONSTRICT_INEQUALITY)) { set_empty(); + } return; } @@ -2406,70 +2616,88 @@ const Coefficient& a_k = *k; const Variable k_var = k.variable(); const int sgn_a_k = sgn(a_k); - if (sgn_a_k == 0) + if (sgn_a_k == 0) { continue; + } Result r; if (sgn_a_k > 0) { open = (c_type == Constraint::STRICT_INEQUALITY) ? T_YES : T_NO; - if (open == T_NO) + if (open == T_NO) { maybe_reset_fpu_inexact(); + } r = assign_r(t_bound, c_inhomogeneous_term, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } r = neg_assign_r(t_bound, t_bound, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } for (Constraint::expr_type::const_iterator i = c_e.begin(), i_end = c_e.lower_bound(Variable(last_k)); i != i_end; ++i) { const Variable i_var = i.variable(); - if (i_var.id() == k_var.id()) + if (i_var.id() == k_var.id()) { continue; + } const Coefficient& a_i = *i; const int sgn_a_i = sgn(a_i); ITV& x_i = seq[i_var.id()]; if (sgn_a_i < 0) { - if (x_i.lower_is_boundary_infinity()) + if (x_i.lower_is_boundary_infinity()) { goto maybe_refine_upper_1; + } r = assign_r(t_a, a_i, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } r = assign_r(t_x, x_i.lower(), ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; - if (x_i.lower_is_open()) + } + if (x_i.lower_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } } else { PPL_ASSERT(sgn_a_i > 0); - if (x_i.upper_is_boundary_infinity()) + if (x_i.upper_is_boundary_infinity()) { goto maybe_refine_upper_1; + } r = assign_r(t_a, a_i, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } r = assign_r(t_x, x_i.upper(), ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; - if (x_i.upper_is_open()) + } + if (x_i.upper_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } } } r = assign_r(t_a, a_k, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } r = div_assign_r(t_bound, t_bound, t_a, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } // Refine the lower bound of `seq[k]' with `t_bound'. if (open == T_MAYBE - && maybe_check_fpu_inexact() == 1) + && maybe_check_fpu_inexact() == 1) { open = T_YES; + } { const Relation_Symbol rel = (open == T_YES) ? GREATER_THAN : GREATER_OR_EQUAL; @@ -2477,67 +2705,84 @@ } reset_empty_up_to_date(); maybe_refine_upper_1: - if (c_type != Constraint::EQUALITY) + if (c_type != Constraint::EQUALITY) { continue; + } open = T_NO; maybe_reset_fpu_inexact(); r = assign_r(t_bound, c_inhomogeneous_term, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = neg_assign_r(t_bound, t_bound, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } for (Constraint::expr_type::const_iterator i = c_e.begin(), i_end = c_e.lower_bound(Variable(c_space_dim)); i != i_end; ++i) { const Variable i_var = i.variable(); - if (i_var.id() == k_var.id()) + if (i_var.id() == k_var.id()) { continue; + } const Coefficient& a_i = *i; const int sgn_a_i = sgn(a_i); ITV& x_i = seq[i_var.id()]; if (sgn_a_i < 0) { - if (x_i.upper_is_boundary_infinity()) + if (x_i.upper_is_boundary_infinity()) { goto next_k; + } r = assign_r(t_a, a_i, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = assign_r(t_x, x_i.upper(), ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; - if (x_i.upper_is_open()) + } + if (x_i.upper_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } } else { PPL_ASSERT(sgn_a_i > 0); - if (x_i.lower_is_boundary_infinity()) + if (x_i.lower_is_boundary_infinity()) { goto next_k; + } r = assign_r(t_a, a_i, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = assign_r(t_x, x_i.lower(), ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; - if (x_i.lower_is_open()) + } + if (x_i.lower_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } } } r = assign_r(t_a, a_k, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = div_assign_r(t_bound, t_bound, t_a, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } // Refine the upper bound of seq[k] with t_bound. if (open == T_MAYBE - && maybe_check_fpu_inexact() == 1) + && maybe_check_fpu_inexact() == 1) { open = T_YES; + } const Relation_Symbol rel = (open == T_YES) ? LESS_THAN : LESS_OR_EQUAL; seq[k_var.id()].add_constraint(i_constraint(rel, t_bound)); @@ -2546,65 +2791,81 @@ else { PPL_ASSERT(sgn_a_k < 0); open = (c_type == Constraint::STRICT_INEQUALITY) ? T_YES : T_NO; - if (open == T_NO) + if (open == T_NO) { maybe_reset_fpu_inexact(); + } r = assign_r(t_bound, c_inhomogeneous_term, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } r = neg_assign_r(t_bound, t_bound, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } for (Constraint::expr_type::const_iterator i = c_e.begin(), i_end = c_e.lower_bound(Variable(c_space_dim)); i != i_end; ++i) { const Variable i_var = i.variable(); - if (i_var.id() == k_var.id()) + if (i_var.id() == k_var.id()) { continue; + } const Coefficient& a_i = *i; const int sgn_a_i = sgn(a_i); ITV& x_i = seq[i_var.id()]; if (sgn_a_i < 0) { - if (x_i.lower_is_boundary_infinity()) + if (x_i.lower_is_boundary_infinity()) { goto maybe_refine_upper_2; + } r = assign_r(t_a, a_i, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } r = assign_r(t_x, x_i.lower(), ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; - if (x_i.lower_is_open()) + } + if (x_i.lower_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } } else { PPL_ASSERT(sgn_a_i > 0); - if (x_i.upper_is_boundary_infinity()) + if (x_i.upper_is_boundary_infinity()) { goto maybe_refine_upper_2; + } r = assign_r(t_a, a_i, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } r = assign_r(t_x, x_i.upper(), ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; - if (x_i.upper_is_open()) + } + if (x_i.upper_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } } } r = assign_r(t_a, a_k, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } r = div_assign_r(t_bound, t_bound, t_a, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; - + } // Refine the upper bound of seq[k] with t_bound. if (open == T_MAYBE - && maybe_check_fpu_inexact() == 1) + && maybe_check_fpu_inexact() == 1) { open = T_YES; + } { const Relation_Symbol rel = (open == T_YES) ? LESS_THAN : LESS_OR_EQUAL; @@ -2612,67 +2873,84 @@ } reset_empty_up_to_date(); maybe_refine_upper_2: - if (c_type != Constraint::EQUALITY) + if (c_type != Constraint::EQUALITY) { continue; + } open = T_NO; maybe_reset_fpu_inexact(); r = assign_r(t_bound, c_inhomogeneous_term, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = neg_assign_r(t_bound, t_bound, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } for (Constraint::expr_type::const_iterator i = c_e.begin(), i_end = c_e.lower_bound(Variable(c_space_dim)); i != i_end; ++i) { const Variable i_var = i.variable(); - if (i_var.id() == k_var.id()) + if (i_var.id() == k_var.id()) { continue; + } const Coefficient& a_i = *i; const int sgn_a_i = sgn(a_i); ITV& x_i = seq[i_var.id()]; if (sgn_a_i < 0) { - if (x_i.upper_is_boundary_infinity()) + if (x_i.upper_is_boundary_infinity()) { goto next_k; + } r = assign_r(t_a, a_i, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = assign_r(t_x, x_i.upper(), ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; - if (x_i.upper_is_open()) + } + if (x_i.upper_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } } else { PPL_ASSERT(sgn_a_i > 0); - if (x_i.lower_is_boundary_infinity()) + if (x_i.lower_is_boundary_infinity()) { goto next_k; + } r = assign_r(t_a, a_i, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = assign_r(t_x, x_i.lower(), ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; - if (x_i.lower_is_open()) + } + if (x_i.lower_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } } } r = assign_r(t_a, a_k, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = div_assign_r(t_bound, t_bound, t_a, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } // Refine the lower bound of seq[k] with t_bound. if (open == T_MAYBE - && maybe_check_fpu_inexact() == 1) + && maybe_check_fpu_inexact() == 1) { open = T_YES; + } const Relation_Symbol rel = (open == T_YES) ? GREATER_THAN : GREATER_OR_EQUAL; seq[k_var.id()].add_constraint(i_constraint(rel, t_bound)); @@ -2710,8 +2988,9 @@ for (Constraint::expr_type::const_iterator j = c_e.begin(), j_end = c_e.lower_bound(Variable(c_space_dim)); j != j_end; ++j) { const Variable j_var = j.variable(); - if (i_var == j_var) + if (i_var == j_var) { continue; + } q.add_assign(q, p[j_var.id()]); } q.div_assign(q, k[i_var.id()]); @@ -2765,8 +3044,9 @@ WEIGHT_BEGIN(); ++num_iterations; copy = seq; - for (Constraint_System::const_iterator i = cs_begin; i != cs_end; ++i) + for (Constraint_System::const_iterator i = cs_begin; i != cs_end; ++i) { propagate_constraint_no_check(*i); + } WEIGHT_ADD_MUL(40, propagation_weight); // Check if the client has requested abandoning all expensive @@ -2776,8 +3056,9 @@ // NOTE: if max_iterations == 0 (i.e., no iteration limit is set) // the following test will anyway trigger on wrap around. - if (num_iterations == max_iterations) + if (num_iterations == max_iterations) { break; + } changed = (copy != seq); } while (changed); @@ -2789,21 +3070,25 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_image(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "e", expr); + } // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "v", var); + } - if (is_empty()) + if (is_empty()) { return; + } Tmp_Interval_Type expr_value; Tmp_Interval_Type temp0; @@ -2838,15 +3123,19 @@ // Dimension-compatibility checks. const dimension_type space_dim = space_dimension(); const dimension_type lf_space_dim = lf.space_dimension(); - if (space_dim < lf_space_dim) + if (space_dim < lf_space_dim) { throw_dimension_incompatible("affine_form_image(var, lf)", "lf", lf); + } + // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("affine_form_image(var, lf)", "var", var); + } - if (is_empty()) + if (is_empty()) { return; + } // Intervalization of 'lf'. ITV result = lf.inhomogeneous_term(); @@ -2868,21 +3157,25 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_preimage(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. const dimension_type x_space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (x_space_dim < expr_space_dim) + if (x_space_dim < expr_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr); + } // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (x_space_dim < var_space_dim) + if (x_space_dim < var_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "v", var); + } - if (is_empty()) + if (is_empty()) { return; + } const Coefficient& expr_v = expr.coefficient(var); const bool invertible = (expr_v != 0); @@ -2904,10 +3197,12 @@ } ITV& x_seq_v = seq[var.id()]; expr_value.intersect_assign(x_seq_v); - if (expr_value.is_empty()) + if (expr_value.is_empty()) { set_empty(); - else + } + else { x_seq_v.assign(UNIVERSE); + } } else { // The affine transformation is invertible. @@ -2930,35 +3225,40 @@ const Linear_Expression& ub_expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0"); + } // Dimension-compatibility checks. const dimension_type space_dim = space_dimension(); // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "ub", ub_expr); + } // `var' should be one of the dimensions of the box. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "v", var); - + } // Any image of an empty box is empty. - if (is_empty()) + if (is_empty()) { return; - + } // Add the constraint implied by the `lb_expr' and `ub_expr'. - if (denominator > 0) + if (denominator > 0) { refine_with_constraint(lb_expr <= ub_expr); - else + } + else { refine_with_constraint(lb_expr >= ub_expr); + } // Check whether `var' occurs in `lb_expr' and/or `ub_expr'. if (lb_expr.coefficient(var) == 0) { @@ -2967,10 +3267,12 @@ LESS_OR_EQUAL, ub_expr, denominator); - if (denominator > 0) + if (denominator > 0) { refine_with_constraint(lb_expr <= denominator*var); - else + } + else { refine_with_constraint(denominator*var <= lb_expr); + } } else if (ub_expr.coefficient(var) == 0) { // Here `var' can only occur in `lb_expr'. @@ -2978,21 +3280,23 @@ GREATER_OR_EQUAL, lb_expr, denominator); - if (denominator > 0) + if (denominator > 0) { refine_with_constraint(denominator*var <= ub_expr); - else + } + else { refine_with_constraint(ub_expr <= denominator*var); + } } else { // Here `var' occurs in both `lb_expr' and `ub_expr'. As boxes // can only use the non-relational constraints, we find the // maximum/minimum values `ub_expr' and `lb_expr' obtain with the // box and use these instead of the `ub-expr' and `lb-expr'. - PPL_DIRTY_TEMP(Coefficient, max_numer); - PPL_DIRTY_TEMP(Coefficient, max_denom); + PPL_DIRTY_TEMP_COEFFICIENT(max_numer); + PPL_DIRTY_TEMP_COEFFICIENT(max_denom); bool max_included; - PPL_DIRTY_TEMP(Coefficient, min_numer); - PPL_DIRTY_TEMP(Coefficient, min_denom); + PPL_DIRTY_TEMP_COEFFICIENT(min_numer); + PPL_DIRTY_TEMP_COEFFICIENT(min_denom); bool min_included; ITV& seq_v = seq[var.id()]; if (maximize(ub_expr, max_numer, max_denom, max_included)) { @@ -3073,29 +3377,34 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. const dimension_type space_dim = space_dimension(); - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0"); + } // Dimension-compatibility checks. // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "v", var); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "ub", ub_expr); + } // Any preimage of an empty polyhedron is empty. - if (marked_empty()) + if (marked_empty()) { return; + } const bool negative_denom = (denominator < 0); const Coefficient& lb_var_coeff = lb_expr.coefficient(var); @@ -3104,10 +3413,12 @@ // If the implied constraint between `ub_expr and `lb_expr' is // independent of `var', then impose it now. if (lb_var_coeff == ub_var_coeff) { - if (negative_denom) + if (negative_denom) { refine_with_constraint(lb_expr >= ub_expr); - else + } + else { refine_with_constraint(lb_expr <= ub_expr); + } } ITV& seq_var = seq[var.id()]; @@ -3116,35 +3427,38 @@ // so the sign and its (unsigned) value are separated. PPL_DIRTY_TEMP_COEFFICIENT(pos_denominator); pos_denominator = denominator; - if (negative_denom) + if (negative_denom) { neg_assign(pos_denominator, pos_denominator); + } // Store all the information about the upper and lower bounds // for `var' before making this interval unbounded. bool open_lower = seq_var.lower_is_open(); bool unbounded_lower = seq_var.lower_is_boundary_infinity(); PPL_DIRTY_TEMP(mpq_class, q_seq_var_lower); - PPL_DIRTY_TEMP(Coefficient, numer_lower); - PPL_DIRTY_TEMP(Coefficient, denom_lower); + PPL_DIRTY_TEMP_COEFFICIENT(numer_lower); + PPL_DIRTY_TEMP_COEFFICIENT(denom_lower); if (!unbounded_lower) { assign_r(q_seq_var_lower, seq_var.lower(), ROUND_NOT_NEEDED); assign_r(numer_lower, q_seq_var_lower.get_num(), ROUND_NOT_NEEDED); assign_r(denom_lower, q_seq_var_lower.get_den(), ROUND_NOT_NEEDED); - if (negative_denom) + if (negative_denom) { neg_assign(denom_lower, denom_lower); + } numer_lower *= pos_denominator; seq_var.lower_extend(); } bool open_upper = seq_var.upper_is_open(); bool unbounded_upper = seq_var.upper_is_boundary_infinity(); PPL_DIRTY_TEMP(mpq_class, q_seq_var_upper); - PPL_DIRTY_TEMP(Coefficient, numer_upper); - PPL_DIRTY_TEMP(Coefficient, denom_upper); + PPL_DIRTY_TEMP_COEFFICIENT(numer_upper); + PPL_DIRTY_TEMP_COEFFICIENT(denom_upper); if (!unbounded_upper) { assign_r(q_seq_var_upper, seq_var.upper(), ROUND_NOT_NEEDED); assign_r(numer_upper, q_seq_var_upper.get_num(), ROUND_NOT_NEEDED); assign_r(denom_upper, q_seq_var_upper.get_den(), ROUND_NOT_NEEDED); - if (negative_denom) + if (negative_denom) { neg_assign(denom_upper, denom_upper); + } numer_upper *= pos_denominator; seq_var.upper_extend(); } @@ -3155,7 +3469,7 @@ // and adding the lower bound for `var' to the inhomogeneous term. Linear_Expression revised_lb_expr(ub_expr); revised_lb_expr -= ub_var_coeff * var; - PPL_DIRTY_TEMP(Coefficient, d); + PPL_DIRTY_TEMP_COEFFICIENT(d); neg_assign(d, denom_lower); revised_lb_expr *= d; revised_lb_expr += numer_lower; @@ -3163,20 +3477,23 @@ // Find the minimum value for the revised lower bound expression // and use this to refine the appropriate bound. bool included; - PPL_DIRTY_TEMP(Coefficient, denom); + PPL_DIRTY_TEMP_COEFFICIENT(denom); if (minimize(revised_lb_expr, numer_lower, denom, included)) { denom_lower *= (denom * ub_var_coeff); PPL_DIRTY_TEMP(mpq_class, q); assign_r(q.get_num(), numer_lower, ROUND_NOT_NEEDED); assign_r(q.get_den(), denom_lower, ROUND_NOT_NEEDED); q.canonicalize(); - if (!included) + if (!included) { open_lower = true; + } Relation_Symbol rel; - if ((ub_var_coeff >= 0) ? !negative_denom : negative_denom) + if ((ub_var_coeff >= 0) ? !negative_denom : negative_denom) { rel = open_lower ? GREATER_THAN : GREATER_OR_EQUAL; - else + } + else { rel = open_lower ? LESS_THAN : LESS_OR_EQUAL; + } seq_var.add_constraint(i_constraint(rel, q)); if (seq_var.is_empty()) { set_empty(); @@ -3191,7 +3508,7 @@ // and adding the upper bound for `var' to the inhomogeneous term. Linear_Expression revised_ub_expr(lb_expr); revised_ub_expr -= lb_var_coeff * var; - PPL_DIRTY_TEMP(Coefficient, d); + PPL_DIRTY_TEMP_COEFFICIENT(d); neg_assign(d, denom_upper); revised_ub_expr *= d; revised_ub_expr += numer_upper; @@ -3199,20 +3516,23 @@ // Find the maximum value for the revised upper bound expression // and use this to refine the appropriate bound. bool included; - PPL_DIRTY_TEMP(Coefficient, denom); + PPL_DIRTY_TEMP_COEFFICIENT(denom); if (maximize(revised_ub_expr, numer_upper, denom, included)) { denom_upper *= (denom * lb_var_coeff); PPL_DIRTY_TEMP(mpq_class, q); assign_r(q.get_num(), numer_upper, ROUND_NOT_NEEDED); assign_r(q.get_den(), denom_upper, ROUND_NOT_NEEDED); q.canonicalize(); - if (!included) + if (!included) { open_upper = true; + } Relation_Symbol rel; - if ((lb_var_coeff >= 0) ? !negative_denom : negative_denom) + if ((lb_var_coeff >= 0) ? !negative_denom : negative_denom) { rel = open_upper ? LESS_THAN : LESS_OR_EQUAL; - else + } + else { rel = open_upper ? GREATER_THAN : GREATER_OR_EQUAL; + } seq_var.add_constraint(i_constraint(rel, q)); if (seq_var.is_empty()) { set_empty(); @@ -3225,10 +3545,12 @@ // If the implied constraint between `ub_expr and `lb_expr' is // dependent on `var', then impose on the new box. if (lb_var_coeff != ub_var_coeff) { - if (denominator > 0) + if (denominator > 0) { refine_with_constraint(lb_expr <= ub_expr); - else + } + else { refine_with_constraint(lb_expr >= ub_expr); + } } PPL_ASSERT(OK()); @@ -3242,37 +3564,42 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "d == 0"); + } // Dimension-compatibility checks. const dimension_type space_dim = space_dimension(); // The dimension of `expr' should not be greater than the dimension // of `*this'. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "e", expr); + } // `var' should be one of the dimensions of the box. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "v", var); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is the disequality relation symbol"); + } // First compute the affine image. affine_image(var, expr, denominator); - if (relsym == EQUAL) + if (relsym == EQUAL) { // The affine relation is indeed an affine function. return; - + } // Any image of an empty box is empty. - if (is_empty()) + if (is_empty()) { return; + } ITV& seq_var = seq[var.id()]; switch (relsym) { @@ -3281,16 +3608,18 @@ break; case LESS_THAN: seq_var.lower_extend(); - if (!seq_var.upper_is_boundary_infinity()) + if (!seq_var.upper_is_boundary_infinity()) { seq_var.remove_sup(); + } break; case GREATER_OR_EQUAL: seq_var.upper_extend(); break; case GREATER_THAN: seq_var.upper_extend(); - if (!seq_var.lower_is_boundary_infinity()) + if (!seq_var.lower_is_boundary_infinity()) { seq_var.remove_inf(); + } break; default: // The EQUAL and NOT_EQUAL cases have been already dealt with. @@ -3309,26 +3638,29 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "d == 0"); - + } // Dimension-compatibility checks. const dimension_type space_dim = space_dimension(); // The dimension of `expr' should not be greater than the dimension // of `*this'. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", "e", expr); + } // `var' should be one of the dimensions of the box. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", "v", var); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is the disequality relation symbol"); + } // Check whether the affine relation is indeed an affine function. if (relsym == EQUAL) { @@ -3381,12 +3713,12 @@ // First, compute the maximum and minimum value reached by // `denominator*var' on the box as we need to use non-relational // expressions. - PPL_DIRTY_TEMP(Coefficient, max_numer); - PPL_DIRTY_TEMP(Coefficient, max_denom); + PPL_DIRTY_TEMP_COEFFICIENT(max_numer); + PPL_DIRTY_TEMP_COEFFICIENT(max_denom); bool max_included; bool bound_above = maximize(denominator*var, max_numer, max_denom, max_included); - PPL_DIRTY_TEMP(Coefficient, min_numer); - PPL_DIRTY_TEMP(Coefficient, min_denom); + PPL_DIRTY_TEMP_COEFFICIENT(min_numer); + PPL_DIRTY_TEMP_COEFFICIENT(min_denom); bool min_included; bool bound_below = minimize(denominator*var, min_numer, min_denom, min_included); // Use the correct relation symbol @@ -3413,24 +3745,28 @@ switch (corrected_relsym) { case LESS_THAN: - if (bound_below) + if (bound_below) { refine_with_constraint(min_numer < revised_expr); + } break; case LESS_OR_EQUAL: - if (bound_below) + if (bound_below) { (min_included) ? refine_with_constraint(min_numer <= revised_expr) : refine_with_constraint(min_numer < revised_expr); + } break; case GREATER_OR_EQUAL: - if (bound_above) + if (bound_above) { (max_included) ? refine_with_constraint(max_numer >= revised_expr) : refine_with_constraint(max_numer > revised_expr); + } break; case GREATER_THAN: - if (bound_above) + if (bound_above) { refine_with_constraint(max_numer > revised_expr); + } break; default: // The EQUAL and NOT_EQUAL cases have been already dealt with. @@ -3438,8 +3774,9 @@ break; } // If the shrunk box is empty, its preimage is empty too. - if (is_empty()) + if (is_empty()) { return; + } ITV& seq_v = seq[var.id()]; seq_v.assign(UNIVERSE); PPL_ASSERT(OK()); @@ -3456,32 +3793,36 @@ // of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); const dimension_type space_dim = space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e1", lhs); + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e2", rhs); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is the disequality relation symbol"); + } // Any image of an empty box is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // Compute the maximum and minimum value reached by the rhs on the box. - PPL_DIRTY_TEMP(Coefficient, max_numer); - PPL_DIRTY_TEMP(Coefficient, max_denom); + PPL_DIRTY_TEMP_COEFFICIENT(max_numer); + PPL_DIRTY_TEMP_COEFFICIENT(max_denom); bool max_included; bool max_rhs = maximize(rhs, max_numer, max_denom, max_included); - PPL_DIRTY_TEMP(Coefficient, min_numer); - PPL_DIRTY_TEMP(Coefficient, min_denom); + PPL_DIRTY_TEMP_COEFFICIENT(min_numer); + PPL_DIRTY_TEMP_COEFFICIENT(min_denom); bool min_included; bool min_rhs = minimize(rhs, min_numer, min_denom, min_included); @@ -3539,7 +3880,7 @@ // The choice as to which bounds should be set depends on the sign // of the coefficient of the dimension `has_var_id' in the lhs. - if (coeff > 0) + if (coeff > 0) { // The coefficient of the dimension in the lhs is positive. switch (relsym) { case LESS_OR_EQUAL: @@ -3547,23 +3888,28 @@ Relation_Symbol rel = max_included ? LESS_OR_EQUAL : LESS_THAN; seq_var.build(i_constraint(rel, q_max)); } - else + else { seq_var.assign(UNIVERSE); + } break; case LESS_THAN: - if (max_rhs) + if (max_rhs) { seq_var.build(i_constraint(LESS_THAN, q_max)); - else + } + else { seq_var.assign(UNIVERSE); + } break; case EQUAL: { I_Constraint l; I_Constraint u; - if (max_rhs) + if (max_rhs) { u.set(max_included ? LESS_OR_EQUAL : LESS_THAN, q_max); - if (min_rhs) + } + if (min_rhs) { l.set(min_included ? GREATER_OR_EQUAL : GREATER_THAN, q_min); + } seq_var.build(l, u); break; } @@ -3572,21 +3918,25 @@ Relation_Symbol rel = min_included ? GREATER_OR_EQUAL : GREATER_THAN; seq_var.build(i_constraint(rel, q_min)); } - else + else { seq_var.assign(UNIVERSE); + } break; case GREATER_THAN: - if (min_rhs) + if (min_rhs) { seq_var.build(i_constraint(GREATER_THAN, q_min)); - else + } + else { seq_var.assign(UNIVERSE); + } break; default: // The NOT_EQUAL case has been already dealt with. PPL_UNREACHABLE; break; } - else + } + else { // The coefficient of the dimension in the lhs is negative. switch (relsym) { case GREATER_OR_EQUAL: @@ -3594,23 +3944,28 @@ Relation_Symbol rel = min_included ? LESS_OR_EQUAL : LESS_THAN; seq_var.build(i_constraint(rel, q_min)); } - else + else { seq_var.assign(UNIVERSE); + } break; case GREATER_THAN: - if (min_rhs) + if (min_rhs) { seq_var.build(i_constraint(LESS_THAN, q_min)); - else + } + else { seq_var.assign(UNIVERSE); + } break; case EQUAL: { I_Constraint l; I_Constraint u; - if (max_rhs) + if (max_rhs) { l.set(max_included ? GREATER_OR_EQUAL : GREATER_THAN, q_max); - if (min_rhs) + } + if (min_rhs) { u.set(min_included ? LESS_OR_EQUAL : LESS_THAN, q_min); + } seq_var.build(l, u); break; } @@ -3619,20 +3974,24 @@ Relation_Symbol rel = max_included ? GREATER_OR_EQUAL : GREATER_THAN; seq_var.build(i_constraint(rel, q_max)); } - else + else { seq_var.assign(UNIVERSE); + } break; case LESS_THAN: - if (max_rhs) + if (max_rhs) { seq_var.build(i_constraint(GREATER_THAN, q_max)); - else + } + else { seq_var.assign(UNIVERSE); + } break; default: // The NOT_EQUAL case has been already dealt with. PPL_UNREACHABLE; break; } + } } else { @@ -3674,25 +4033,27 @@ // of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); const dimension_type space_dim = space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e1", lhs); + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e2", rhs); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is the disequality relation symbol"); - + } // Any image of an empty box is empty. - if (marked_empty()) + if (marked_empty()) { return; - + } // For any dimension occurring in the lhs, swap and change the sign // of this component for the rhs and lhs. Then use these in a call // to generalized_affine_image/3. @@ -3717,11 +4078,12 @@ && Is_Same_Or_Derived::value, void>::type Box::CC76_widening_assign(const T& y, Iterator first, Iterator last) { - if (y.is_empty()) + if (y.is_empty()) { return; - - for (dimension_type i = seq.size(); i-- > 0; ) + } + for (dimension_type i = seq.size(); i-- > 0; ) { seq[i].CC76_widening_assign(y.seq[i], first, last); + } PPL_ASSERT(OK()); } @@ -3746,8 +4108,9 @@ Box x_tmp(x); x_tmp.CC76_widening_assign(y, 0); // If the widening was not precise, use one of the available tokens. - if (!x.contains(x_tmp)) + if (!x.contains(x_tmp)) { --(*tp); + } return; } x.CC76_widening_assign(y, @@ -3769,8 +4132,9 @@ dimension_type c_num_vars = 0; dimension_type c_only_var = 0; // Constraints that are not interval constraints are ignored. - if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) + if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) { continue; + } // Trivial constraints are ignored. if (c_num_vars != 0) { // c is a non-trivial interval constraint. @@ -3778,9 +4142,10 @@ const Coefficient& n = c.inhomogeneous_term(); const Coefficient& d = c.coefficient(Variable(c_only_var)); if (interval_relation(seq[c_only_var], c.type(), n, d) - == Poly_Con_Relation::is_included()) + == Poly_Con_Relation::is_included()) { limiting_box.add_interval_constraint_no_check(c_only_var, c.type(), n, d); + } } } } @@ -3794,29 +4159,31 @@ const dimension_type space_dim = x.space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("limited_CC76_extrapolation_assign(y, cs)", - y); + y); + } // `cs' must be dimension-compatible with the two boxes. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_constraint_incompatible("limited_CC76_extrapolation_assign(y, cs)"); - + } // The limited CC76-extrapolation between two boxes in a // zero-dimensional space is also a zero-dimensional box - if (space_dim == 0) + if (space_dim == 0) { return; - + } // Assume `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } // Build a limiting box using all the constraints in cs // that are satisfied by *this. Box limiting_box(space_dim, UNIVERSE); @@ -3837,24 +4204,26 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("CC76_narrowing_assign(y)", y); + } // Assume `*this' is contained in or equal to `y'. PPL_EXPECT_HEAVY(copy_contains(y, *this)); // If both boxes are zero-dimensional, // since `y' contains `*this', we simply return `*this'. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // If `y' is empty, since `y' contains `this', `*this' is empty too. - if (y.is_empty()) + if (y.is_empty()) { return; + } // If `*this' is empty, we return. - if (is_empty()) + if (is_empty()) { return; - + } // Replace each constraint in `*this' by the corresponding constraint // in `y' if the corresponding inhomogeneous terms are both finite. for (dimension_type i = space_dim; i-- > 0; ) { @@ -3862,12 +4231,14 @@ const ITV& y_i = y.seq[i]; if (!x_i.lower_is_boundary_infinity() && !y_i.lower_is_boundary_infinity() - && x_i.lower() != y_i.lower()) + && x_i.lower() != y_i.lower()) { x_i.lower() = y_i.lower(); + } if (!x_i.upper_is_boundary_infinity() && !y_i.upper_is_boundary_infinity() - && x_i.upper() != y_i.upper()) + && x_i.upper() != y_i.upper()) { x_i.upper() = y_i.upper(); + } } PPL_ASSERT(OK()); } @@ -3880,8 +4251,9 @@ cs.set_space_dimension(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cs = Constraint_System::zero_dim_empty(); + } return cs; } @@ -3892,20 +4264,24 @@ for (dimension_type k = 0; k < space_dim; ++k) { const Variable v_k = Variable(k); - PPL_DIRTY_TEMP(Coefficient, n); - PPL_DIRTY_TEMP(Coefficient, d); + PPL_DIRTY_TEMP_COEFFICIENT(n); + PPL_DIRTY_TEMP_COEFFICIENT(d); bool closed = false; if (has_lower_bound(v_k, n, d, closed)) { - if (closed) + if (closed) { cs.insert(d * v_k >= n); - else + } + else { cs.insert(d * v_k > n); + } } if (has_upper_bound(v_k, n, d, closed)) { - if (closed) + if (closed) { cs.insert(d * v_k <= n); - else + } + else { cs.insert(d * v_k < n); + } } } return cs; @@ -3919,8 +4295,9 @@ cs.set_space_dimension(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cs = Constraint_System::zero_dim_empty(); + } return cs; } @@ -3932,26 +4309,31 @@ for (dimension_type k = 0; k < space_dim; ++k) { const Variable v_k = Variable(k); - PPL_DIRTY_TEMP(Coefficient, n); - PPL_DIRTY_TEMP(Coefficient, d); + PPL_DIRTY_TEMP_COEFFICIENT(n); + PPL_DIRTY_TEMP_COEFFICIENT(d); bool closed = false; if (has_lower_bound(v_k, n, d, closed)) { - if (closed) + if (closed) { // Make sure equality constraints are detected. if (seq[k].is_singleton()) { cs.insert(d * v_k == n); continue; } - else + else { cs.insert(d * v_k >= n); - else + } + } + else { cs.insert(d * v_k > n); + } } if (has_upper_bound(v_k, n, d, closed)) { - if (closed) + if (closed) { cs.insert(d * v_k <= n); - else + } + else { cs.insert(d * v_k < n); + } } } return cs; @@ -3964,8 +4346,9 @@ Congruence_System cgs(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cgs = Congruence_System::zero_dim_empty(); + } return cgs; } @@ -3977,13 +4360,15 @@ for (dimension_type k = 0; k < space_dim; ++k) { const Variable v_k = Variable(k); - PPL_DIRTY_TEMP(Coefficient, n); - PPL_DIRTY_TEMP(Coefficient, d); + PPL_DIRTY_TEMP_COEFFICIENT(n); + PPL_DIRTY_TEMP_COEFFICIENT(d); bool closed = false; - if (has_lower_bound(v_k, n, d, closed) && closed) + if (has_lower_bound(v_k, n, d, closed) && closed) { // Make sure equality congruences are detected. - if (seq[k].is_singleton()) + if (seq[k].is_singleton()) { cgs.insert((d * v_k %= n) / 0); + } + } } return cgs; } @@ -3992,8 +4377,9 @@ memory_size_type Box::external_memory_in_bytes() const { memory_size_type n = seq.capacity() * sizeof(ITV); - for (dimension_type k = seq.size(); k-- > 0; ) + for (dimension_type k = seq.size(); k-- > 0; ) { n += seq[k].external_memory_in_bytes(); + } return n; } @@ -4001,20 +4387,25 @@ template std::ostream& IO_Operators::operator<<(std::ostream& s, const Box& box) { - if (box.is_empty()) + if (box.is_empty()) { s << "false"; - else if (box.is_universe()) + } + else if (box.is_universe()) { s << "true"; - else + } + else { for (dimension_type k = 0, space_dim = box.space_dimension(); k < space_dim; ) { s << Variable(k) << " in " << box[k]; ++k; - if (k < space_dim) + if (k < space_dim) { s << ", "; - else + } + else { break; + } } + } return s; } @@ -4026,8 +4417,9 @@ const dimension_type space_dim = space_dimension(); s << "space_dim" << separator << space_dim; s << "\n"; - for (dimension_type i = 0; i < space_dim; ++i) + for (dimension_type i = 0; i < space_dim; ++i) { seq[i].ascii_dump(s); + } } PPL_OUTPUT_TEMPLATE_DEFINITIONS(ITV, Box) @@ -4035,23 +4427,26 @@ template bool Box::ascii_load(std::istream& s) { - if (!status.ascii_load(s)) + if (!status.ascii_load(s)) { return false; - + } std::string str; dimension_type space_dim; - if (!(s >> str) || str != "space_dim") + if (!(s >> str) || str != "space_dim") { return false; - if (!(s >> space_dim)) + } + if (!(s >> space_dim)) { return false; - + } seq.clear(); ITV seq_i; for (dimension_type i = 0; i < space_dim; ++i) { - if (seq_i.ascii_load(s)) + if (seq_i.ascii_load(s)) { seq.push_back(seq_i); - else + } + else { return false; + } } // Check invariants. @@ -4205,15 +4600,17 @@ Temp& tmp0, Temp& tmp1, Temp& tmp2) { const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; - + } // Zero-dim boxes are equal if and only if they are both empty or universe. if (x_space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -4227,8 +4624,9 @@ assign_r(r, 0, ROUND_NOT_NEEDED); return true; } - else + else { goto pinf; + } } assign_r(tmp0, 0, ROUND_NOT_NEEDED); @@ -4237,11 +4635,13 @@ const ITV& y_i = y.seq[i]; // Dealing with the lower bounds. if (x_i.lower_is_boundary_infinity()) { - if (!y_i.lower_is_boundary_infinity()) + if (!y_i.lower_is_boundary_infinity()) { goto pinf; + } } - else if (y_i.lower_is_boundary_infinity()) + else if (y_i.lower_is_boundary_infinity()) { goto pinf; + } else { const Temp* tmp1p; const Temp* tmp2p; @@ -4258,13 +4658,17 @@ Specialization::combine(tmp0, tmp1, dir); } // Dealing with the lower bounds. - if (x_i.upper_is_boundary_infinity()) - if (y_i.upper_is_boundary_infinity()) + if (x_i.upper_is_boundary_infinity()) { + if (y_i.upper_is_boundary_infinity()) { continue; - else + } + else { goto pinf; - else if (y_i.upper_is_boundary_infinity()) + } + } + else if (y_i.upper_is_boundary_infinity()) { goto pinf; + } else { const Temp* tmp1p; const Temp* tmp2p; diff -Nru ppl-1.1/src/Box_types.hh ppl-1.2/src/Box_types.hh --- ppl-1.1/src/Box_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Box_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/BUGS.cc.dist ppl-1.2/src/BUGS.cc.dist --- ppl-1.1/src/BUGS.cc.dist 2013-10-28 12:47:20.000000000 +0000 +++ ppl-1.2/src/BUGS.cc.dist 2016-02-11 12:40:41.000000000 +0000 @@ -1,3 +1,4 @@ +#include "BUGS.hh" extern const char* const BUGS_array[23] = { "", "The PPL developers encourage you to report any bugs you find using the", diff -Nru ppl-1.1/src/Cast_Floating_Point_Expression_defs.hh ppl-1.2/src/Cast_Floating_Point_Expression_defs.hh --- ppl-1.1/src/Cast_Floating_Point_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Cast_Floating_Point_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declarations for the Cast_Floating_Point_Expression class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Cast_Floating_Point_Expression_inlines.hh ppl-1.2/src/Cast_Floating_Point_Expression_inlines.hh --- ppl-1.1/src/Cast_Floating_Point_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Cast_Floating_Point_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Cast_Floating_Point_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Cast_Floating_Point_Expression_templates.hh ppl-1.2/src/Cast_Floating_Point_Expression_templates.hh --- ppl-1.1/src/Cast_Floating_Point_Expression_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Cast_Floating_Point_Expression_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Cast_Floating_Point_Expression class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -32,8 +32,9 @@ ::linearize(const FP_Interval_Abstract_Store& int_store, const FP_Linear_Form_Abstract_Store& lf_store, FP_Linear_Form& result) const { - if (!expr->linearize(int_store, lf_store, result)) + if (!expr->linearize(int_store, lf_store, result)) { return false; + } FP_Linear_Form rel_error; relative_error(result, rel_error); result += rel_error; diff -Nru ppl-1.1/src/Cast_Floating_Point_Expression_types.hh ppl-1.2/src/Cast_Floating_Point_Expression_types.hh --- ppl-1.1/src/Cast_Floating_Point_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Cast_Floating_Point_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/checked.cc ppl-1.2/src/checked.cc --- ppl-1.1/src/checked.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/checked.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Helper functions for checked numbers. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -93,8 +93,9 @@ default: return -1; } - if (n >= base) + if (n >= base) { return -1; + } return static_cast(n); } @@ -109,12 +110,14 @@ sum_sign(bool& a_neg, unsigned long& a_mod, bool b_neg, unsigned long b_mod) { if (a_neg == b_neg) { - if (a_mod > C_Integer::max - b_mod) + if (a_mod > C_Integer::max - b_mod) { return false; + } a_mod += b_mod; } - else if (a_mod >= b_mod) + else if (a_mod >= b_mod) { a_mod -= b_mod; + } else { a_neg = !a_neg; a_mod = b_mod - a_mod; @@ -145,89 +148,110 @@ numer.exponent = 0; char c; do { - if (!is.get(c)) + if (!is.get(c)) { return V_CVT_STR_UNK; + } } while (is_space(c)); switch (c) { case '-': numer.neg_mantissa = true; // Fall through. case '+': - if (!is.get(c)) + if (!is.get(c)) { return V_CVT_STR_UNK; - if (c == 'i' || c == 'I') - goto inf; - if (c != '.') + } + if (c == 'i' || c == 'I') { + goto infinity; + } + if (c != '.') { break; + } // Fall through. case '.': state = FRACTIONAL; - if (!is.get(c)) + if (!is.get(c)) { return V_CVT_STR_UNK; + } break; case 'n': case 'N': - if (!is.get(c)) + if (!is.get(c)) { return V_CVT_STR_UNK; - if (c != 'a' && c != 'A') - goto unexpected; - if (!is.get(c)) + } + if (c != 'a' && c != 'A') { + goto unexpected_char; + } + if (!is.get(c)) { return V_CVT_STR_UNK; - if (c != 'n' && c != 'N') - goto unexpected; + } + if (c != 'n' && c != 'N') { + goto unexpected_char; + } return V_NAN; - inf: + infinity: case 'i': case 'I': - if (!is.get(c)) + if (!is.get(c)) { return V_CVT_STR_UNK; - if (c != 'n' && c != 'n') - goto unexpected; - if (!is.get(c)) + } + if (c != 'n' && c != 'n') { + goto unexpected_char; + } + if (!is.get(c)) { return V_CVT_STR_UNK; - if (c != 'f' && c != 'F') - goto unexpected; + } + if (c != 'f' && c != 'F') { + goto unexpected_char; + } return numer.neg_mantissa ? V_EQ_MINUS_INFINITY : V_EQ_PLUS_INFINITY; } if (state != FRACTIONAL) { - if (get_digit(c, 10) < 0) - goto unexpected; + if (get_digit(c, 10) < 0) { + goto unexpected_char; + } char d; if (c == '0' && !is.get(d).fail()) { if (d == 'x' || d == 'X') { numer.base = 16; numer.base_for_exponent = 16; state = INTEGER; - if (!is.get(c)) + if (!is.get(c)) { return V_CVT_STR_UNK; + } } - else + else { is.unget(); + } } } do { switch (state) { case BASE: if (get_digit(c, 10) >= 0) { - if (c != '0' || !numer.mantissa.empty()) + if (c != '0' || !numer.mantissa.empty()) { numer.mantissa += c; + } empty_mantissa = false; break; } if (c == '^') { - if (!is.get(c)) + if (!is.get(c)) { return V_CVT_STR_UNK; - if (c != '^') - goto unexpected; + } + if (c != '^') { + goto unexpected_char; + } numer.base = 0; for (std::string::const_iterator i = numer.mantissa.begin(); i != numer.mantissa.end(); ++i) { numer.base = numer.base * 10 + static_cast(get_digit(*i, 10)); - if (numer.base > 36) - goto unexpected; + if (numer.base > 36) { + goto unexpected_char; + } + } + if (numer.base < 2) { + goto unexpected_char; } - if (numer.base < 2) - goto unexpected; numer.base_for_exponent = numer.base; numer.mantissa.erase(); empty_mantissa = true; @@ -237,8 +261,9 @@ goto integer; case INTEGER: if (get_digit(c, numer.base) >= 0) { - if (c != '0' || !numer.mantissa.empty()) + if (c != '0' || !numer.mantissa.empty()) { numer.mantissa += c; + } empty_mantissa = false; break; } @@ -251,44 +276,52 @@ case FRACTIONAL: if (get_digit(c, numer.base) >= 0) { --exponent_offset; - if (c != '0' || !numer.mantissa.empty()) + if (c != '0' || !numer.mantissa.empty()) { numer.mantissa += c; + } empty_mantissa = false; break; } fractional: - if (empty_mantissa) - goto unexpected; - if (c == 'e' || c == 'E') - goto exp; + if (empty_mantissa) { + goto unexpected_char; + } + if (c == 'e' || c == 'E') { + goto exponent; + } if (c == 'p' || c == 'P') { if (numer.base == 16) { numer.base_for_exponent = 2; exponent_offset_scale = 4; - goto exp; + goto exponent; + } + else { + goto unexpected_char; } - else - goto unexpected; } if (c == '*') { - if (!is.get(c)) + if (!is.get(c)) { return V_CVT_STR_UNK; - if (c != '^') - goto unexpected; - exp: + } + if (c != '^') { + goto unexpected_char; + } + exponent: state = EXPONENT; PPL_ASSERT(numer.base >= 2); const long l_max = C_Integer::max; max_exp_div = static_cast(l_max) / numer.base; max_exp_rem = static_cast(l_max % static_cast(numer.base)); - if (!is.get(c)) + if (!is.get(c)) { return V_CVT_STR_UNK; + } if (c == '-') { numer.neg_exponent = true; break; } - if (c == '+') + if (c == '+') { break; + } continue; } is.unget(); @@ -298,21 +331,24 @@ if (d >= 0) { empty_exponent = false; if (numer.exponent > max_exp_div - || (numer.exponent == max_exp_div && d > max_exp_rem)) + || (numer.exponent == max_exp_div && d > max_exp_rem)) { return V_CVT_STR_UNK; + } numer.exponent = 10 * numer.exponent + static_cast(d); break; } - if (empty_exponent) - goto unexpected; + if (empty_exponent) { + goto unexpected_char; + } is.unget(); goto ok; } is.get(c); } while (!is.fail()); - if (empty_mantissa || is.bad()) + if (empty_mantissa || is.bad()) { return V_CVT_STR_UNK; + } ok: { @@ -327,14 +363,15 @@ neg = true; exponent_offset = -exponent_offset; } - else + else { neg = false; + } sum_sign(numer.neg_exponent, numer.exponent, neg, static_cast(exponent_offset) * exponent_offset_scale); return V_EQ; } - unexpected: + unexpected_char: is.unget(); return V_CVT_STR_UNK; } @@ -348,12 +385,14 @@ parse_number(std::istream& is, number_struct& numer, number_struct& denom) { // Read the numerator. Result r = parse_number_part(is, numer); - if (r != V_EQ) + if (r != V_EQ) { return r; + } char c; is.get(c); - if (is.bad()) + if (is.bad()) { return V_CVT_STR_UNK; + } if (!is) { denom.base = 0; return r; @@ -365,8 +404,9 @@ } // Read the denominator. r = parse_number_part(is, denom); - if (r != V_EQ) + if (r != V_EQ) { return V_CVT_STR_UNK; + } if (numer.base == denom.base && numer.base_for_exponent == denom.base_for_exponent) { if (sum_sign(numer.neg_exponent, numer.exponent, @@ -376,8 +416,9 @@ denom.exponent = numer.exponent; numer.exponent = 0; } - else + else { denom.exponent = 0; + } } } return V_EQ; @@ -394,10 +435,12 @@ return r; } is.clear(is.rdstate() & ~is.failbit); - if (r != V_EQ) + if (r != V_EQ) { return r; - if (denom_struct.base != 0 && denom_struct.mantissa.empty()) + } + if (denom_struct.base != 0 && denom_struct.mantissa.empty()) { return V_NAN; + } if (numer_struct.mantissa.empty()) { to = 0; return V_EQ; @@ -407,8 +450,9 @@ mpz_set_str(numer, numer_struct.mantissa.c_str(), static_cast(numer_struct.base)); if (denom_struct.base != 0) { - if (numer_struct.neg_mantissa != denom_struct.neg_mantissa) + if (numer_struct.neg_mantissa != denom_struct.neg_mantissa) { mpz_neg(numer, numer); + } mpz_set_str(denom, denom_struct.mantissa.c_str(), static_cast(denom_struct.base)); if (numer_struct.exponent != 0 || denom_struct.exponent != 0) { @@ -418,25 +462,30 @@ if (numer_struct.exponent != 0) { mpz_ui_pow_ui(z, numer_struct.base_for_exponent, numer_struct.exponent); - if (numer_struct.neg_exponent) + if (numer_struct.neg_exponent) { mpz_mul(denom, denom, z); - else + } + else { mpz_mul(numer, numer, z); + } } if (denom_struct.exponent != 0) { mpz_ui_pow_ui(z, denom_struct.base_for_exponent, denom_struct.exponent); - if (denom_struct.neg_exponent) + if (denom_struct.neg_exponent) { mpz_mul(numer, numer, z); - else + } + else { mpz_mul(denom, denom, z); + } } mpz_clear(z); } } else { - if (numer_struct.neg_mantissa) + if (numer_struct.neg_mantissa) { mpz_neg(numer, numer); + } if (numer_struct.exponent != 0) { if (numer_struct.neg_exponent) { // Add the negative exponent as a denominator. @@ -471,10 +520,12 @@ mpz_mul(n, n, d); } size_t bufsize = mpz_sizeinbase(n, 10); - if (bufsize < decimals) + if (bufsize < decimals) { bufsize = decimals + 4; - else + } + else { bufsize += 3; + } char buf[bufsize]; mpz_get_str(buf, 10, n); if (decimals != 0) { @@ -497,4 +548,3 @@ } // namespace Checked } // namespace Parma_Polyhedra_Library - diff -Nru ppl-1.1/src/checked_defs.hh ppl-1.2/src/checked_defs.hh --- ppl-1.1/src/checked_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/checked_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Abstract checked arithmetic function container. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,14 +24,14 @@ #ifndef PPL_checked_defs_hh #define PPL_checked_defs_hh 1 -#include -#include -#include #include "mp_std_bits_defs.hh" #include "Temp_defs.hh" #include "Rounding_Dir_defs.hh" #include "Numeric_Format_defs.hh" #include "Float_defs.hh" +#include +#include +#include namespace Parma_Polyhedra_Library { diff -Nru ppl-1.1/src/checked_ext_inlines.hh ppl-1.2/src/checked_ext_inlines.hh --- ppl-1.1/src/checked_ext_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/checked_ext_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Checked extended arithmetic functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -49,14 +49,18 @@ template inline Result_Relation sgn_ext(const Type& x) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return VR_EMPTY; - else if (is_minf(x)) + } + else if (is_minf(x)) { return VR_LT; - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return VR_GT; + } else { native: return sgn(x); @@ -67,14 +71,18 @@ typename To, typename From> inline Result construct_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return construct_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return construct_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return construct_special(to, VC_PLUS_INFINITY, dir); + } else { native: return construct(to, x, dir); @@ -85,14 +93,18 @@ typename To, typename From> inline Result assign_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return assign(to, x, dir); @@ -103,14 +115,18 @@ typename To, typename From> inline Result neg_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); + } else { native: return neg(to, x, dir); @@ -121,14 +137,18 @@ typename To, typename From> inline Result floor_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return floor(to, x, dir); @@ -139,14 +159,18 @@ typename To, typename From> inline Result ceil_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return ceil(to, x, dir); @@ -157,14 +181,18 @@ typename To, typename From> inline Result trunc_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return trunc(to, x, dir); @@ -175,12 +203,15 @@ typename To, typename From> inline Result abs_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x) || is_pinf(x)) + } + else if (is_minf(x) || is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return abs(to, x, dir); @@ -191,23 +222,28 @@ typename To, typename From1, typename From2> inline Result add_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (is_minf(x)) { - if (CHECK_P(To_Policy::check_inf_add_inf, is_pinf(y))) + if (CHECK_P(To_Policy::check_inf_add_inf, is_pinf(y))) { goto inf_add_inf; - else + } + else { goto minf; + } } else if (is_pinf(x)) { if (CHECK_P(To_Policy::check_inf_add_inf, is_minf(y))) { inf_add_inf: return assign_nan(to, V_INF_ADD_INF); } - else + else { goto pinf; + } } else { if (is_minf(y)) { @@ -229,23 +265,28 @@ typename To, typename From1, typename From2> inline Result sub_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (is_minf(x)) { - if (CHECK_P(To_Policy::check_inf_sub_inf, is_minf(y))) + if (CHECK_P(To_Policy::check_inf_sub_inf, is_minf(y))) { goto inf_sub_inf; - else + } + else { goto minf; + } } else if (is_pinf(x)) { if (CHECK_P(To_Policy::check_inf_sub_inf, is_pinf(y))) { inf_sub_inf: return assign_nan(to, V_INF_SUB_INF); } - else + else { goto pinf; + } } else { if (is_pinf(y)) { @@ -267,10 +308,12 @@ typename To, typename From1, typename From2> inline Result mul_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (is_minf(x)) { switch (sgn_ext(y)) { case VR_LT: @@ -329,11 +372,13 @@ inline Result add_mul_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { if (!ext_to_handle(to) - && !ext_to_handle(x) && !ext_to_handle(y)) + && !ext_to_handle(x) && !ext_to_handle(y)) { goto native; + } if (is_nan(to) - || is_nan(x) || is_nan(y)) + || is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (is_minf(x)) { switch (sgn_ext(y)) { case VR_LT: @@ -369,18 +414,21 @@ switch (sgn(x)) { case VR_LT: a_minf: - if (CHECK_P(To_Policy::check_inf_add_inf, is_pinf(to))) + if (CHECK_P(To_Policy::check_inf_add_inf, is_pinf(to))) { goto inf_add_inf; - else + } + else { goto minf; + } case VR_GT: a_pinf: if (CHECK_P(To_Policy::check_inf_add_inf, is_minf(to))) { inf_add_inf: return assign_nan(to, V_INF_ADD_INF); } - else + else { goto pinf; + } default: inf_mul_zero: PPL_ASSERT(To_Policy::check_inf_mul_zero); @@ -407,11 +455,13 @@ inline Result sub_mul_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { if (!ext_to_handle(to) - && !ext_to_handle(x) && !ext_to_handle(y)) + && !ext_to_handle(x) && !ext_to_handle(y)) { goto native; + } if (is_nan(to) - || is_nan(x) || is_nan(y)) + || is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (is_minf(x)) { switch (sgn_ext(y)) { case VR_LT: @@ -447,18 +497,21 @@ switch (sgn(x)) { case VR_LT: a_minf: - if (CHECK_P(To_Policy::check_inf_sub_inf, is_minf(to))) + if (CHECK_P(To_Policy::check_inf_sub_inf, is_minf(to))) { goto inf_sub_inf; - else + } + else { goto pinf; + } case VR_GT: a_pinf: if (CHECK_P(To_Policy::check_inf_sub_inf, is_pinf(to))) { inf_sub_inf: return assign_nan(to, V_INF_SUB_INF); } - else + else { goto minf; + } default: inf_mul_zero: PPL_ASSERT(To_Policy::check_inf_mul_zero); @@ -484,14 +537,17 @@ typename To, typename From1, typename From2> inline Result div_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (is_minf(x)) { if (CHECK_P(To_Policy::check_inf_div_inf, is_minf(y) - || is_pinf(y))) + || is_pinf(y))) { goto inf_div_inf; + } else { switch (sgn(y)) { case VR_LT: @@ -541,14 +597,17 @@ typename To, typename From1, typename From2> inline Result idiv_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (is_minf(x)) { if (CHECK_P(To_Policy::check_inf_div_inf, is_minf(y) - || is_pinf(y))) + || is_pinf(y))) { goto inf_div_inf; + } else { switch (sgn(y)) { case VR_LT: @@ -598,10 +657,12 @@ typename To, typename From1, typename From2> inline Result rem_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (CHECK_P(To_Policy::check_inf_mod, is_minf(x) || is_pinf(x))) { return assign_nan(to, V_INF_MOD); @@ -622,14 +683,18 @@ typename To, typename From> inline Result add_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return add_2exp(to, x, exp, dir); @@ -640,14 +705,18 @@ typename To, typename From> inline Result sub_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return sub_2exp(to, x, exp, dir); @@ -658,14 +727,18 @@ typename To, typename From> inline Result mul_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return mul_2exp(to, x, exp, dir); @@ -676,14 +749,18 @@ typename To, typename From> inline Result div_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return div_2exp(to, x, exp, dir); @@ -694,10 +771,12 @@ typename To, typename From> inline Result smod_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (CHECK_P(To_Policy::check_inf_mod, is_minf(x) || is_pinf(x))) { return assign_nan(to, V_INF_MOD); @@ -712,10 +791,12 @@ typename To, typename From> inline Result umod_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (CHECK_P(To_Policy::check_inf_mod, is_minf(x) || is_pinf(x))) { return assign_nan(to, V_INF_MOD); @@ -730,15 +811,18 @@ typename To, typename From> inline Result sqrt_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (is_minf(x)) { return assign_nan(to, V_SQRT_NEG); } - else if (is_pinf(x)) + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return sqrt(to, x, dir); @@ -749,14 +833,18 @@ typename To, typename From1, typename From2> inline Result gcd_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (is_nan(x) || is_nan(y)) + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x) || is_pinf(x)) + } + else if (is_minf(x) || is_pinf(x)) { return abs_ext(to, y, dir); - else if (is_minf(y) || is_pinf(y)) + } + else if (is_minf(y) || is_pinf(y)) { return abs_ext(to, x, dir); - else + } + else { return gcd(to, x, y, dir); + } } template (x) || is_nan(y)) + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (is_minf(x) || is_pinf(x)) { s = 0; t = y > 0 ? -1 : 1; @@ -778,40 +867,50 @@ t = 0; return abs_ext(to, x, dir); } - else + else { return gcdext(to, s, t, x, y, dir); + } } template inline Result lcm_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (is_nan(x) || is_nan(y)) + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (is_minf(x) || is_pinf(x) - || is_minf(y) || is_pinf(y)) + || is_minf(y) || is_pinf(y)) { return assign_special(to, VC_PLUS_INFINITY, dir); - else + } + else { return lcm(to, x, y, dir); + } } template inline Result_Relation cmp_ext(const Type1& x, const Type2& y) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return VR_EMPTY; - else if (is_minf(x)) + } + else if (is_minf(x)) { return is_minf(y) ? VR_EQ : VR_LT; - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return is_pinf(y) ? VR_EQ : VR_GT; + } else { - if (is_minf(y)) + if (is_minf(y)) { return VR_GT; - if (is_pinf(y)) + } + if (is_pinf(y)) { return VR_LT; + } native: return cmp(x, y); } @@ -821,14 +920,18 @@ typename Type1, typename Type2> inline bool lt_ext(const Type1& x, const Type2& y) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return false; - if (is_pinf(x) || is_minf(y)) + } + if (is_pinf(x) || is_minf(y)) { return false; - if (is_minf(x) || is_pinf(y)) + } + if (is_minf(x) || is_pinf(y)) { return true; + } native: return lt_p(x, y); } @@ -844,14 +947,18 @@ typename Type1, typename Type2> inline bool le_ext(const Type1& x, const Type2& y) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return false; - if (is_minf(x) || is_pinf(y)) + } + if (is_minf(x) || is_pinf(y)) { return true; - if (is_pinf(x) || is_minf(y)) + } + if (is_pinf(x) || is_minf(y)) { return false; + } native: return le_p(x, y); } @@ -867,16 +974,21 @@ typename Type1, typename Type2> inline bool eq_ext(const Type1& x, const Type2& y) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return false; - if (is_minf(x)) + } + if (is_minf(x)) { return is_minf(y); - if (is_pinf(x)) + } + if (is_pinf(x)) { return is_pinf(y); - else if (is_minf(y) || is_pinf(y)) + } + else if (is_minf(y) || is_pinf(y)) { return false; + } native: return eq_p(x, y); } @@ -892,8 +1004,9 @@ inline Result output_ext(std::ostream& os, const Type& x, const Numeric_Format& format, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; + } if (is_nan(x)) { os << "nan"; return V_NAN; diff -Nru ppl-1.1/src/checked_float_inlines.hh ppl-1.2/src/checked_float_inlines.hh --- ppl-1.1/src/checked_float_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/checked_float_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Specialized "checked" functions for native floating-point numbers. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -148,24 +148,30 @@ inline Result classify_float(const T v, bool nan, bool inf, bool sign) { Float f(v); - if ((nan || sign) && CHECK_P(Policy::has_nan, f.u.binary.is_nan())) + if ((nan || sign) && CHECK_P(Policy::has_nan, f.u.binary.is_nan())) { return V_NAN; + } if (inf) { if (Policy::has_infinity) { int sign_inf = f.u.binary.inf_sign(); - if (sign_inf < 0) + if (sign_inf < 0) { return V_EQ_MINUS_INFINITY; - if (sign_inf > 0) + } + if (sign_inf > 0) { return V_EQ_PLUS_INFINITY; + } } - else + else { PPL_ASSERT(f.u.binary.inf_sign() == 0); + } } if (sign) { - if (v < 0) + if (v < 0) { return V_LT; - if (v > 0) + } + if (v > 0) { return V_GT; + } return V_EQ; } return V_LGE; @@ -288,8 +294,9 @@ inline void prepare_inexact(Rounding_Dir dir) { if (Policy::fpu_check_inexact - && !round_not_needed(dir) && round_strict_relation(dir)) + && !round_not_needed(dir) && round_strict_relation(dir)) { fpu_reset_inexact(); + } } template @@ -330,8 +337,9 @@ template inline Result assign_float_float_exact(To& to, const From from, Rounding_Dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } to = from; return V_EQ; } @@ -339,11 +347,13 @@ template inline Result assign_float_float_inexact(To& to, const From from, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = from; + } else if (fpu_inverse_rounding(dir)) { From tmp = -from; to = tmp; @@ -364,19 +374,23 @@ template inline Result assign_float_float(To& to, const From from, Rounding_Dir dir) { - if (sizeof(From) > sizeof(To)) + if (sizeof(From) > sizeof(To)) { return assign_float_float_inexact(to, from, dir); - else + } + else { return assign_float_float_exact(to, from, dir); + } } template inline Result floor_float(Type& to, const Type from, Rounding_Dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - if (fpu_direct_rounding(ROUND_DOWN)) + } + if (fpu_direct_rounding(ROUND_DOWN)) { to = round_to_integer(from); + } else if (fpu_inverse_rounding(ROUND_DOWN)) { to = round_to_integer(-from); limit_precision(to); @@ -396,10 +410,12 @@ template inline Result ceil_float(Type& to, const Type from, Rounding_Dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - if (fpu_direct_rounding(ROUND_UP)) + } + if (fpu_direct_rounding(ROUND_UP)) { to = round_to_integer(from); + } else if (fpu_inverse_rounding(ROUND_UP)) { to = round_to_integer(-from); limit_precision(to); @@ -419,19 +435,23 @@ template inline Result trunc_float(Type& to, const Type from, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - if (from >= 0) + } + if (from >= 0) { return floor(to, from, dir); - else + } + else { return ceil(to, from, dir); + } } template inline Result neg_float(Type& to, const Type from, Rounding_Dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } to = -from; return V_EQ; } @@ -445,8 +465,9 @@ return assign_nan(to, V_INF_ADD_INF); } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = x + y; + } else if (fpu_inverse_rounding(dir)) { to = -x - y; limit_precision(to); @@ -461,8 +482,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -475,8 +497,9 @@ return assign_nan(to, V_INF_SUB_INF); } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = x - y; + } else if (fpu_inverse_rounding(dir)) { to = y - x; limit_precision(to); @@ -491,8 +514,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -507,8 +531,9 @@ return assign_nan(to, V_INF_MUL_ZERO); } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = x * y; + } else if (fpu_inverse_rounding(dir)) { to = x * -y; limit_precision(to); @@ -523,8 +548,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -540,8 +566,9 @@ return assign_nan(to, V_DIV_ZERO); } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = x / y; + } else if (fpu_inverse_rounding(dir)) { to = x / -y; limit_precision(to); @@ -556,8 +583,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -575,8 +603,9 @@ } Result r1 = trunc(to, temp, ROUND_NOT_NEEDED); PPL_ASSERT(r1 == V_EQ); - if (r == V_EQ || to != temp) + if (r == V_EQ || to != temp) { return r1; + } // FIXME: Prove that it is impossible to return a strict relation return (dir == ROUND_UP) ? V_LE : V_GE; } @@ -592,8 +621,9 @@ return assign_nan(to, V_MOD_ZERO); } to = std::fmod(x, y); - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return V_EQ; } @@ -605,8 +635,9 @@ template inline Result add_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } PPL_ASSERT(exp < sizeof_to_bits(sizeof(unsigned long long))); return add(to, @@ -618,8 +649,9 @@ template inline Result sub_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } PPL_ASSERT(exp < sizeof_to_bits(sizeof(unsigned long long))); return sub(to, @@ -631,8 +663,9 @@ template inline Result mul_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } PPL_ASSERT(exp < sizeof_to_bits(sizeof(unsigned long long))); return mul(to, @@ -644,8 +677,9 @@ template inline Result div_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } PPL_ASSERT(exp < sizeof_to_bits(sizeof(unsigned long long))); return div(to, @@ -657,8 +691,9 @@ template inline Result smod_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (To_Policy::check_inf_mod && is_inf_float(x)) { return assign_nan(to, V_INF_MOD); } @@ -666,34 +701,39 @@ Type m = 1ULL << exp; rem_float(to, x, m, ROUND_IGNORE); Type m2 = m / 2; - if (to < -m2) + if (to < -m2) { return add_float(to, to, m, dir); - else if (to >= m2) + } + else if (to >= m2) { return sub_float(to, to, m, dir); + } return V_EQ; } template inline Result umod_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (To_Policy::check_inf_mod && is_inf_float(x)) { return assign_nan(to, V_INF_MOD); } PPL_ASSERT(exp < sizeof_to_bits(sizeof(unsigned long long))); Type m = 1ULL << exp; rem_float(to, x, m, ROUND_IGNORE); - if (to < 0) + if (to < 0) { return add_float(to, to, m, dir); + } return V_EQ; } template inline Result abs_float(Type& to, const Type from, Rounding_Dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } to = std::abs(from); return V_EQ; } @@ -701,14 +741,16 @@ template inline Result sqrt_float(Type& to, const Type from, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (To_Policy::check_sqrt_neg && from < 0) { return assign_nan(to, V_SQRT_NEG); } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = std::sqrt(from); + } else { fpu_rounding_control_word_type old = fpu_save_rounding_direction(round_fpu_dir(dir)); @@ -723,24 +765,30 @@ template inline Result_Relation sgn_float(const Type x) { - if (x > 0) + if (x > 0) { return VR_GT; - if (x < 0) + } + if (x < 0) { return VR_LT; - if (x == 0) + } + if (x == 0) { return VR_EQ; + } return VR_EMPTY; } template inline Result_Relation cmp_float(const Type x, const Type y) { - if (x > y) + if (x > y) { return VR_GT; - if (x < y) + } + if (x < y) { return VR_LT; - if (x == y) + } + if (x == y) { return VR_EQ; + } return VR_EMPTY; } @@ -748,8 +796,9 @@ inline Result assign_float_int_inexact(To& to, const From from, Rounding_Dir dir) { prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = from; + } else { fpu_rounding_control_word_type old = fpu_save_rounding_direction(round_fpu_dir(dir)); @@ -763,10 +812,12 @@ template inline Result assign_float_int(To& to, const From from, Rounding_Dir dir) { - if (sizeof_to_bits(sizeof(From)) > Float::Binary::MANTISSA_BITS) + if (sizeof_to_bits(sizeof(From)) > Float::Binary::MANTISSA_BITS) { return assign_float_int_inexact(to, from, dir); - else + } + else { return assign_exact(to, from, dir); + } } template @@ -822,30 +873,36 @@ mpz_srcptr from_z = from.get_mpz_t(); size_t exponent = mpz_sizeinbase(from_z, 2) - 1; if (exponent > size_t(Float::Binary::EXPONENT_MAX)) { - if (sign < 0) + if (sign < 0) { return set_neg_overflow_float(to, dir); - else + } + else { return set_pos_overflow_float(to, dir); + } } unsigned long zeroes = mpn_scan1(from_z->_mp_d, 0); size_t meaningful_bits = exponent - zeroes; mpz_t mantissa; mpz_init(mantissa); - if (exponent > Float::Binary::MANTISSA_BITS) + if (exponent > Float::Binary::MANTISSA_BITS) { mpz_tdiv_q_2exp(mantissa, from_z, exponent - Float::Binary::MANTISSA_BITS); - else + } + else { mpz_mul_2exp(mantissa, from_z, Float::Binary::MANTISSA_BITS - exponent); + } Float f; f.u.binary.build(sign < 0, mantissa, static_cast(exponent)); mpz_clear(mantissa); to = f.value(); if (meaningful_bits > Float::Binary::MANTISSA_BITS) { - if (sign < 0) + if (sign < 0) { return round_lt_float(to, dir); - else + } + else { return round_gt_float(to, dir); + } } return V_EQ; } @@ -855,8 +912,9 @@ assign_float_mpq(T& to, const mpq_class& from, Rounding_Dir dir) { const mpz_class& numer = from.get_num(); const mpz_class& denom = from.get_den(); - if (denom == 1) + if (denom == 1) { return assign_float_mpz(to, numer, dir); + } mpz_srcptr numer_z = numer.get_mpz_t(); mpz_srcptr denom_z = denom.get_mpz_t(); int sign = sgn(numer); @@ -865,17 +923,21 @@ if (exponent < Float::Binary::EXPONENT_MIN_DENORM) { to = 0; inexact: - if (sign < 0) + if (sign < 0) { return round_lt_float(to, dir); - else + } + else { return round_gt_float(to, dir); + } } if (exponent > Float::Binary::EXPONENT_MAX + 1) { overflow: - if (sign < 0) + if (sign < 0) { return set_neg_overflow_float(to, dir); - else + } + else { return set_pos_overflow_float(to, dir); + } } unsigned int needed_bits = Float::Binary::MANTISSA_BITS + 1; if (exponent < Float::Binary::EXPONENT_MIN) { @@ -906,8 +968,9 @@ inexact = (inexact || mpz_odd_p(mantissa)); mpz_tdiv_q_2exp(mantissa, mantissa, 1); } - else + else { --exponent; + } if (exponent > Float::Binary::EXPONENT_MAX) { mpz_clear(mantissa); goto overflow; @@ -920,8 +983,9 @@ f.u.binary.build(sign < 0, mantissa, exponent); mpz_clear(mantissa); to = f.value(); - if (inexact) + if (inexact) { goto inexact; + } return V_EQ; } @@ -937,8 +1001,9 @@ } // FIXME: missing check_inf_add_inf prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = multiply_add(x, y, to); + } else if (fpu_inverse_rounding(dir)) { to = multiply_add(-x, y, -to); limit_precision(to); @@ -954,8 +1019,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -970,8 +1036,9 @@ } // FIXME: missing check_inf_add_inf prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = multiply_add(x, -y, to); + } else if (fpu_inverse_rounding(dir)) { to = multiply_add(x, y, -to); limit_precision(to); @@ -987,8 +1054,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -1002,8 +1070,9 @@ inline void assign_mpq_numeric_float(mpq_class& to, const long double from) { to = 0; - if (from == 0.0L) + if (from == 0.0L) { return; + } mpz_class& num = to.get_num(); mpz_class& den = to.get_den(); int exp; @@ -1021,16 +1090,20 @@ const long double intpart = std::floor(n); num += static_cast(intpart); n -= intpart; - if (n == 0.0L) + if (n == 0.0L) { break; + } num <<= bits; } - if (exp < 0) + if (exp < 0) { den <<= -exp; - else + } + else { num <<= exp; - if (neg) + } + if (neg) { to = -to; + } to.canonicalize(); } @@ -1038,14 +1111,18 @@ inline Result output_float(std::ostream& os, const Type from, const Numeric_Format&, Rounding_Dir) { - if (from == 0) + if (from == 0) { os << "0"; - else if (is_minf(from)) + } + else if (is_minf(from)) { os << "-inf"; - else if (is_pinf(from)) + } + else if (is_pinf(from)) { os << "+inf"; - else if (is_nan(from)) + } + else if (is_nan(from)) { os << "nan"; + } else { mpq_class q; assign_mpq_numeric_float(q, from); diff -Nru ppl-1.1/src/checked_inlines.hh ppl-1.2/src/checked_inlines.hh --- ppl-1.1/src/checked_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/checked_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Abstract checked arithmetic functions: fall-backs. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,7 @@ #include "globals_types.hh" #include "meta_programming.hh" #include "C_Integer.hh" -#include "assert.hh" +#include "assertions.hh" /*! \brief Performs the test a < b avoiding the warning about the @@ -249,7 +249,7 @@ template struct PPL_FUNCTION_CLASS(construct) { static inline Result function(Type& to, const Type& from, Rounding_Dir) { - new (&to) Type(from); + new(&to) Type(from); return V_EQ; } }; @@ -257,7 +257,7 @@ template struct PPL_FUNCTION_CLASS(construct) { static inline Result function(To& to, const From& from, Rounding_Dir dir) { - new (&to) To(); + new(&to) To(); return assign(to, from, dir); } }; @@ -265,7 +265,7 @@ template struct PPL_FUNCTION_CLASS(construct_special) { static inline Result function(To& to, Result_Class r, Rounding_Dir dir) { - new (&to) To(); + new(&to) To(); return assign_special(to, r, dir); } }; @@ -286,10 +286,12 @@ template inline Result abs_generic(To& to, const From& from, Rounding_Dir dir) { - if (from < 0) + if (from < 0) { return neg(to, from, dir); - else + } + else { return assign(to, from, dir); + } } template (to, x, dir); } @@ -353,13 +357,15 @@ Result r; r = abs(to, x, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } From2 a_y; r = abs(a_y, y, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } // If PPL_MATCH_GMP_GCDEXT is defined then s is favored when the absolute // values of the given numbers are equal. For instance if x and y @@ -367,8 +373,9 @@ // way round. This is to match the behavior of GMP. #define PPL_MATCH_GMP_GCDEXT 1 #ifdef PPL_MATCH_GMP_GCDEXT - if (to == a_y) + if (to == a_y) { goto sign_check; + } #endif { @@ -384,8 +391,9 @@ s = v1; t = v2; to = v3; - if (t3 == 0) + if (t3 == 0) { break; + } v1 = t1; v2 = t2; v3 = t3; @@ -397,11 +405,13 @@ #endif if (negative_x) { r = neg(s, s, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } } - if (negative_y) + if (negative_y) { return neg(t, t, dir); + } return V_EQ; #undef PPL_MATCH_GMP_GCDEXT } @@ -418,11 +428,13 @@ To a_y; Result r; r = abs(a_x, x, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } r = abs(a_y, y, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } To gcd; gcd_exact_no_abs(gcd, a_x, a_y); // The following is derived from the assumption that a_x / gcd(a_x, a_y) @@ -435,10 +447,12 @@ template inline Result_Relation sgn_generic(const Type& x) { - if (x > 0) + if (x > 0) { return VR_GT; - if (x == 0) + } + if (x == 0) { return VR_EQ; + } return VR_LT; } @@ -550,8 +564,9 @@ lt(const T1& x, const T2& y) { PPL_DIRTY_TEMP(T1, tmp); Result r = assign_r(tmp, y, ROUND_UP); - if (!result_representable(r)) + if (!result_representable(r)) { return true; + } switch (result_relation(r)) { case VR_EQ: case VR_LT: @@ -575,8 +590,9 @@ // code this in checked_float_inlines.hh, probably it's faster also // if fpu supports inexact check. PPL_ASSERT(r != V_LE && r != V_GE && r != V_LGE); - if (!result_representable(r)) + if (!result_representable(r)) { return true; + } switch (result_relation(r)) { case VR_EQ: return x <= tmp; @@ -618,10 +634,12 @@ typename Type1, typename Type2> inline Result_Relation cmp_generic(const Type1& x, const Type2& y) { - if (lt(y, x)) + if (lt(y, x)) { return VR_GT; - if (lt(x, y)) + } + if (lt(x, y)) { return VR_LT; + } return VR_EQ; } diff -Nru ppl-1.1/src/checked_int_inlines.hh ppl-1.2/src/checked_int_inlines.hh --- ppl-1.1/src/checked_int_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/checked_int_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Specialized "checked" functions for native integer numbers. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -197,21 +197,27 @@ classify_int(const Type v, bool nan, bool inf, bool sign) { if (Policy::has_nan && (nan || sign) - && v == Extended_Int::not_a_number) + && v == Extended_Int::not_a_number) { return V_NAN; - if (!inf && !sign) + } + if (!inf && !sign) { return V_LGE; + } if (Policy::has_infinity) { - if (v == Extended_Int::minus_infinity) + if (v == Extended_Int::minus_infinity) { return inf ? V_EQ_MINUS_INFINITY : V_LT; - if (v == Extended_Int::plus_infinity) + } + if (v == Extended_Int::plus_infinity) { return inf ? V_EQ_PLUS_INFINITY : V_GT; + } } if (sign) { - if (v < 0) + if (v < 0) { return V_LT; - if (v > 0) + } + if (v > 0) { return V_GT; + } return V_EQ; } return V_LGE; @@ -357,16 +363,18 @@ assign_signed_int_signed_int(To& to, const From from, Rounding_Dir dir) { if (sizeof(To) < sizeof(From) || (sizeof(To) == sizeof(From) - && (Extended_Int::min > Extended_Int::min - || Extended_Int::max < Extended_Int::max))) { + && (Extended_Int::min > Extended_Int::min + || Extended_Int::max < Extended_Int::max))) { if (CHECK_P(To_Policy::check_overflow, PPL_LT_SILENT(from, - static_cast(Extended_Int::min)))) + static_cast(Extended_Int::min)))) { return set_neg_overflow_int(to, dir); + } if (CHECK_P(To_Policy::check_overflow, PPL_GT_SILENT(from, - static_cast(Extended_Int::max)))) + static_cast(Extended_Int::max)))) { return set_pos_overflow_int(to, dir); + } } to = static_cast(from); return V_EQ; @@ -377,8 +385,9 @@ assign_signed_int_unsigned_int(To& to, const From from, Rounding_Dir dir) { if (sizeof(To) <= sizeof(From)) { if (CHECK_P(To_Policy::check_overflow, - from > static_cast(Extended_Int::max))) + from > static_cast(Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } } to = static_cast(from); return V_EQ; @@ -387,12 +396,14 @@ template inline Result assign_unsigned_int_signed_int(To& to, const From from, Rounding_Dir dir) { - if (CHECK_P(To_Policy::check_overflow, from < 0)) + if (CHECK_P(To_Policy::check_overflow, from < 0)) { return set_neg_overflow_int(to, dir); + } if (sizeof(To) < sizeof(From)) { if (CHECK_P(To_Policy::check_overflow, - from > static_cast(Extended_Int::max))) + from > static_cast(Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } } to = static_cast(from); return V_EQ; @@ -403,11 +414,12 @@ assign_unsigned_int_unsigned_int(To& to, const From from, Rounding_Dir dir) { if (sizeof(To) < sizeof(From) || (sizeof(To) == sizeof(From) - && Extended_Int::max < Extended_Int::max)) { + && Extended_Int::max < Extended_Int::max)) { if (CHECK_P(To_Policy::check_overflow, PPL_GT_SILENT(from, - static_cast(Extended_Int::max)))) + static_cast(Extended_Int::max)))) { return set_pos_overflow_int(to, dir); + } } to = static_cast(from); return V_EQ; @@ -528,25 +540,36 @@ template inline Result assign_int_float(To& to, const From from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } #if 0 // FIXME: this is correct but it is inefficient and breaks the build // for the missing definition of static const members (a problem present // also in other areas of the PPL). - if (CHECK_P(To_Policy::check_overflow, lt(from, Extended_Int::min))) + if (CHECK_P(To_Policy::check_overflow, + lt(from, Extended_Int::min))) { return set_neg_overflow_int(to, dir); - if (CHECK_P(To_Policy::check_overflow, !le(from, Extended_Int::max))) + } + if (CHECK_P(To_Policy::check_overflow, + !le(from, Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } #else - if (CHECK_P(To_Policy::check_overflow, (from < Extended_Int::min))) + if (CHECK_P(To_Policy::check_overflow, + (from < Extended_Int::min))) { return set_neg_overflow_int(to, dir); - if (CHECK_P(To_Policy::check_overflow, (from > Extended_Int::max))) + } + if (CHECK_P(To_Policy::check_overflow, + (from > Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } #endif if (round_not_requested(dir)) { to = from; @@ -554,14 +577,18 @@ } From i_from = rint(from); to = i_from; - if (from == i_from) + if (from == i_from) { return V_EQ; - if (round_direct(ROUND_UP)) + } + if (round_direct(ROUND_UP)) { return round_lt_int(to, dir); - if (round_direct(ROUND_DOWN)) + } + if (round_direct(ROUND_DOWN)) { return round_gt_int(to, dir); - if (from < i_from) + } + if (from < i_from) { return round_lt_int(to, dir); + } PPL_ASSERT(from > i_from); return round_gt_int(to, dir); } @@ -619,10 +646,12 @@ } if (from.fits_slong_p()) { signed long v = from.get_si(); - if (PPL_LT_SILENT(v, (Extended_Int::min))) + if (PPL_LT_SILENT(v, (Extended_Int::min))) { return set_neg_overflow_int(to, dir); - if (PPL_GT_SILENT(v, (Extended_Int::max))) + } + if (PPL_GT_SILENT(v, (Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } to = v; return V_EQ; } @@ -638,8 +667,9 @@ To v; mpz_export(&v, 0, -1, sizeof(To), 0, 0, m); if (v >= 0) { - if (::sgn(from) < 0) + if (::sgn(from) < 0) { return neg(to, v, dir); + } to = v; return V_EQ; } @@ -662,8 +692,9 @@ template inline Result assign_unsigned_int_mpz(To& to, const mpz_class& from, Rounding_Dir dir) { - if (CHECK_P(To_Policy::check_overflow, ::sgn(from) < 0)) + if (CHECK_P(To_Policy::check_overflow, ::sgn(from) < 0)) { return set_neg_overflow_int(to, dir); + } if (sizeof(To) <= sizeof(unsigned long)) { if (!To_Policy::check_overflow) { to = static_cast(from.get_ui()); @@ -671,8 +702,9 @@ } if (from.fits_ulong_p()) { const unsigned long v = from.get_ui(); - if (PPL_GT_SILENT(v, (Extended_Int::max))) + if (PPL_GT_SILENT(v, (Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } to = static_cast(v); return V_EQ; } @@ -681,10 +713,12 @@ const mpz_srcptr m = from.get_mpz_t(); const size_t sz = mpz_size(m); if (sz <= sizeof(To) / sizeof(mp_limb_t)) { - if (sz == 0) + if (sz == 0) { to = 0; - else + } + else { mpz_export(&to, 0, -1, sizeof(To), 0, 0, m); + } return V_EQ; } } @@ -710,8 +744,9 @@ if (round_not_requested(dir)) { mpz_tdiv_q(q_z, n, d); Result r = assign(to, q, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } return V_LGE; } mpz_t rem; @@ -721,8 +756,9 @@ sign = mpz_sgn(rem); mpz_clear(rem); Result r = assign(to, q, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } switch (sign) { case -1: return round_lt_int(to, dir); @@ -961,11 +997,13 @@ template inline Result neg_signed_int(Type& to, const Type from, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_neg) + if (To_Policy::check_overflow && Larger::use_for_neg) { return neg_int_larger(to, from, dir); + } if (CHECK_P(To_Policy::check_overflow, - (from < -Extended_Int::max))) + (from < -Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } to = -from; return V_EQ; } @@ -973,10 +1011,12 @@ template inline Result neg_unsigned_int(Type& to, const Type from, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_neg) + if (To_Policy::check_overflow && Larger::use_for_neg) { return neg_int_larger(to, from, dir); - if (CHECK_P(To_Policy::check_overflow, from != 0)) + } + if (CHECK_P(To_Policy::check_overflow, from != 0)) { return set_neg_overflow_int(to, dir); + } to = from; return V_EQ; } @@ -985,15 +1025,18 @@ typename Type> inline Result add_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_add) + if (To_Policy::check_overflow && Larger::use_for_add) { return add_int_larger(to, x, y, dir); + } if (To_Policy::check_overflow) { if (y >= 0) { - if (x > Extended_Int::max - y) + if (x > Extended_Int::max - y) { return set_pos_overflow_int(to, dir); + } } - else if (x < Extended_Int::min - y) + else if (x < Extended_Int::min - y) { return set_neg_overflow_int(to, dir); + } } to = x + y; return V_EQ; @@ -1003,11 +1046,13 @@ typename Type> inline Result add_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_add) + if (To_Policy::check_overflow && Larger::use_for_add) { return add_int_larger(to, x, y, dir); + } if (CHECK_P(To_Policy::check_overflow, - (x > Extended_Int::max - y))) + (x > Extended_Int::max - y))) { return set_pos_overflow_int(to, dir); + } to = x + y; return V_EQ; } @@ -1016,15 +1061,18 @@ typename Type> inline Result sub_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_sub) + if (To_Policy::check_overflow && Larger::use_for_sub) { return sub_int_larger(to, x, y, dir); + } if (To_Policy::check_overflow) { if (y >= 0) { - if (x < Extended_Int::min + y) + if (x < Extended_Int::min + y) { return set_neg_overflow_int(to, dir); + } } - else if (x > Extended_Int::max + y) + else if (x > Extended_Int::max + y) { return set_pos_overflow_int(to, dir); + } } to = x - y; return V_EQ; @@ -1034,11 +1082,13 @@ typename Type> inline Result sub_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_sub) + if (To_Policy::check_overflow && Larger::use_for_sub) { return sub_int_larger(to, x, y, dir); + } if (CHECK_P(To_Policy::check_overflow, - (x < Extended_Int::min + y))) + (x < Extended_Int::min + y))) { return set_neg_overflow_int(to, dir); + } to = x - y; return V_EQ; } @@ -1047,8 +1097,9 @@ typename Type> inline Result mul_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_mul) + if (To_Policy::check_overflow && Larger::use_for_mul) { return mul_int_larger(to, x, y, dir); + } if (!To_Policy::check_overflow) { to = x * y; return V_EQ; @@ -1057,26 +1108,31 @@ to = 0; return V_EQ; } - if (y == -1) + if (y == -1) { return neg_signed_int(to, x, dir); + } if (x >= 0) { if (y > 0) { - if (x > Extended_Int::max / y) + if (x > Extended_Int::max / y) { return set_pos_overflow_int(to, dir); + } } else { - if (x > Extended_Int::min / y) + if (x > Extended_Int::min / y) { return set_neg_overflow_int(to, dir); + } } } else { if (y < 0) { - if (x < Extended_Int::max / y) + if (x < Extended_Int::max / y) { return set_pos_overflow_int(to, dir); + } } else { - if (x < Extended_Int::min / y) + if (x < Extended_Int::min / y) { return set_neg_overflow_int(to, dir); + } } } to = x * y; @@ -1087,8 +1143,9 @@ typename Type> inline Result mul_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_mul) + if (To_Policy::check_overflow && Larger::use_for_mul) { return mul_int_larger(to, x, y, dir); + } if (!To_Policy::check_overflow) { to = x * y; return V_EQ; @@ -1097,8 +1154,9 @@ to = 0; return V_EQ; } - if (x > Extended_Int::max / y) + if (x > Extended_Int::max / y) { return set_pos_overflow_int(to, dir); + } to = x * y; return V_EQ; } @@ -1110,20 +1168,26 @@ if (CHECK_P(To_Policy::check_div_zero, y == 0)) { return assign_nan(to, V_DIV_ZERO); } - if (To_Policy::check_overflow && y == -1) + if (To_Policy::check_overflow && y == -1) { return neg_signed_int(to, x, dir); + } to = x / y; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_LGE; - if (y == -1) + } + if (y == -1) { return V_EQ; + } Type m = x % y; - if (m < 0) + if (m < 0) { return round_lt_int_no_overflow(to, dir); - else if (m > 0) + } + else if (m > 0) { return round_gt_int_no_overflow(to, dir); - else + } + else { return V_EQ; + } } template (to, V_DIV_ZERO); } to = x / y; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; + } Type m = x % y; - if (m == 0) + if (m == 0) { return V_EQ; + } return round_gt_int(to, dir); } @@ -1149,8 +1215,9 @@ if (CHECK_P(To_Policy::check_div_zero, y == 0)) { return assign_nan(to, V_DIV_ZERO); } - if (To_Policy::check_overflow && y == -1) + if (To_Policy::check_overflow && y == -1) { return neg_signed_int(to, x, dir); + } to = x / y; return V_EQ; } @@ -1194,19 +1261,24 @@ Rounding_Dir dir) { if (exp >= sizeof_to_bits(sizeof(Type))) { to = 0; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; - if (x == 0) + } + if (x == 0) { return V_EQ; + } return round_gt_int_no_overflow(to, dir); } to = x >> exp; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; - if (x & ((Type(1) << exp) - 1)) + } + if (x & ((Type(1) << exp) - 1)) { return round_gt_int_no_overflow(to, dir); - else + } + else { return V_EQ; + } } template @@ -1216,36 +1288,44 @@ if (x < 0) { if (exp >= sizeof_to_bits(sizeof(Type))) { to = 0; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_LE; + } return round_lt_int_no_overflow(to, dir); } typedef typename C_Integer::other_type UType; UType ux = x; ux = -ux; to = ~Type(~-(ux >> exp)); - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_LE; - if (ux & ((UType(1) << exp) -1)) + } + if (ux & ((UType(1) << exp) -1)) { return round_lt_int_no_overflow(to, dir); + } return V_EQ; } else { if (exp >= sizeof_to_bits(sizeof(Type)) - 1) { to = 0; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; - if (x == 0) + } + if (x == 0) { return V_EQ; + } return round_gt_int_no_overflow(to, dir); } to = x >> exp; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; - if (x & ((Type(1) << exp) - 1)) + } + if (x & ((Type(1) << exp) - 1)) { return round_gt_int_no_overflow(to, dir); - else + } + else { return V_EQ; + } } } @@ -1257,8 +1337,9 @@ to = x + (Type(1) << exp); return V_EQ; } - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { return set_pos_overflow_int(to, dir); + } Type n = Type(1) << exp; return add_unsigned_int(to, x, n, dir); } @@ -1271,8 +1352,9 @@ to = x + (Type(1) << exp); return V_EQ; } - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { return set_pos_overflow_int(to, dir); + } if (exp == sizeof_to_bits(sizeof(Type)) - 1) { Type n = -2 * (Type(1) << (exp - 1)); return sub_signed_int(to, x, n, dir); @@ -1291,8 +1373,9 @@ to = x - (Type(1) << exp); return V_EQ; } - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { return set_neg_overflow_int(to, dir); + } Type n = Type(1) << exp; return sub_unsigned_int(to, x, n, dir); } @@ -1305,8 +1388,9 @@ to = x - (Type(1) << exp); return V_EQ; } - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { return set_neg_overflow_int(to, dir); + } if (exp == sizeof_to_bits(sizeof(Type)) - 1) { Type n = -2 * (Type(1) << (exp - 1)); return add_signed_int(to, x, n, dir); @@ -1332,8 +1416,9 @@ } return set_pos_overflow_int(to, dir); } - if (x > Extended_Int::max >> exp) + if (x > Extended_Int::max >> exp) { return set_pos_overflow_int(to, dir); + } to = x << exp; return V_EQ; } @@ -1347,17 +1432,20 @@ to = x * (Type(1) << exp); return V_EQ; } - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { return set_neg_overflow_int(to, dir); + } typedef typename C_Integer::other_type UType; UType mask = UType(-1) << (sizeof_to_bits(sizeof(Type)) - exp - 1); UType ux = x; - if ((ux & mask) != mask) + if ((ux & mask) != mask) { return set_neg_overflow_int(to, dir); + } ux <<= exp; Type n = ~(Type(~ux)); - if (PPL_LT_SILENT(n, (Extended_Int::min))) + if (PPL_LT_SILENT(n, (Extended_Int::min))) { return set_neg_overflow_int(to, dir); + } to = n; } else { @@ -1372,8 +1460,9 @@ } return set_pos_overflow_int(to, dir); } - if (x > Extended_Int::max >> exp) + if (x > Extended_Int::max >> exp) { return set_pos_overflow_int(to, dir); + } to = x << exp; } return V_EQ; @@ -1383,14 +1472,17 @@ inline Result smod_2exp_unsigned_int(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (exp > sizeof_to_bits(sizeof(Type))) + if (exp > sizeof_to_bits(sizeof(Type))) { to = x; + } else { Type v = (exp == sizeof_to_bits(sizeof(Type)) ? x : (x & ((Type(1) << exp) - 1))); - if (v >= (Type(1) << (exp - 1))) + if (v >= (Type(1) << (exp - 1))) { return set_neg_overflow_int(to, dir); - else + } + else { to = v; + } } return V_EQ; } @@ -1399,8 +1491,9 @@ inline Result smod_2exp_signed_int(Type& to, const Type x, unsigned int exp, Rounding_Dir) { - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { to = x; + } else { Type m = Type(1) << (exp - 1); to = (x & (m - 1)) - (x & m); @@ -1412,10 +1505,12 @@ inline Result umod_2exp_unsigned_int(Type& to, const Type x, unsigned int exp, Rounding_Dir) { - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { to = x; - else + } + else { to = x & ((Type(1) << exp) - 1); + } return V_EQ; } @@ -1424,12 +1519,14 @@ umod_2exp_signed_int(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { if (exp >= sizeof_to_bits(sizeof(Type))) { - if (x < 0) + if (x < 0) { return set_pos_overflow_int(to, dir); + } to = x; } - else + else { to = x & ((Type(1) << exp) - 1); + } return V_EQ; } @@ -1454,10 +1551,12 @@ sqrt_unsigned_int(Type& to, const Type from, Rounding_Dir dir) { Type rem; isqrt_rem(to, rem, from); - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; - if (rem == 0) + } + if (rem == 0) { return V_EQ; + } return round_gt_int(to, dir); } @@ -1480,12 +1579,14 @@ case 0: return add(to, to, z, dir); case -1: - if (to <= 0) + if (to <= 0) { return set_neg_overflow_int(to, dir); + } return assign_nan(to, V_UNKNOWN_NEG_OVERFLOW); case 1: - if (to >= 0) + if (to >= 0) { return set_pos_overflow_int(to, dir); + } return assign_nan(to, V_UNKNOWN_POS_OVERFLOW); default: PPL_UNREACHABLE; @@ -1503,12 +1604,14 @@ case 0: return sub(to, to, z, dir); case -1: - if (to >= 0) + if (to >= 0) { return set_pos_overflow_int(to, dir); + } return assign_nan(to, V_UNKNOWN_NEG_OVERFLOW); case 1: - if (to <= 0) + if (to <= 0) { return set_neg_overflow_int(to, dir); + } return assign_nan(to, V_UNKNOWN_POS_OVERFLOW); default: PPL_UNREACHABLE; @@ -1849,17 +1952,39 @@ PPL_SPECIALIZE_GCD(gcd_exact, unsigned long, unsigned long, unsigned long) PPL_SPECIALIZE_GCD(gcd_exact, unsigned long long, unsigned long long, unsigned long long) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, char, char, char, char, char) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, signed char, signed char, signed char, signed char, signed char) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, signed short, signed short, signed short, signed short, signed short) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, signed int, signed int, signed int, signed int, signed int) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, signed long, signed long, signed long, signed long, signed long) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, signed long long, signed long long, signed long long, signed long long, signed long long) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + char, char, char, char, char) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + signed char, signed char, signed char, + signed char, signed char) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + signed short, signed short, signed short, + signed short, signed short) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + signed int, signed int, signed int, + signed int, signed int) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + signed long, signed long, signed long, + signed long, signed long) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + signed long long, signed long long, signed long long, + signed long long, signed long long) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + unsigned char, unsigned char, unsigned char, + unsigned char, unsigned char) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + unsigned short, unsigned short, unsigned short, + unsigned short, unsigned short) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + unsigned long, unsigned long, unsigned long, + unsigned long, unsigned long) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long) PPL_SPECIALIZE_LCM(lcm_gcd_exact, char, char, char) PPL_SPECIALIZE_LCM(lcm_gcd_exact, signed char, signed char, signed char) diff -Nru ppl-1.1/src/checked_mpq_inlines.hh ppl-1.2/src/checked_mpq_inlines.hh --- ppl-1.1/src/checked_mpq_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/checked_mpq_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Specialized "checked" functions for GMP's mpq_class numbers. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -38,19 +38,24 @@ if ((Policy::has_nan || Policy::has_infinity) && ::sgn(v.get_den()) == 0) { int s = ::sgn(v.get_num()); - if (Policy::has_nan && (nan || sign) && s == 0) + if (Policy::has_nan && (nan || sign) && s == 0) { return V_NAN; - if (!inf && !sign) + } + if (!inf && !sign) { return V_LGE; + } if (Policy::has_infinity) { - if (s < 0) + if (s < 0) { return inf ? V_EQ_MINUS_INFINITY : V_LT; - if (s > 0) + } + if (s > 0) { return inf ? V_EQ_PLUS_INFINITY : V_GT; + } } } - if (sign) + if (sign) { return static_cast(sgn(v)); + } return V_LGE; } @@ -90,10 +95,12 @@ inline bool is_int_mpq(const mpq_class& v) { if ((Policy::has_infinity || Policy::has_nan) - && ::sgn(v.get_den()) == 0) + && ::sgn(v.get_den()) == 0) { return !(Policy::has_nan && ::sgn(v.get_num()) == 0); - else + } + else { return v.get_den() == 1; + } } PPL_SPECIALIZE_IS_INT(is_int_mpq, mpq_class) @@ -136,7 +143,7 @@ template inline Result construct_mpq_base(mpq_class& to, const From& from, Rounding_Dir) { - new (&to) mpq_class(from); + new(&to) mpq_class(from); return V_EQ; } @@ -154,13 +161,16 @@ template inline Result construct_mpq_float(mpq_class& to, const From& from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return construct_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return construct_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return construct_special(to, VC_PLUS_INFINITY, dir); - new (&to) mpq_class(from); + } + new(&to) mpq_class(from); return V_EQ; } @@ -182,12 +192,15 @@ template inline Result assign_mpq_float(mpq_class& to, const From& from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } assign_mpq_numeric_float(to, from); return V_EQ; } @@ -199,12 +212,14 @@ template inline Result assign_mpq_signed_int(mpq_class& to, const From from, Rounding_Dir) { - if (sizeof(From) <= sizeof(signed long)) + if (sizeof(From) <= sizeof(signed long)) { to = static_cast(from); + } else { mpz_ptr m = to.get_num().get_mpz_t(); - if (from >= 0) + if (from >= 0) { mpz_import(m, 1, 1, sizeof(From), 0, 0, &from); + } else { From n = -from; mpz_import(m, 1, 1, sizeof(From), 0, 0, &n); @@ -220,8 +235,9 @@ template inline Result assign_mpq_unsigned_int(mpq_class& to, const From from, Rounding_Dir) { - if (sizeof(From) <= sizeof(unsigned long)) + if (sizeof(From) <= sizeof(unsigned long)) { to = static_cast(from); + } else { mpz_import(to.get_num().get_mpz_t(), 1, 1, sizeof(From), 0, 0, &from); to.get_den() = 1; @@ -398,8 +414,9 @@ mpz_fdiv_q_2exp(to.get_den().get_mpz_t(), to.get_den().get_mpz_t(), 1); bool neg = to.get_num() >= to.get_den(); mpz_mul_2exp(to.get_den().get_mpz_t(), to.get_den().get_mpz_t(), 1); - if (neg) + if (neg) { to.get_num() -= to.get_den(); + } mpz_mul_2exp(to.get_num().get_mpz_t(), to.get_num().get_mpz_t(), exp); to.canonicalize(); return V_EQ; @@ -530,11 +547,13 @@ */ inline void set_irrational_precision(const unsigned p) { - if (p <= INT_MAX) + if (p <= INT_MAX) { Checked::irrational_precision = p; - else + } + else { throw std::invalid_argument("PPL::set_irrational_precision(p)" " with p > INT_MAX"); + } } } // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/src/checked_mpz_inlines.hh ppl-1.2/src/checked_mpz_inlines.hh --- ppl-1.1/src/checked_mpz_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/checked_mpz_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Specialized "checked" functions for GMP's mpz_class numbers. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -50,7 +50,10 @@ return V_GT; } -#ifdef PPL_HAVE_TYPEOF +#if __cplusplus >= 201103L +//! Type of the _mp_size field of GMP's __mpz_struct. +typedef decltype(__mpz_struct()._mp_size) mp_size_field_t; +#elif PPL_HAVE_TYPEOF //! Type of the _mp_size field of GMP's __mpz_struct. typedef typeof(__mpz_struct()._mp_size) mp_size_field_t; #else @@ -75,19 +78,24 @@ mp_size_field_t s = get_mp_size(v); if (Policy::has_nan && (nan || sign) - && s == C_Integer::min + 1) + && s == C_Integer::min + 1) { return V_NAN; - if (!inf && !sign) + } + if (!inf && !sign) { return V_LGE; + } if (Policy::has_infinity) { - if (s == C_Integer::min) + if (s == C_Integer::min) { return inf ? V_EQ_MINUS_INFINITY : V_LT; - if (s == C_Integer::max) + } + if (s == C_Integer::max) { return inf ? V_EQ_PLUS_INFINITY : V_GT; + } } } - if (sign) + if (sign) { return static_cast(sgn(v)); + } return V_LGE; } @@ -133,8 +141,9 @@ assign_special_mpz(mpz_class& v, Result_Class c, Rounding_Dir) { switch (c) { case VC_NAN: - if (Policy::has_nan) + if (Policy::has_nan) { set_mp_size(v, C_Integer::min + 1); + } return V_NAN; case VC_MINUS_INFINITY: if (Policy::has_infinity) { @@ -159,10 +168,12 @@ template inline void copy_mpz(mpz_class& to, const mpz_class& from) { - if (is_nan_mpz(from)) + if (is_nan_mpz(from)) { PPL_ASSERT(To_Policy::has_nan); - else if (is_minf_mpz(from) || is_pinf_mpz(from)) + } + else if (is_minf_mpz(from) || is_pinf_mpz(from)) { PPL_ASSERT(To_Policy::has_infinity); + } else { to = from; return; @@ -175,7 +186,7 @@ template inline Result construct_mpz_base(mpz_class& to, const From from, Rounding_Dir) { - new (&to) mpz_class(from); + new(&to) mpz_class(from); return V_EQ; } @@ -192,24 +203,30 @@ template inline Result construct_mpz_float(mpz_class& to, const From& from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return construct_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return construct_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return construct_special(to, VC_PLUS_INFINITY, dir); + } if (round_not_requested(dir)) { - new (&to) mpz_class(from); + new(&to) mpz_class(from); return V_LGE; } From n = rint(from); - new (&to) mpz_class(n); - if (from == n) + new(&to) mpz_class(n); + if (from == n) { return V_EQ; - if (from < 0) + } + if (from < 0) { return round_lt_mpz(to, dir); - else + } + else { return round_gt_mpz(to, dir); + } } PPL_SPECIALIZE_CONSTRUCT(construct_mpz_float, mpz_class, float) @@ -229,12 +246,14 @@ template inline Result assign_mpz_signed_int(mpz_class& to, const From from, Rounding_Dir) { - if (sizeof(From) <= sizeof(signed long)) + if (sizeof(From) <= sizeof(signed long)) { to = static_cast(from); + } else { mpz_ptr m = to.get_mpz_t(); - if (from >= 0) + if (from >= 0) { mpz_import(m, 1, 1, sizeof(From), 0, 0, &from); + } else { From n = -from; mpz_import(m, 1, 1, sizeof(From), 0, 0, &n); @@ -249,10 +268,12 @@ template inline Result assign_mpz_unsigned_int(mpz_class& to, const From from, Rounding_Dir) { - if (sizeof(From) <= sizeof(unsigned long)) + if (sizeof(From) <= sizeof(unsigned long)) { to = static_cast(from); - else + } + else { mpz_import(to.get_mpz_t(), 1, 1, sizeof(From), 0, 0, &from); + } return V_EQ; } @@ -261,28 +282,36 @@ template inline Result assign_mpz_float(mpz_class& to, const From from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } if (round_not_requested(dir)) { to = from; return V_LGE; } From i_from = rint(from); to = i_from; - if (from == i_from) + if (from == i_from) { return V_EQ; - if (round_direct(ROUND_UP)) + } + if (round_direct(ROUND_UP)) { return round_lt_mpz(to, dir); - if (round_direct(ROUND_DOWN)) + } + if (round_direct(ROUND_DOWN)) { return round_gt_mpz(to, dir); - if (from < i_from) + } + if (from < i_from) { return round_lt_mpz(to, dir); - if (from > i_from) + } + if (from > i_from) { return round_gt_mpz(to, dir); + } PPL_UNREACHABLE; return V_NAN; } @@ -293,12 +322,15 @@ template inline Result assign_mpz_long_double(mpz_class& to, const From& from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } // FIXME: this is an incredibly inefficient implementation! std::stringstream ss; output(ss, from, Numeric_Format(), dir); @@ -328,15 +360,17 @@ const mpz_srcptr d = from.get_den().get_mpz_t(); if (round_down(dir)) { mpz_fdiv_q(to.get_mpz_t(), n, d); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_p(n, d) != 0) ? V_EQ : V_GT; + } return V_GE; } else { PPL_ASSERT(round_up(dir)); mpz_cdiv_q(to.get_mpz_t(), n, d); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_p(n, d) != 0) ? V_EQ : V_LT; + } return V_LE; } } @@ -402,15 +436,17 @@ } if (round_down(dir)) { mpz_fdiv_q(to.get_mpz_t(), n, d); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_p(n, d) != 0) ? V_EQ : V_GT; + } return V_GE; } else { PPL_ASSERT(round_up(dir)); mpz_cdiv_q(to.get_mpz_t(), n, d); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_p(n, d) != 0) ? V_EQ : V_LT; + } return V_LE; } } @@ -491,15 +527,17 @@ } if (round_down(dir)) { mpz_fdiv_q_2exp(to.get_mpz_t(), n, exp); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_2exp_p(n, exp) != 0) ? V_EQ : V_GT; + } return V_GE; } else { PPL_ASSERT(round_up(dir)); mpz_cdiv_q_2exp(to.get_mpz_t(), n, exp); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_2exp_p(n, exp) != 0) ? V_EQ : V_LT; + } return V_LE; } } @@ -510,10 +548,12 @@ inline Result smod_2exp_mpz(mpz_class& to, const mpz_class& x, unsigned int exp, Rounding_Dir) { - if (mpz_tstbit(x.get_mpz_t(), exp - 1) != 0) + if (mpz_tstbit(x.get_mpz_t(), exp - 1) != 0) { mpz_cdiv_r_2exp(to.get_mpz_t(), x.get_mpz_t(), exp); - else + } + else { mpz_fdiv_r_2exp(to.get_mpz_t(), x.get_mpz_t(), exp); + } return V_EQ; } @@ -600,8 +640,9 @@ } PPL_DIRTY_TEMP(mpz_class, r); mpz_sqrtrem(to.get_mpz_t(), r.get_mpz_t(), from.get_mpz_t()); - if (r == 0) + if (r == 0) { return V_EQ; + } return round_gt_mpz(to, dir); } diff -Nru ppl-1.1/src/Checked_Number.cc ppl-1.2/src/Checked_Number.cc --- ppl-1.1/src/Checked_Number.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Checked_Number.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Checked_Number class implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Checked_Number_defs.hh ppl-1.2/src/Checked_Number_defs.hh --- ppl-1.1/src/Checked_Number_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Checked_Number_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Checked_Number class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -242,7 +242,9 @@ //! Direct initialization from special and rounding mode. template - Checked_Number(const From&, Rounding_Dir dir, typename Enable_If::value, bool>::type ignored = false); + Checked_Number(const From&, Rounding_Dir dir, + typename Enable_If::value, bool>::type + ignored = false); //! Direct initialization from a Checked_Number, default rounding mode. template diff -Nru ppl-1.1/src/Checked_Number_inlines.hh ppl-1.2/src/Checked_Number_inlines.hh --- ppl-1.1/src/Checked_Number_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Checked_Number_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Checked_Number class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -63,8 +63,9 @@ inline void Extended_Number_Policy::handle_result(Result r) { - if (result_class(r) == VC_NAN) + if (result_class(r) == VC_NAN) { throw_result_exception(r); + } } template @@ -114,21 +115,19 @@ template \ inline \ Checked_Number::Checked_Number(const type y, Rounding_Dir dir) { \ - Policy::handle_result \ - (check_result(Checked::assign_ext > \ - (v, y, rounding_dir(dir)), \ - dir)); \ + Policy::handle_result(check_result(Checked::assign_ext > \ + (v, y, rounding_dir(dir)), \ + dir)); \ } \ template \ inline \ Checked_Number::Checked_Number(const type y) { \ Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; \ - Policy::handle_result \ - (check_result(Checked::assign_ext > \ - (v, y, rounding_dir(dir)), \ - dir)); \ + Policy::handle_result(check_result(Checked::assign_ext > \ + (v, y, rounding_dir(dir)), \ + dir)); \ } PPL_DEFINE_CTOR(char) @@ -260,8 +259,9 @@ template inline Checked_Number::operator T() const { - if (Policy::convertible) + if (Policy::convertible) { return v; + } } template @@ -447,19 +447,18 @@ PPL_U(name)(To1& to, To2& s, To3& t, const From1& x, const From2& y, \ Rounding_Dir dir) { \ return \ - check_result \ - (Checked::func::Policy, \ - typename Native_Checked_To_Wrapper::Policy, \ - typename Native_Checked_To_Wrapper::Policy, \ - typename Native_Checked_From_Wrapper::Policy, \ - typename Native_Checked_From_Wrapper::Policy> \ - (Native_Checked_To_Wrapper::raw_value(to), \ - Native_Checked_To_Wrapper::raw_value(s), \ - Native_Checked_To_Wrapper::raw_value(t), \ - Native_Checked_From_Wrapper::raw_value(x), \ - Native_Checked_From_Wrapper::raw_value(y), \ - rounding_dir(dir)), \ - dir); \ + check_result(Checked::func::Policy, \ + typename Native_Checked_To_Wrapper::Policy, \ + typename Native_Checked_To_Wrapper::Policy, \ + typename Native_Checked_From_Wrapper::Policy, \ + typename Native_Checked_From_Wrapper::Policy> \ + (Native_Checked_To_Wrapper::raw_value(to), \ + Native_Checked_To_Wrapper::raw_value(s), \ + Native_Checked_To_Wrapper::raw_value(t), \ + Native_Checked_From_Wrapper::raw_value(x), \ + Native_Checked_From_Wrapper::raw_value(y), \ + rounding_dir(dir)), \ + dir); \ } PPL_DEFINE_FUNC4(gcdext_assign_r, gcdext_ext) @@ -721,7 +720,9 @@ template inline typename Enable_If::value, int>::type sgn(const From& x) { - Result_Relation r = Checked::sgn_ext::Policy>(Native_Checked_From_Wrapper::raw_value(x)); + Result_Relation r + = Checked::sgn_ext::Policy> + (Native_Checked_From_Wrapper::raw_value(x)); switch (r) { case VR_LT: return -1; @@ -794,10 +795,12 @@ inline std::istream& operator>>(std::istream& is, Checked_Number& x) { Result r = input(x, is, Policy::ROUND_DEFAULT_INPUT); - if (r == V_CVT_STR_UNK) + if (r == V_CVT_STR_UNK) { is.setstate(std::ios::failbit); - else + } + else { Policy::handle_result(r); + } return is; } @@ -830,17 +833,20 @@ template inline void maybe_reset_fpu_inexact() { - if (FPU_Related::value) + if (FPU_Related::value) { return fpu_reset_inexact(); + } } template inline int maybe_check_fpu_inexact() { - if (FPU_Related::value) + if (FPU_Related::value) { return fpu_check_inexact(); - else + } + else { return 0; + } } } // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/src/Checked_Number_templates.hh ppl-1.2/src/Checked_Number_templates.hh --- ppl-1.1/src/Checked_Number_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Checked_Number_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Checked_Number class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,7 +24,7 @@ #ifndef PPL_Checked_Number_templates_hh #define PPL_Checked_Number_templates_hh 1 -#include "assert.hh" +#include "assertions.hh" #include #include @@ -33,9 +33,10 @@ template typename Enable_If::value, void>::type ascii_dump(std::ostream& s, const T& t) { - if (std::numeric_limits::is_exact) + if (std::numeric_limits::is_exact) { // An exact data type: pretty printer is accurate. s << t; + } else { // An inexact data type (probably floating point): // first dump its hexadecimal representation ... @@ -63,8 +64,9 @@ // An inexact data type (probably floating point): // first load its hexadecimal representation ... std::string str; - if (!(s >> str) || str.size() != 2*sizeof(T)) + if (!(s >> str) || str.size() != 2*sizeof(T)) { return false; + } unsigned char* p = reinterpret_cast(&t); // CHECKME: any (portable) simpler way? for (unsigned i = 0; i < sizeof(T); ++i) { @@ -137,8 +139,9 @@ p[i] = static_cast(byte_value); } // ... then read and discard pretty printed value. - if (!(s >> str)) + if (!(s >> str)) { return false; + } const std::string::size_type sz = str.size(); return sz > 2 && str[0] == '(' && str[sz-1] == ')'; } diff -Nru ppl-1.1/src/Checked_Number_types.hh ppl-1.2/src/Checked_Number_types.hh --- ppl-1.1/src/Checked_Number_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Checked_Number_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/checked_numeric_limits.hh ppl-1.2/src/checked_numeric_limits.hh --- ppl-1.1/src/checked_numeric_limits.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/checked_numeric_limits.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Specializations of std::numeric_limits for "checked" types. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/C_Integer.hh ppl-1.2/src/C_Integer.hh --- ppl-1.1/src/C_Integer.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/C_Integer.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* C integers info. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Coefficient.cc ppl-1.2/src/Coefficient.cc --- ppl-1.1/src/Coefficient.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Coefficient.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Coefficient class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Coefficient_defs.hh ppl-1.2/src/Coefficient_defs.hh --- ppl-1.1/src/Coefficient_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Coefficient_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Coefficient class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,7 +25,6 @@ #define PPL_Coefficient_defs_hh 1 #include "Coefficient_types.hh" -#include #if defined(PPL_CHECKED_INTEGERS) || defined(PPL_NATIVE_INTEGERS) #include "Checked_Number_defs.hh" @@ -36,6 +35,8 @@ #include "GMP_Integer_defs.hh" #endif +#include + namespace Parma_Polyhedra_Library { #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS diff -Nru ppl-1.1/src/Coefficient_inlines.hh ppl-1.2/src/Coefficient_inlines.hh --- ppl-1.1/src/Coefficient_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Coefficient_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Coefficient class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -30,8 +30,9 @@ inline void Bounded_Integer_Coefficient_Policy::handle_result(Result r) { // Note that the input functions can return VC_NAN. - if (result_overflow(r) || result_class(r) == VC_NAN) + if (result_overflow(r) || result_class(r) == VC_NAN) { throw_result_exception(r); + } } #endif // PPL_CHECKED_INTEGERS diff -Nru ppl-1.1/src/Coefficient_traits_template.hh ppl-1.2/src/Coefficient_traits_template.hh --- ppl-1.1/src/Coefficient_traits_template.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Coefficient_traits_template.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Coefficient_traits_template class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Coefficient_types.hh ppl-1.2/src/Coefficient_types.hh --- ppl-1.1/src/Coefficient_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Coefficient_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/compiler.hh ppl-1.2/src/compiler.hh --- ppl-1.1/src/compiler.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/compiler.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* C++ compiler related stuff. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -71,7 +71,7 @@ #define PPL_UNINITIALIZED(type, name) \ PPL_U(type) PPL_U(name) \ - = Suppress_Uninitialized_Warnings_Type::synonym () + = Suppress_Uninitialized_Warnings_Type::synonym() #else #define PPL_UNINITIALIZED(type, name) \ PPL_U(type) name @@ -101,17 +101,20 @@ w >>= 2; r -= 2; } - if ((w & 0x2U) != 0) + if ((w & 0x2U) != 0) { r -= 1; + } return r; } inline unsigned int clz64(uint64_t w) { - if ((w & 0xffffffff00000000ULL) == 0) + if ((w & 0xffffffff00000000ULL) == 0) { return clz32(static_cast(w)) + 32; - else + } + else { return clz32(static_cast(w >> 32)); + } } inline unsigned int @@ -126,10 +129,12 @@ inline unsigned int ctz64(uint64_t w) { - if ((w & 0x00000000ffffffffULL) == 0) + if ((w & 0x00000000ffffffffULL) == 0) { return ctz32(static_cast(w >> 32)) + 32; - else + } + else { return ctz32(static_cast(w)); + } } #endif diff -Nru ppl-1.1/src/Concrete_Expression.cc ppl-1.2/src/Concrete_Expression.cc --- ppl-1.1/src/Concrete_Expression.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Concrete_Expression.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Concrete_Expression class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Concrete_Expression_defs.hh ppl-1.2/src/Concrete_Expression_defs.hh --- ppl-1.1/src/Concrete_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Concrete_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Concrete_Expression class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Concrete_Expression_inlines.hh ppl-1.2/src/Concrete_Expression_inlines.hh --- ppl-1.1/src/Concrete_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Concrete_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Concrete_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Concrete_Expression_types.hh ppl-1.2/src/Concrete_Expression_types.hh --- ppl-1.1/src/Concrete_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Concrete_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Congruence.cc ppl-1.2/src/Congruence.cc --- ppl-1.1/src/Congruence.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Congruence.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Congruence class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,7 +25,7 @@ #include "Congruence_defs.hh" #include "Variable_defs.hh" #include "Constraint_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -36,9 +36,10 @@ PPL::Congruence::Congruence(const Constraint& c, Representation r) : expr(c.expression(), c.space_dimension(), r), modulus_(0) { - if (!c.is_equality()) + if (!c.is_equality()) { throw_invalid_argument("Congruence(c, r)", "constraint c must be an equality."); + } } PPL::Congruence::Congruence(const Constraint& c, @@ -46,9 +47,10 @@ Representation r) : expr(c.expression(), new_space_dimension, r), modulus_(0) { - if (!c.is_equality()) + if (!c.is_equality()) { throw_invalid_argument("Congruence(c, space_dim, r)", "constraint c must be an equality."); + } } void @@ -61,16 +63,18 @@ PPL_ASSERT(OK()); sign_normalize(); - if (modulus_ == 0) + if (modulus_ == 0) { return; + } PPL_DIRTY_TEMP_COEFFICIENT(c); c = expr.inhomogeneous_term(); // Factor the modulus out of the inhomogeneous term. c %= modulus_; - if (c < 0) + if (c < 0) { // Make inhomogeneous term positive. c += modulus_; + } expr.set_inhomogeneous_term(c); PPL_ASSERT(OK()); @@ -79,13 +83,15 @@ void PPL::Congruence::strong_normalize() { normalize(); - + Coefficient gcd = expr.gcd(0, expr.space_dimension() + 1); - if (gcd == 0) + if (gcd == 0) { gcd = modulus_; - else + } + else { gcd_assign(gcd, modulus_, gcd); - + } + if (gcd != 0 && gcd != 1) { expr /= gcd; modulus_ /= gcd; @@ -95,10 +101,11 @@ void PPL::Congruence::scale(Coefficient_traits::const_reference factor) { - if (factor == 1) + if (factor == 1) { // Nothing to do. return; - + } + expr *= factor; modulus_ *= factor; } @@ -110,16 +117,18 @@ PPL_DIRTY_TEMP_COEFFICIENT(c); c = expr.get(v); - if (c == 0) + if (c == 0) { return; + } scale(denominator); expr.linear_combine(e, 1, c, 0, e.space_dimension() + 1); - if (v.space_dimension() > e.space_dimension() || e.get(v) == 0) + if (v.space_dimension() > e.space_dimension() || e.get(v) == 0) { // Not invertible expr.set(v, Coefficient_zero()); + } else { c *= e.get(v); expr.set(v, c); @@ -168,42 +177,49 @@ i_end = c_e.lower_bound(Variable(num_variables)); i != i_end; ++i) { cv = *i; if (!first) { - if (cv > 0) + if (cv > 0) { s << " + "; + } else { s << " - "; neg_assign(cv); } } - else + else { first = false; - if (cv == -1) + } + if (cv == -1) { s << "-"; - else if (cv != 1) + } + else if (cv != 1) { s << cv << "*"; + } s << i.variable(); } - if (first) + if (first) { s << Coefficient_zero(); + } s << " = " << -c.inhomogeneous_term(); - if (c.is_proper_congruence()) + if (c.is_proper_congruence()) { s << " (mod " << c.modulus() << ")"; + } return s; } bool PPL::Congruence::is_tautological() const { - if (is_equality()) + if (is_equality()) { return (inhomogeneous_term() == 0) && expr.all_homogeneous_terms_are_zero(); - + } return (inhomogeneous_term() % modulus() == 0) && expr.all_homogeneous_terms_are_zero(); } bool PPL::Congruence::is_inconsistent() const { - if (is_equality()) + if (is_equality()) { return (inhomogeneous_term() != 0) && expr.all_homogeneous_terms_are_zero(); - + } + return (inhomogeneous_term() % modulus() != 0) && expr.all_homogeneous_terms_are_zero(); } @@ -220,11 +236,13 @@ expr.ascii_load(s); std::string str; - if (!(s >> str) || str != "m") + if (!(s >> str) || str != "m") { return false; + } - if (!(s >> modulus_)) + if (!(s >> modulus_)) { return false; + } PPL_ASSERT(OK()); return true; diff -Nru ppl-1.1/src/Congruence_defs.hh ppl-1.2/src/Congruence_defs.hh --- ppl-1.1/src/Congruence_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Congruence_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Congruence class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Congruence_inlines.hh ppl-1.2/src/Congruence_inlines.hh --- ppl-1.1/src/Congruence_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Congruence_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Congruence class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -167,18 +167,21 @@ inline Congruence& Congruence::operator/=(Coefficient_traits::const_reference k) { - if (k >= 0) + if (k >= 0) { modulus_ *= k; - else + } + else { modulus_ *= -k; + } return *this; } /*! \relates Congruence */ inline bool operator==(const Congruence& x, const Congruence& y) { - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { return false; + } Congruence x_temp(x); Congruence y_temp(y); x_temp.strong_normalize(); @@ -205,8 +208,9 @@ inline Coefficient_traits::const_reference Congruence::coefficient(const Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { throw_dimension_incompatible("coefficient(v)", "v", v); + } return expr.coefficient(v); } diff -Nru ppl-1.1/src/Congruence_System.cc ppl-1.2/src/Congruence_System.cc --- ppl-1.1/src/Congruence_System.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Congruence_System.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Congruence_System class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -30,7 +30,7 @@ #include "Grid_Generator_defs.hh" #include "Scalar_Products_defs.hh" #include "Scalar_Products_inlines.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -44,9 +44,11 @@ space_dimension_(cs.space_dimension()), representation_(r) { for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) - if (i->is_equality()) + cs_end = cs.end(); i != cs_end; ++i) { + if (i->is_equality()) { insert(*i); + } + } } void @@ -70,13 +72,15 @@ // Swap the rows in [first, last) with the rows in [size() - n, size()) // (note that these intervals may not be disjunct). if (keep_sorted) { - for (dimension_type i = last; i < rows.size(); ++i) + for (dimension_type i = last; i < rows.size(); ++i) { swap(rows[i], rows[i - n]); + } } else { const dimension_type offset = rows.size() - n - first; - for (dimension_type i = first; i < last; ++i) + for (dimension_type i = first; i < last; ++i) { swap(rows[i], rows[i + offset]); + } } rows.resize(rows.size() - n); @@ -88,8 +92,9 @@ ::set_space_dimension(const dimension_type new_space_dim) { if (space_dimension() != new_space_dim) { space_dimension_ = new_space_dim; - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].set_space_dimension(new_space_dim); + } } PPL_ASSERT(OK()); return true; @@ -97,8 +102,9 @@ void PPL::Congruence_System::swap_space_dimensions(Variable v1, Variable v2) { - for (dimension_type k = num_rows(); k-- > 0; ) + for (dimension_type k = num_rows(); k-- > 0; ) { rows[k].swap_space_dimensions(v1, v2); + } } void @@ -108,10 +114,12 @@ cg.set_representation(representation()); - if (cg.space_dimension() >= space_dimension()) + if (cg.space_dimension() >= space_dimension()) { set_space_dimension(cg.space_dimension()); - else + } + else { cg.set_space_dimension(space_dimension()); + } rows.resize(num_rows() + 1); @@ -122,8 +130,9 @@ void PPL::Congruence_System::insert(const Constraint& c) { - if (c.space_dimension() > space_dimension()) + if (c.space_dimension() > space_dimension()) { set_space_dimension(c.space_dimension()); + } Congruence cg(c, space_dimension(), representation()); cg.strong_normalize(); rows.resize(num_rows() + 1); @@ -137,8 +146,9 @@ PPL::Congruence_System::insert(Congruence_System& cgs, Recycle_Input) { const dimension_type old_num_rows = num_rows(); const dimension_type cgs_num_rows = cgs.num_rows(); - if (space_dimension() < cgs.space_dimension()) + if (space_dimension() < cgs.space_dimension()) { set_space_dimension(cgs.space_dimension()); + } rows.resize(old_num_rows + cgs_num_rows); for (dimension_type i = cgs_num_rows; i-- > 0; ) { cgs.rows[i].set_space_dimension(space_dimension()); @@ -158,8 +168,9 @@ const dimension_type y_num_rows = y.num_rows(); // Grow to the required size. - if (space_dimension() < y.space_dimension()) + if (space_dimension() < y.space_dimension()) { set_space_dimension(y.space_dimension()); + } rows.resize(rows.size() + y_num_rows); @@ -182,25 +193,29 @@ while (true) { --row; lcm = cgs[row].modulus(); - if (lcm > 0) + if (lcm > 0) { break; - if (row == 0) + } + if (row == 0) { // All rows are equalities. return; + } } while (row > 0) { --row; const Coefficient& modulus = cgs[row].modulus(); - if (modulus > 0) + if (modulus > 0) { lcm_assign(lcm, lcm, modulus); + } } // Represent every row using the LCM as the modulus. PPL_DIRTY_TEMP_COEFFICIENT(factor); for (row = num_rows(); row-- > 0; ) { const Coefficient& modulus = cgs[row].modulus(); - if (modulus <= 0 || modulus == lcm) + if (modulus <= 0 || modulus == lcm) { continue; + } exact_div_assign(factor, lcm, modulus); rows[row].scale(factor); } @@ -216,26 +231,31 @@ bool PPL::Congruence_System::has_linear_equalities() const { const Congruence_System& cgs = *this; - for (dimension_type i = cgs.num_rows(); i-- > 0; ) - if (cgs[i].modulus() == 0) + for (dimension_type i = cgs.num_rows(); i-- > 0; ) { + if (cgs[i].modulus() == 0) { return true; + } + } return false; } void PPL::Congruence_System::const_iterator::skip_forward() { const Swapping_Vector::const_iterator csp_end = csp->end(); - while (i != csp_end && (*this)->is_tautological()) + while (i != csp_end && (*this)->is_tautological()) { ++i; + } } PPL::dimension_type PPL::Congruence_System::num_equalities() const { const Congruence_System& cgs = *this; dimension_type n = 0; - for (dimension_type i = num_rows(); i-- > 0 ; ) - if (cgs[i].is_equality()) + for (dimension_type i = num_rows(); i-- > 0 ; ) { + if (cgs[i].is_equality()) { ++n; + } + } return n; } @@ -245,8 +265,9 @@ dimension_type n = 0; for (dimension_type i = num_rows(); i-- > 0 ; ) { const Congruence& cg = cgs[i]; - if (cg.is_proper_congruence()) + if (cg.is_proper_congruence()) { ++n; + } } return n; } @@ -258,24 +279,28 @@ const Congruence_System& cgs = *this; PPL_DIRTY_TEMP_COEFFICIENT(sp); - if (g.is_line()) + if (g.is_line()) { for (dimension_type i = cgs.num_rows(); i-- > 0; ) { const Congruence& cg = cgs[i]; Scalar_Products::assign(sp, g, cg); - if (sp != 0) + if (sp != 0) { return false; + } } + } else { const Coefficient& divisor = g.divisor(); for (dimension_type i = cgs.num_rows(); i-- > 0; ) { const Congruence& cg = cgs[i]; Scalar_Products::assign(sp, g, cg); if (cg.is_equality()) { - if (sp != 0) + if (sp != 0) { return false; + } } - else if (sp % (cg.modulus() * divisor) != 0) + else if (sp % (cg.modulus() * divisor) != 0) { return false; + } } } return true; @@ -286,13 +311,15 @@ // Search for a dimension that is free of any congruence or equality // constraint. Assumes a minimized system. std::set candidates; - for (dimension_type i = space_dimension(); i-- > 0; ) + for (dimension_type i = space_dimension(); i-- > 0; ) { candidates.insert(i + 1); + } for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].expression().has_a_free_dimension_helper(candidates); - if (candidates.empty()) + if (candidates.empty()) { return false; + } } return !candidates.empty(); } @@ -306,8 +333,9 @@ PPL_ASSERT(expr.space_dimension() <= space_dimension()); PPL_ASSERT(denominator > 0); - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].affine_preimage(v, expr, denominator); + } } void @@ -318,8 +346,9 @@ s << x_num_rows << " x " << x_space_dim << " "; Parma_Polyhedra_Library::ascii_dump(s, representation()); s << std::endl; - for (dimension_type i = 0; i < x_num_rows; ++i) + for (dimension_type i = 0; i < x_num_rows; ++i) { x[i].ascii_dump(s); + } } PPL_OUTPUT_DEFINITIONS(Congruence_System) @@ -329,22 +358,27 @@ std::string str; dimension_type num_rows; dimension_type space_dim; - if (!(s >> num_rows)) + if (!(s >> num_rows)) { return false; - if (!(s >> str) || str != "x") + } + if (!(s >> str) || str != "x") { return false; - if (!(s >> space_dim)) + } + if (!(s >> space_dim)) { return false; + } clear(); space_dimension_ = space_dim; - if (!Parma_Polyhedra_Library::ascii_load(s, representation_)) + if (!Parma_Polyhedra_Library::ascii_load(s, representation_)) { return false; + } Congruence c; for (dimension_type i = 0; i < num_rows; ++i) { - if (!c.ascii_load(s)) + if (!c.ascii_load(s)) { return false; + } insert_verbatim(c, Recycle_Input()); } @@ -375,12 +409,15 @@ // and representation `representation()'. for (dimension_type i = num_rows(); i-- > 0; ) { const Congruence& cg = rows[i]; - if (cg.space_dimension() != space_dimension()) + if (cg.space_dimension() != space_dimension()) { return false; - if (cg.representation() != representation()) + } + if (cg.representation() != representation()) { return false; - if (!cg.OK()) + } + if (!cg.OK()) { return false; + } } // All checks passed. return true; @@ -391,15 +428,17 @@ PPL::IO_Operators::operator<<(std::ostream& s, const Congruence_System& cgs) { Congruence_System::const_iterator i = cgs.begin(); const Congruence_System::const_iterator cgs_end = cgs.end(); - if (i == cgs_end) + if (i == cgs_end) { return s << "true"; + } while (true) { Congruence cg = *i; cg.strong_normalize(); s << cg; ++i; - if (i == cgs_end) + if (i == cgs_end) { return s; + } s << ", "; } } @@ -407,12 +446,14 @@ /*! \relates Parma_Polyhedra_Library::Congruence_System */ bool PPL::operator==(const Congruence_System& x, const Congruence_System& y) { - if (x.num_rows() != y.num_rows()) + if (x.num_rows() != y.num_rows()) { return false; + } for (dimension_type i = x.num_rows(); i-- > 0; ) { // NOTE: this also checks for space dimension. - if (x[i] != y[i]) + if (x[i] != y[i]) { return false; + } } return true; } @@ -426,8 +467,9 @@ rows.resize(rows.size() + dims); // Swap the added rows to the front of the vector. - for (dimension_type row = old_num_rows; row-- > 0; ) + for (dimension_type row = old_num_rows; row-- > 0; ) { swap(rows[row], rows[row + dims]); + } const dimension_type dim = space_dimension(); // Set the space dimension and the diagonal element of each added row. diff -Nru ppl-1.1/src/Congruence_System_defs.hh ppl-1.2/src/Congruence_System_defs.hh --- ppl-1.1/src/Congruence_System_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Congruence_System_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Congruence_System class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -33,6 +33,7 @@ #include "Congruence_defs.hh" #include "Constraint_System_types.hh" #include +#include namespace Parma_Polyhedra_Library { @@ -249,7 +250,7 @@ class const_iterator : public std::iterator { public: diff -Nru ppl-1.1/src/Congruence_System_inlines.hh ppl-1.2/src/Congruence_System_inlines.hh --- ppl-1.1/src/Congruence_System_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Congruence_System_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Congruence_System class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -101,8 +101,9 @@ space_dimension_(cgs.space_dimension_), representation_(r) { if (cgs.representation() != r) { - for (dimension_type i = 0; i < num_rows(); ++i) + for (dimension_type i = 0; i < num_rows(); ++i) { rows[i].set_representation(representation()); + } } } @@ -131,11 +132,13 @@ inline void Congruence_System::set_representation(Representation r) { - if (representation_ == r) + if (representation_ == r) { return; + } representation_ = r; - for (dimension_type i = 0; i < num_rows(); ++i) + for (dimension_type i = 0; i < num_rows(); ++i) { rows[i].set_representation(r); + } PPL_ASSERT(OK()); } diff -Nru ppl-1.1/src/Congruence_System_types.hh ppl-1.2/src/Congruence_System_types.hh --- ppl-1.1/src/Congruence_System_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Congruence_System_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Congruence_types.hh ppl-1.2/src/Congruence_types.hh --- ppl-1.1/src/Congruence_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Congruence_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Constant_Floating_Point_Expression_defs.hh ppl-1.2/src/Constant_Floating_Point_Expression_defs.hh --- ppl-1.1/src/Constant_Floating_Point_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constant_Floating_Point_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declarations for the Constant_Floating_Point_Expression class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Constant_Floating_Point_Expression_inlines.hh ppl-1.2/src/Constant_Floating_Point_Expression_inlines.hh --- ppl-1.1/src/Constant_Floating_Point_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constant_Floating_Point_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Constant_Floating_Point_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Constant_Floating_Point_Expression_types.hh ppl-1.2/src/Constant_Floating_Point_Expression_types.hh --- ppl-1.1/src/Constant_Floating_Point_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constant_Floating_Point_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Constraint.cc ppl-1.2/src/Constraint.cc --- ppl-1.1/src/Constraint.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constraint.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Constraint class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -67,9 +67,10 @@ : expr(cg.expression(), r), kind_(LINE_OR_EQUALITY), topology_(NECESSARILY_CLOSED) { - if (!cg.is_equality()) + if (!cg.is_equality()) { throw_invalid_argument("Constraint(cg)", "congruence cg must be an equality."); + } // Enforce normalization. strong_normalize(); PPL_ASSERT(OK()); @@ -88,9 +89,10 @@ void PPL::Constraint ::permute_space_dimensions(const std::vector& cycle) { - if (cycle.size() < 2) + if (cycle.size() < 2) { // No-op. No need to call sign_normalize(). return; + } expr.permute_space_dimensions(cycle); // *this is still normalized but may be not strongly normalized: @@ -101,71 +103,86 @@ bool PPL::Constraint::is_tautological() const { - if (expr.all_homogeneous_terms_are_zero()) - if (is_equality()) + if (expr.all_homogeneous_terms_are_zero()) { + if (is_equality()) { return expr.inhomogeneous_term() == 0; - else + } + else { // Non-strict inequality constraint. return expr.inhomogeneous_term() >= 0; - else + } + } + else { // There is a non-zero homogeneous coefficient. - if (is_necessarily_closed()) + if (is_necessarily_closed()) { return false; + } else { // The constraint is NOT necessarily closed. const int eps_sign = sgn(epsilon_coefficient()); - if (eps_sign > 0) + if (eps_sign > 0) { // We have found the constraint epsilon >= 0. return true; - if (eps_sign == 0) + } + if (eps_sign == 0) { // One of the `true' dimensions has a non-zero coefficient. return false; + } else { // Here the epsilon coefficient is negative: strict inequality. - if (expr.inhomogeneous_term() <= 0) + if (expr.inhomogeneous_term() <= 0) { // A strict inequality such as `lhs - k > 0', // where k is a non negative integer, cannot be trivially true. return false; + } // Checking for another non-zero coefficient. // If the check succeeds, we have the inequality `k > 0', // where k is a positive integer. return expression().all_homogeneous_terms_are_zero(); } } + } } bool PPL::Constraint::is_inconsistent() const { - if (expr.all_homogeneous_terms_are_zero()) + if (expr.all_homogeneous_terms_are_zero()) { // The inhomogeneous term is the only non-zero coefficient. - if (is_equality()) + if (is_equality()) { return expr.inhomogeneous_term() != 0; - else + } + else { // Non-strict inequality constraint. return expr.inhomogeneous_term() < 0; - else + } + } + else { // There is a non-zero homogeneous coefficient. - if (is_necessarily_closed()) + if (is_necessarily_closed()) { return false; + } else { // The constraint is NOT necessarily closed. - if (epsilon_coefficient() >= 0) + if (epsilon_coefficient() >= 0) { // If positive, we have found the constraint epsilon >= 0. // If zero, one of the `true' dimensions has a non-zero coefficient. // In both cases, it is not trivially false. return false; + } else { // Here the epsilon coefficient is negative: strict inequality. - if (expr.inhomogeneous_term() > 0) + if (expr.inhomogeneous_term() > 0) { // A strict inequality such as `lhs + k > 0', // where k is a positive integer, cannot be trivially false. return false; + } // Checking for another non-zero coefficient. // If the check succeeds, we have the inequality `k > 0', // where k is a positive integer. return expression().all_homogeneous_terms_are_zero(); } } + } } void @@ -179,9 +196,10 @@ PPL::compare(const Constraint& x, const Constraint& y) { const bool x_is_line_or_equality = x.is_line_or_equality(); const bool y_is_line_or_equality = y.is_line_or_equality(); - if (x_is_line_or_equality != y_is_line_or_equality) + if (x_is_line_or_equality != y_is_line_or_equality) { // Equalities (lines) precede inequalities (ray/point). return y_is_line_or_equality ? 2 : -2; + } return compare(x.expr, y.expr); } @@ -190,16 +208,19 @@ PPL::Constraint::is_equivalent_to(const Constraint& y) const { const Constraint& x = *this; const dimension_type x_space_dim = x.space_dimension(); - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } const Type x_type = x.type(); if (x_type != y.type()) { // Check for special cases. - if (x.is_tautological()) + if (x.is_tautological()) { return y.is_tautological(); - else + } + else { return x.is_inconsistent() && y.is_inconsistent(); + } } if (x_type == STRICT_INEQUALITY) { @@ -229,8 +250,9 @@ void PPL::Constraint::sign_normalize() { - if (is_line_or_equality()) + if (is_line_or_equality()) { expr.sign_normalize(); + } } bool @@ -288,7 +310,7 @@ expr.ascii_dump(s); s << " "; - + switch (type()) { case Constraint::EQUALITY: s << "="; @@ -301,11 +323,12 @@ break; } s << " "; - if (topology() == NECESSARILY_CLOSED) + if (topology() == NECESSARILY_CLOSED) { s << "(C)"; - else + } + else { s << "(NNC)"; - + } s << "\n"; } @@ -316,44 +339,56 @@ expr.ascii_load(s); - if (!(s >> str)) + if (!(s >> str)) { return false; - if (str == "=") + } + if (str == "=") { set_is_equality(); - else if (str == ">=" || str == ">") + } + else if (str == ">=" || str == ">") { set_is_inequality(); - else + } + else { return false; + } - if (!(s >> str2)) + if (!(s >> str2)) { return false; + } if (str2 == "(NNC)") { // TODO: Avoid the mark_as_*() methods if possible. - if (topology() == NECESSARILY_CLOSED) + if (topology() == NECESSARILY_CLOSED) { mark_as_not_necessarily_closed(); + } } - else + else { if (str2 == "(C)") { // TODO: Avoid the mark_as_*() methods if possible. - if (topology() == NOT_NECESSARILY_CLOSED) + if (topology() == NOT_NECESSARILY_CLOSED) { mark_as_necessarily_closed(); + } } - else + else { return false; + } + } // Checking for equality of actual and declared types. switch (type()) { case EQUALITY: - if (str != "=") + if (str != "=") { return false; + } break; case NONSTRICT_INEQUALITY: - if (str != ">=") + if (str != ">=") { return false; + } break; case STRICT_INEQUALITY: - if (str != ">") + if (str != ">") { return false; + } break; } @@ -369,23 +404,28 @@ i_end = c.expression().end(); i != i_end; ++i) { cv = *i; if (!first) { - if (cv > 0) + if (cv > 0) { s << " + "; + } else { s << " - "; neg_assign(cv); } } - else + else { first = false; - if (cv == -1) + } + if (cv == -1) { s << "-"; - else if (cv != 1) + } + else if (cv != 1) { s << cv << "*"; + } s << i.variable(); } - if (first) + if (first) { s << Coefficient_zero(); + } const char* relation_symbol = 0; switch (c.type()) { case Constraint::EQUALITY: diff -Nru ppl-1.1/src/Constraint_defs.hh ppl-1.2/src/Constraint_defs.hh --- ppl-1.1/src/Constraint_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constraint_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Constraint class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Constraint_inlines.hh ppl-1.2/src/Constraint_inlines.hh --- ppl-1.1/src/Constraint_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constraint_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Constraint class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -80,8 +80,9 @@ inline void Constraint::set_topology(Topology x) { - if (topology() == x) + if (topology() == x) { return; + } if (topology() == NECESSARILY_CLOSED) { // Add a column for the epsilon dimension. expr.set_space_dimension(expr.space_dimension() + 1); @@ -140,9 +141,10 @@ topology_(topology) { PPL_ASSERT(kind != RAY_OR_POINT_OR_INEQUALITY || topology == NOT_NECESSARILY_CLOSED); swap(expr, e); - if (topology == NOT_NECESSARILY_CLOSED) + if (topology == NOT_NECESSARILY_CLOSED) { // Add the epsilon dimension. expr.set_space_dimension(expr.space_dimension() + 1); + } strong_normalize(); PPL_ASSERT(OK()); } @@ -152,12 +154,15 @@ : topology_(topology) { PPL_ASSERT(type != STRICT_INEQUALITY || topology == NOT_NECESSARILY_CLOSED); swap(expr, e); - if (topology == NOT_NECESSARILY_CLOSED) + if (topology == NOT_NECESSARILY_CLOSED) { expr.set_space_dimension(expr.space_dimension() + 1); - if (type == EQUALITY) + } + if (type == EQUALITY) { kind_ = LINE_OR_EQUALITY; - else + } + else { kind_ = RAY_OR_POINT_OR_INEQUALITY; + } strong_normalize(); PPL_ASSERT(OK()); } @@ -240,8 +245,9 @@ } } PPL_ASSERT(space_dimension() == space_dim); - if (expr.space_dimension() < old_expr_space_dim) + if (expr.space_dimension() < old_expr_space_dim) { strong_normalize(); + } } inline void @@ -268,14 +274,18 @@ inline Constraint::Type Constraint::type() const { - if (is_equality()) + if (is_equality()) { return EQUALITY; - if (is_necessarily_closed()) + } + if (is_necessarily_closed()) { return NONSTRICT_INEQUALITY; - if (epsilon_coefficient() < 0) + } + if (epsilon_coefficient() < 0) { return STRICT_INEQUALITY; - else + } + else { return NONSTRICT_INEQUALITY; + } } inline bool @@ -300,8 +310,9 @@ inline Coefficient_traits::const_reference Constraint::coefficient(const Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { throw_dimension_incompatible("coefficient(v)", "v", v); + } return expr.coefficient(v); } @@ -351,8 +362,9 @@ /*! \relates Constraint */ inline Constraint operator==(Variable v1, Variable v2) { - if (v1.space_dimension() > v2.space_dimension()) + if (v1.space_dimension() > v2.space_dimension()) { swap(v1, v2); + } PPL_ASSERT(v1.space_dimension() <= v2.space_dimension()); Linear_Expression diff(v1, Constraint::default_representation); diff -Nru ppl-1.1/src/Constraint_System.cc ppl-1.2/src/Constraint_System.cc --- ppl-1.1/src/Constraint_System.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constraint_System.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Constraint_System class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -29,7 +29,7 @@ #include "Scalar_Products_inlines.hh" #include "Congruence_System_defs.hh" #include "Congruence_System_inlines.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -41,11 +41,12 @@ Representation r) : sys(NECESSARILY_CLOSED, cgs.space_dimension(), r) { for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); i != cgs_end; ++i) + cgs_end = cgs.end(); i != cgs_end; ++i) { if (i->is_equality()) { Constraint tmp(*i); insert(tmp, Recycle_Input()); } + } PPL_ASSERT(OK()); } @@ -60,8 +61,9 @@ // A NOT_NECESSARILY_CLOSED constraint system // can be converted to a NECESSARILY_CLOSED one // only if it does not contain strict inequalities. - if (has_strict_inequalities()) + if (has_strict_inequalities()) { return false; + } // Since there were no strict inequalities, // the only constraints that may have a non-zero epsilon coefficient // are the eps-leq-one and the eps-geq-zero constraints. @@ -72,15 +74,19 @@ // Note that num_rows() is *not* constant, because it is decreased by // remove_row(). - for (dimension_type i = 0; i < num_rows(); ) - if (sys[i].epsilon_coefficient() != 0) + for (dimension_type i = 0; i < num_rows(); ) { + if (sys[i].epsilon_coefficient() != 0) { sys.remove_row(i, false); - else + } + else { ++i; + } + } // If `cs' was sorted we sort it again. - if (was_sorted) + if (was_sorted) { sys.sort_rows(); + } } sys.set_topology(new_topology); @@ -94,16 +100,19 @@ bool PPL::Constraint_System::has_equalities() const { // We verify if the system has equalities also in the pending part. - for (dimension_type i = sys.num_rows(); i-- > 0; ) - if (sys[i].is_equality()) + for (dimension_type i = sys.num_rows(); i-- > 0; ) { + if (sys[i].is_equality()) { return true; + } + } return false; } bool PPL::Constraint_System::has_strict_inequalities() const { - if (sys.is_necessarily_closed()) + if (sys.is_necessarily_closed()) { return false; + } // We verify if the system has strict inequalities // also in the pending part. for (dimension_type i = sys.num_rows(); i-- > 0; ) { @@ -112,8 +121,9 @@ // also, equalities have the epsilon coefficient equal to zero. // NOTE: the constraint eps_leq_one should not be considered // a strict inequality. - if (c.epsilon_coefficient() < 0 && !c.is_tautological()) + if (c.epsilon_coefficient() < 0 && !c.is_tautological()) { return true; + } } return false; } @@ -131,10 +141,12 @@ PPL_ASSERT(sys.num_pending_rows() == 0); if (sys.topology() != c.topology()) { - if (sys.topology() == NECESSARILY_CLOSED) + if (sys.topology() == NECESSARILY_CLOSED) { sys.set_topology(NOT_NECESSARILY_CLOSED); - else + } + else { c.set_topology(NOT_NECESSARILY_CLOSED); + } } sys.insert(c, Recycle_Input()); @@ -151,10 +163,12 @@ void PPL::Constraint_System::insert_pending(Constraint& c, Recycle_Input) { if (sys.topology() != c.topology()) { - if (sys.topology() == NECESSARILY_CLOSED) + if (sys.topology() == NECESSARILY_CLOSED) { sys.set_topology(NOT_NECESSARILY_CLOSED); - else + } + else { c.set_topology(NOT_NECESSARILY_CLOSED); + } } sys.insert_pending(c, Recycle_Input()); @@ -170,13 +184,19 @@ dimension_type n = 0; // If the Base happens to be sorted, take advantage of the fact // that inequalities are at the bottom of the system. - if (sys.is_sorted()) - for (dimension_type i = sys.num_rows(); i > 0 && cs[--i].is_inequality(); ) + if (sys.is_sorted()) { + for (dimension_type i = sys.num_rows(); + i > 0 && cs[--i].is_inequality(); ) { ++n; - else - for (dimension_type i = sys.num_rows(); i-- > 0 ; ) - if (cs[i].is_inequality()) + } + } + else { + for (dimension_type i = sys.num_rows(); i-- > 0 ; ) { + if (cs[i].is_inequality()) { ++n; + } + } + } return n; } @@ -191,8 +211,9 @@ void PPL::Constraint_System_const_iterator::skip_forward() { const Linear_System::const_iterator csp_end = csp->end(); - while (i != csp_end && (*this)->is_tautological()) + while (i != csp_end && (*this)->is_tautological()) { ++i; + } } bool @@ -207,11 +228,13 @@ if (sys.is_necessarily_closed()) { if (g.is_line()) { // Lines must saturate all constraints. - for (dimension_type i = sys.num_rows(); i-- > 0; ) - if (sps(g, sys[i]) != 0) + for (dimension_type i = sys.num_rows(); i-- > 0; ) { + if (sps(g, sys[i]) != 0) { return false; + } + } } - else + else { // `g' is either a ray, a point or a closure point. for (dimension_type i = sys.num_rows(); i-- > 0; ) { const Constraint& c = sys[i]; @@ -219,24 +242,30 @@ if (c.is_inequality()) { // As `cs' is necessarily closed, // `c' is a non-strict inequality. - if (sp_sign < 0) + if (sp_sign < 0) { return false; + } } - else + else { // `c' is an equality. - if (sp_sign != 0) + if (sp_sign != 0) { return false; + } + } } + } } - else + else { // `cs' is not necessarily closed. switch (g.type()) { case Generator::LINE: // Lines must saturate all constraints. - for (dimension_type i = sys.num_rows(); i-- > 0; ) - if (sps(g, sys[i]) != 0) + for (dimension_type i = sys.num_rows(); i-- > 0; ) { + if (sps(g, sys[i]) != 0) { return false; + } + } break; @@ -248,16 +277,19 @@ const int sp_sign = sps(g, c); switch (c.type()) { case Constraint::EQUALITY: - if (sp_sign != 0) + if (sp_sign != 0) { return false; + } break; case Constraint::NONSTRICT_INEQUALITY: - if (sp_sign < 0) + if (sp_sign < 0) { return false; + } break; case Constraint::STRICT_INEQUALITY: - if (sp_sign <= 0) + if (sp_sign <= 0) { return false; + } break; } } @@ -271,16 +303,19 @@ const int sp_sign = sps(g, c); if (c.is_inequality()) { // Constraint `c' is either a strict or a non-strict inequality. - if (sp_sign < 0) + if (sp_sign < 0) { return false; + } } else // Constraint `c' is an equality. - if (sp_sign != 0) + if (sp_sign != 0) { return false; + } } break; } + } // If we reach this point, `g' satisfies all constraints. return true; @@ -307,13 +342,16 @@ Coefficient_traits::const_reference row_v = row.coefficient(v); if (row_v != 0) { const Coefficient c = row_v; - if (denominator != 1) + if (denominator != 1) { row.expr *= denominator; + } row.expr.linear_combine(expr, 1, c, 0, expr.space_dimension() + 1); - if (not_invertible) + if (not_invertible) { row.expr.set_coefficient(v, Coefficient_zero()); - else + } + else { row.expr.set_coefficient(v, c * expr_v); + } row.strong_normalize(); PPL_ASSERT(row.OK()); } @@ -334,8 +372,9 @@ bool PPL::Constraint_System::ascii_load(std::istream& s) { - if (!sys.ascii_load(s)) + if (!sys.ascii_load(s)) { return false; + } PPL_ASSERT(OK()); return true; @@ -367,14 +406,16 @@ PPL::IO_Operators::operator<<(std::ostream& s, const Constraint_System& cs) { Constraint_System_const_iterator i = cs.begin(); const Constraint_System_const_iterator cs_end = cs.end(); - if (i == cs_end) + if (i == cs_end) { s << "true"; + } else { while (i != cs_end) { s << *i; ++i; - if (i != cs_end) + if (i != cs_end) { s << ", "; + } } } return s; diff -Nru ppl-1.1/src/Constraint_System_defs.hh ppl-1.2/src/Constraint_System_defs.hh --- ppl-1.1/src/Constraint_System_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constraint_System_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Constraint_System class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -37,6 +37,7 @@ #include "termination_types.hh" #include #include +#include namespace Parma_Polyhedra_Library { @@ -609,7 +610,7 @@ class Parma_Polyhedra_Library::Constraint_System_const_iterator : public std::iterator { public: diff -Nru ppl-1.1/src/Constraint_System_inlines.hh ppl-1.2/src/Constraint_System_inlines.hh --- ppl-1.1/src/Constraint_System_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constraint_System_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Constraint_System class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -196,9 +196,10 @@ inline void Constraint_System::add_low_level_constraints() { - if (sys.is_necessarily_closed()) + if (sys.is_necessarily_closed()) { // The positivity constraint. insert(Constraint::zero_dim_positivity()); + } else { // Add the epsilon constraints. insert(Constraint::epsilon_leq_one()); diff -Nru ppl-1.1/src/Constraint_System_types.hh ppl-1.2/src/Constraint_System_types.hh --- ppl-1.1/src/Constraint_System_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constraint_System_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Constraint_types.hh ppl-1.2/src/Constraint_types.hh --- ppl-1.1/src/Constraint_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Constraint_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/COPYING.cc.dist ppl-1.2/src/COPYING.cc.dist --- ppl-1.1/src/COPYING.cc.dist 2013-10-28 12:47:20.000000000 +0000 +++ ppl-1.2/src/COPYING.cc.dist 2016-02-11 12:40:41.000000000 +0000 @@ -1,3 +1,4 @@ +#include "COPYING.hh" extern const char* const COPYING_array[675] = { " GNU GENERAL PUBLIC LICENSE", " Version 3, 29 June 2007", diff -Nru ppl-1.1/src/CO_Tree.cc ppl-1.2/src/CO_Tree.cc --- ppl-1.1/src/CO_Tree.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/CO_Tree.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* CO_Tree class implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -34,8 +34,10 @@ memory_size += (reserved_size + 1)*sizeof(data[0]); // Add the size of indexes[] memory_size += (reserved_size + 2)*sizeof(indexes[0]); - for (const_iterator itr = begin(), itr_end = end(); itr != itr_end; ++itr) + for (const_iterator itr = begin(), itr_end = end(); + itr != itr_end; ++itr) { memory_size += PPL::external_memory_in_bytes(*itr); + } } return memory_size; } @@ -49,35 +51,40 @@ return iterator(*this); } - if (itr == end()) + if (itr == end()) { return insert(key1); + } iterator candidate1 = bisect_near(itr, key1); - if (key1 == candidate1.index()) + if (key1 == candidate1.index()) { return candidate1; + } dimension_type candidate2_index = dfs_index(candidate1); if (key1 < candidate1.index()) { --candidate2_index; - while (indexes[candidate2_index] == unused_index) + while (indexes[candidate2_index] == unused_index) { --candidate2_index; + } } else { ++candidate2_index; - while (indexes[candidate2_index] == unused_index) + while (indexes[candidate2_index] == unused_index) { ++candidate2_index; + } } tree_iterator candidate1_node(candidate1, *this); PPL_ASSERT(candidate2_index <= reserved_size + 1); - if (candidate2_index == 0 || candidate2_index > reserved_size) + if (candidate2_index == 0 || candidate2_index > reserved_size) { // Use candidate1 return iterator(insert_precise(key1, Coefficient_zero(), candidate1_node)); + } tree_iterator candidate2_node(*this, candidate2_index); @@ -112,8 +119,9 @@ return iterator(*this); } - if (itr == end()) + if (itr == end()) { return insert(key1, data1); + } iterator candidate1 = bisect_near(itr, key1); @@ -126,20 +134,25 @@ if (key1 < candidate1.index()) { --candidate2_index; - while (indexes[candidate2_index] == unused_index) + while (indexes[candidate2_index] == unused_index) { --candidate2_index; + } + } else { ++candidate2_index; - while (indexes[candidate2_index] == unused_index) + while (indexes[candidate2_index] == unused_index) { ++candidate2_index; + } + } tree_iterator candidate1_node(candidate1, *this); - if (candidate2_index == 0 || candidate2_index > reserved_size) + if (candidate2_index == 0 || candidate2_index > reserved_size) { // Use candidate1 return iterator(insert_precise(key1, data1, candidate1_node)); + } tree_iterator candidate2_node(*this, candidate2_index); @@ -165,29 +178,35 @@ void PPL::CO_Tree::erase_element_and_shift_left(dimension_type key) { iterator itr = erase(key); - if (itr == end()) + if (itr == end()) { return; + } const dimension_type i = dfs_index(itr); dimension_type* p = indexes + i; const dimension_type* const p_end = indexes + (reserved_size + 1); - for ( ; p != p_end; ++p) - if (*p != unused_index) + for ( ; p != p_end; ++p) { + if (*p != unused_index) { --(*p); + } + } PPL_ASSERT(OK()); } void PPL::CO_Tree::increase_keys_from(dimension_type key, dimension_type n) { - if (empty()) + if (empty()) { return; + } dimension_type* p = indexes + reserved_size; - while (*p == unused_index) + while (*p == unused_index) { --p; + } while (p != indexes && *p >= key) { *p += n; --p; - while (*p == unused_index) + while (*p == unused_index) { --p; + } } PPL_ASSERT(OK()); } @@ -205,16 +224,19 @@ dimension_type half = (first + last) / 2; dimension_type new_half = half; - while (indexes[new_half] == unused_index) + while (indexes[new_half] == unused_index) { ++new_half; + } - if (indexes[new_half] == key) + if (indexes[new_half] == key) { return new_half; + } if (indexes[new_half] > key) { - while (indexes[half] == unused_index) + while (indexes[half] == unused_index) { --half; + } last = half; @@ -222,8 +244,9 @@ else { ++new_half; - while (indexes[new_half] == unused_index) + while (indexes[new_half] == unused_index) { ++new_half; + } first = new_half; } @@ -241,8 +264,9 @@ PPL_ASSERT(hint <= reserved_size); PPL_ASSERT(indexes[hint] != unused_index); - if (indexes[hint] == key) + if (indexes[hint] == key) { return hint; + } dimension_type new_hint; dimension_type offset = 1; @@ -257,28 +281,34 @@ new_hint = hint; hint = 1; // The searched element is in [hint,new_hint). - while (indexes[hint] == unused_index) + while (indexes[hint] == unused_index) { ++hint; - if (indexes[hint] >= key) + } + + if (indexes[hint] >= key) { return hint; + } // The searched element is in (hint,new_hint) and both indexes point // to valid elements. break; } - else + else { new_hint = hint - offset; + } PPL_ASSERT(new_hint > 0); PPL_ASSERT(new_hint <= reserved_size); // Find the element at `new_hint' (or the first after it). - while (indexes[new_hint] == unused_index) + while (indexes[new_hint] == unused_index) { ++new_hint; + } PPL_ASSERT(new_hint <= hint); - if (indexes[new_hint] == key) + if (indexes[new_hint] == key) { return new_hint; + } else if (indexes[new_hint] < key) { // The searched element is in (new_hint,hint) @@ -301,33 +331,39 @@ // The searched element is in (hint,reserved_size+1). new_hint = reserved_size; // The searched element is in (hint,new_hint]. - while (indexes[new_hint] == unused_index) + while (indexes[new_hint] == unused_index) { --new_hint; - if (indexes[new_hint] <= key) + } + if (indexes[new_hint] <= key) { return new_hint; + } // The searched element is in (hint,new_hint) and both indexes point // to valid elements. break; } - else + else { new_hint = hint + offset; + } PPL_ASSERT(new_hint > 0); PPL_ASSERT(new_hint <= reserved_size); // Find the element at `new_hint' (or the first after it). - while (indexes[new_hint] == unused_index) + while (indexes[new_hint] == unused_index) { --new_hint; + } PPL_ASSERT(hint <= new_hint); - if (indexes[new_hint] == key) + if (indexes[new_hint] == key) { return new_hint; - else - if (indexes[new_hint] > key) + } + else { + if (indexes[new_hint] > key) { // The searched element is in (hint,new_hint). break; - + } + } hint = new_hint; offset *= 2; } @@ -340,15 +376,19 @@ PPL_ASSERT(indexes[new_hint] != unused_index); ++hint; - while (indexes[hint] == unused_index) + while (indexes[hint] == unused_index) { ++hint; + } - if (hint == new_hint) + if (hint == new_hint) { return hint; + } --new_hint; - while (indexes[new_hint] == unused_index) + + while (indexes[new_hint] == unused_index) { --new_hint; + } PPL_ASSERT(hint <= new_hint); PPL_ASSERT(indexes[hint] != unused_index); @@ -382,9 +422,9 @@ const bool invalidating = (data <= &data1) && (&data1 < data + (reserved_size + 1)); - if (!invalidating) + if (!invalidating) { return insert_precise_aux(key1, data1, itr); - + } // `data1' could be invalidated by the insert, because it is // a coefficient of this row. Avoid the issue by copying it. data_type data1_copy = data1; @@ -437,13 +477,15 @@ ++size_; if (!itr.is_leaf()) { - if (key1 < itr.index()) + if (key1 < itr.index()) { itr.get_left_child(); - else + } + else { itr.get_right_child(); + } PPL_ASSERT(itr.index() == unused_index); - new (&(*itr)) data_type(data1); + new(&(*itr)) data_type(data1); // Set the index only if the construction was successful. itr.index() = key1; } @@ -486,11 +528,12 @@ } #ifndef NDEBUG - if (size_ > 1) + if (size_ > 1) { PPL_ASSERT(!is_less_than_ratio(size_ - 1, reserved_size, min_density_percent) || is_greater_than_ratio(size_ - 1, reserved_size/2, max_density_percent)); + } #endif const dimension_type deleted_key = itr.index(); @@ -499,19 +542,22 @@ while (true) { dimension_type& current_key = itr.index(); data_type& current_data = *itr; - if (itr.is_leaf()) + if (itr.is_leaf()) { break; + } itr.get_left_child(); - if (itr.index() != unused_index) + if (itr.index() != unused_index) { // The left child has a value. itr.follow_right_children_with_value(); + } else { // The left child has not a value, try the right child. itr.get_parent(); itr.get_right_child(); - if (itr.index() != unused_index) + if (itr.index() != unused_index) { // The right child has a value. itr.follow_left_children_with_value(); + } else { // The right child has not a value, too. itr.get_parent(); @@ -531,16 +577,18 @@ itr = rebalance(itr, 0, Coefficient_zero()); - if (itr.get_offset() < deleted_node.get_offset()) + if (itr.get_offset() < deleted_node.get_offset()) { // deleted_node is an ancestor of itr itr = deleted_node; + } itr.go_down_searching_key(deleted_key); iterator result(itr); - if (result.index() < deleted_key) + if (result.index() < deleted_key) { ++result; + } PPL_ASSERT(OK()); PPL_ASSERT(result == end() || result.index() > deleted_key); @@ -583,8 +631,9 @@ reserved_size = new_reserved_size; // Mark all pairs as unused. - for (dimension_type i = 1; i <= reserved_size; ++i) + for (dimension_type i = 1; i <= reserved_size; ++i) { indexes[i] = unused_index; + } // These are used as markers by iterators. indexes[0] = 0; @@ -601,8 +650,9 @@ if (reserved_size != 0) { for (dimension_type i = 1; i <= reserved_size; ++i) { - if (indexes[i] != unused_index) + if (indexes[i] != unused_index) { data[i].~data_type(); + } } delete[] indexes; @@ -613,42 +663,51 @@ bool PPL::CO_Tree::structure_OK() const { - if (size_ > reserved_size) + if (size_ > reserved_size) { return false; + } if (reserved_size == 0) { - if (indexes != NULL) + if (indexes != NULL) { return false; - if (data != NULL) + } + if (data != NULL) { return false; - if (max_depth != 0) + } + if (max_depth != 0) { return false; + } return true; } - if (reserved_size < 3) + if (reserved_size < 3) { return false; - - if (reserved_size != (static_cast(1) << max_depth) - 1) + } + if (reserved_size != (static_cast(1) << max_depth) - 1) { return false; + } - if (data == NULL) + if (data == NULL) { return false; + } - if (indexes == NULL) + if (indexes == NULL) { return false; + } - if (max_depth == 0) + if (max_depth == 0) { return false; + } if (size_ == 0) { // This const_cast could be removed by adding a const_tree_iterator, // but it would add much code duplication without a real need. tree_iterator itr(*const_cast(this)); - if (itr.index() != unused_index) + if (itr.index() != unused_index) { return false; + } } else { @@ -656,10 +715,11 @@ // but it would add much code duplication without a real need. tree_iterator itr(*const_cast(this)); const dimension_type real_size = count_used_in_subtree(itr); - if (real_size != size_) + if (real_size != size_) { // There are \p real_size elements in the tree that are reachable by the // root, but size is \p size. return false; + } } if (size_ != 0) { @@ -669,18 +729,21 @@ if (itr != itr_end) { dimension_type last_index = itr.index(); for (++itr; itr != itr_end; ++itr) { - if (last_index >= itr.index()) + if (last_index >= itr.index()) { // Found index \p itr->first after index \p last_index. return false; + } last_index = itr.index(); } } } - if (const_iterator(cached_end) != const_iterator(*this, reserved_size + 1)) + if (const_iterator(cached_end) != const_iterator(*this, reserved_size + 1)) { return false; - if (cached_const_end != const_iterator(*this, reserved_size + 1)) + } + if (cached_const_end != const_iterator(*this, reserved_size + 1)) { return false; + } return true; } @@ -688,29 +751,33 @@ bool PPL::CO_Tree::OK() const { - if (!structure_OK()) + if (!structure_OK()) { return false; - + } { dimension_type real_size = 0; - for (const_iterator itr = begin(), itr_end = end(); itr != itr_end; ++itr) + for (const_iterator itr = begin(), itr_end = end(); itr != itr_end; ++itr) { ++real_size; + } - if (real_size != size_) + if (real_size != size_) { // There are \p real_size elements in the tree, but size is \p size. return false; + } } if (reserved_size > 0) { if (is_greater_than_ratio(size_, reserved_size, max_density_percent) - && reserved_size != 3) + && reserved_size != 3) { // Found too high density. return false; + } if (is_less_than_ratio(size_, reserved_size, min_density_percent) - && !is_greater_than_ratio(size_, reserved_size/2, max_density_percent)) + && !is_greater_than_ratio(size_, reserved_size/2, max_density_percent)) { // Found too low density return false; + } } return true; @@ -735,10 +802,12 @@ itr.get_parent(); } std::cout << "At depth: " << itr.depth(); - if (itr.index() == unused_index) + if (itr.index() == unused_index) { std::cout << " (no data)" << std::endl; - else + } + else { std::cout << " pair (" << itr.index() << "," << *itr << ")" << std::endl; + } if (!itr.is_leaf()) { itr.get_right_child(); dump_subtree(itr); @@ -771,8 +840,9 @@ for (dimension_type i = 1, j = 2; i <= reserved_size; ++i, ++j) { new_indexes[j] = indexes[i]; - if (indexes[i] != unused_index) + if (indexes[i] != unused_index) { move_data_element(new_data[j], data[i]); + } ++j; new_indexes[j] = unused_index; } @@ -813,11 +883,13 @@ << height) - 1; const bool deleting = itr.index() == unused_index; PPL_ASSERT(deleting || key != unused_index); - if (deleting) + if (deleting) { subtree_size = 0; - else + } + else { // The existing element and the element with index key we want to add. subtree_size = 2; + } while (is_greater_than_ratio(subtree_size, subtree_reserved_size, max_density_percent @@ -835,10 +907,12 @@ PPL_ASSERT(itr_depth_minus_1 != 0); const bool is_right_brother = itr.is_right_child(); itr.get_parent(); - if (is_right_brother) + if (is_right_brother) { itr.get_left_child(); - else + } + else { itr.get_right_child(); + } subtree_size += count_used_in_subtree(itr); itr.get_parent(); PPL_ASSERT(itr.index() != unused_index); @@ -899,7 +973,7 @@ // rightmost node with a value in the subtree. first_unused_index and // first_unused_data point to the rightmost unused node in the subtree. - if (add_element) + if (add_element) { while (subtree_size != 0) { --subtree_size; if (last_index_in_subtree == indexes || key > *last_index_in_subtree) { @@ -907,7 +981,7 @@ || last_index_in_subtree != first_unused_index) { PPL_ASSERT(first_unused_index != indexes); PPL_ASSERT(*first_unused_index == unused_index); - new (first_unused_data) data_type(value); + new(first_unused_data) data_type(value); // Set the index only if the construction was successful. *first_unused_index = key; --first_unused_index; @@ -934,6 +1008,7 @@ --first_unused_data; } } + } while (subtree_size != 0) { if (last_index_in_subtree != first_unused_index) { PPL_ASSERT(first_unused_index != indexes); @@ -954,7 +1029,7 @@ --subtree_size; } - const ptrdiff_t distance = first_unused_index - indexes; + const std::ptrdiff_t distance = first_unused_index - indexes; PPL_ASSERT(distance >= 0); return static_cast(distance); } @@ -1008,7 +1083,7 @@ PPL_ASSERT(last_used != top_i); PPL_ASSERT(indexes[top_i] == unused_index); add_element = false; - new (&(data[top_i])) data_type(value); + new(&(data[top_i])) data_type(value); // Set the index only if the construction was successful. indexes[top_i] = key; } @@ -1057,14 +1132,16 @@ void PPL::CO_Tree::move_data_from(CO_Tree& tree) { PPL_ASSERT(size_ == 0); - if (tree.size_ == 0) + if (tree.size_ == 0) { return; + } tree_iterator root(*this); dimension_type source_index = 1; - while (tree.indexes[source_index] == unused_index) + while (tree.indexes[source_index] == unused_index) { ++source_index; + } // This is static and with static allocation, to improve performance. // sizeof_to_bits(sizeof(dimension_type)) is the maximum k such that 2^k-1 is a @@ -1141,8 +1218,9 @@ move_data_element(*root, tree.data[source_index]); PPL_ASSERT(source_index <= tree.reserved_size); ++source_index; - while (tree.indexes[source_index] == unused_index) + while (tree.indexes[source_index] == unused_index) { ++source_index; + } --stack_first_empty; } else { @@ -1177,14 +1255,15 @@ dimension_type i; try { - for (i = x.reserved_size; i > 0; --i) + for (i = x.reserved_size; i > 0; --i) { if (x.indexes[i] != unused_index) { indexes[i] = x.indexes[i]; - new (&(data[i])) data_type(x.data[i]); + new(&(data[i])) data_type(x.data[i]); } else { PPL_ASSERT(indexes[i] == unused_index); } + } } catch (...) { // The (used) data elements in (i,x.reserved_size] have been constructed // successfully. @@ -1192,9 +1271,11 @@ // been constructed. // 1. Destroy the data elements that have been constructed successfully. - for (dimension_type j = x.reserved_size; j > i; --j) - if (indexes[j] != unused_index) + for (dimension_type j = x.reserved_size; j > i; --j) { + if (indexes[j] != unused_index) { data[j].~data_type(); + } + } // 2. Deallocate index[] and data[] delete[] indexes; @@ -1223,9 +1304,11 @@ const dimension_type* current_index = &(itr.tree.indexes[root_index - (k - 1)]); - for (dimension_type j = 2*k - 1; j > 0; --j, ++current_index) - if (*current_index != unused_index) + for (dimension_type j = 2*k - 1; j > 0; --j, ++current_index) { + if (*current_index != unused_index) { ++n; + } + } return n; } @@ -1234,30 +1317,39 @@ PPL::CO_Tree::const_iterator::OK() const { #if PPL_CO_TREE_EXTRA_DEBUG if (tree == 0) { - if (current_index != 0) + if (current_index != 0) { return false; - if (current_data != 0) + } + if (current_data != 0) { return false; + } } else if (tree->reserved_size == 0) { if (current_index != 1 + static_cast(0) - || current_data != 1 + static_cast(0)) + || current_data != 1 + static_cast(0)) { return false; + } } else { - if (current_index <= &(tree->indexes[0])) + if (current_index <= &(tree->indexes[0])) { return false; - if (current_index > &(tree->indexes[tree->reserved_size + 1])) + } + if (current_index > &(tree->indexes[tree->reserved_size + 1])) { return false; - if (current_data <= &(tree->data[0])) + } + if (current_data <= &(tree->data[0])) { return false; - if (current_data > &(tree->data[tree->reserved_size + 1])) + } + if (current_data > &(tree->data[tree->reserved_size + 1])) { return false; - if (*current_index == unused_index) + } + if (*current_index == unused_index) { return false; - if (current_index - tree->indexes != current_data - tree->data) + } + if (current_index - tree->indexes != current_data - tree->data) { return false; + } } #endif return true; @@ -1267,30 +1359,39 @@ PPL::CO_Tree::iterator::OK() const { #if PPL_CO_TREE_EXTRA_DEBUG if (tree == 0) { - if (current_index != 0) + if (current_index != 0) { return false; - if (current_data != 0) + } + if (current_data != 0) { return false; + } } else if (tree->reserved_size == 0) { if (current_index != 1 + static_cast(0) - || current_data != 1 + static_cast(0)) + || current_data != 1 + static_cast(0)) { return false; + } } else { - if (current_index <= &(tree->indexes[0])) + if (current_index <= &(tree->indexes[0])) { return false; - if (current_index > &(tree->indexes[tree->reserved_size + 1])) + } + if (current_index > &(tree->indexes[tree->reserved_size + 1])) { return false; - if (current_data <= &(tree->data[0])) + } + if (current_data <= &(tree->data[0])) { return false; - if (current_data > &(tree->data[tree->reserved_size + 1])) + } + if (current_data > &(tree->data[tree->reserved_size + 1])) { return false; - if (*current_index == unused_index) + } + if (*current_index == unused_index) { return false; - if (current_index - tree->indexes != current_data - tree->data) + } + if (current_index - tree->indexes != current_data - tree->data) { return false; + } } #endif return true; @@ -1298,14 +1399,16 @@ bool PPL::CO_Tree::tree_iterator::OK() const { - if (i == 0 || i > tree.reserved_size) + if (i == 0 || i > tree.reserved_size) { return false; + } // This assumes two's complement encoding. const dimension_type correct_offset = i & -i; - if (offset != correct_offset) + if (offset != correct_offset) { return false; + } return true; } @@ -1317,8 +1420,9 @@ PPL_ASSERT(key != unused_index); PPL_ASSERT(index() != unused_index); while (!is_leaf()) { - if (key == index()) + if (key == index()) { break; + } if (key < index()) { get_left_child(); if (index() == unused_index) { diff -Nru ppl-1.1/src/CO_Tree_defs.hh ppl-1.2/src/CO_Tree_defs.hh --- ppl-1.1/src/CO_Tree_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/CO_Tree_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* CO_Tree class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,6 +28,7 @@ #include "Coefficient_defs.hh" #include +#include #ifndef PPL_CO_TREE_EXTRA_DEBUG #ifdef PPL_ABI_BREAKING_EXTRA_DEBUG @@ -159,7 +160,7 @@ typedef std::bidirectional_iterator_tag iterator_category; typedef const data_type value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef data_type_const_reference reference; @@ -314,7 +315,7 @@ typedef std::bidirectional_iterator_tag iterator_category; typedef data_type value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef value_type& reference; diff -Nru ppl-1.1/src/CO_Tree_inlines.hh ppl-1.2/src/CO_Tree_inlines.hh --- ppl-1.1/src/CO_Tree_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/CO_Tree_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* CO_Tree class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,6 +24,8 @@ #ifndef PPL_CO_Tree_inlines_hh #define PPL_CO_Tree_inlines_hh 1 +#include + namespace Parma_Polyhedra_Library { inline dimension_type @@ -31,7 +33,7 @@ PPL_ASSERT(itr.current_index != 0); PPL_ASSERT(itr.current_index >= indexes + 1); PPL_ASSERT(itr.current_index <= indexes + reserved_size); - const ptrdiff_t index = itr.current_index - indexes; + const std::ptrdiff_t index = itr.current_index - indexes; return static_cast(index); } @@ -40,7 +42,7 @@ PPL_ASSERT(itr.current_index != 0); PPL_ASSERT(itr.current_index >= indexes + 1); PPL_ASSERT(itr.current_index <= indexes + reserved_size); - const ptrdiff_t index = itr.current_index - indexes; + const std::ptrdiff_t index = itr.current_index - indexes; return static_cast(index); } @@ -97,23 +99,28 @@ inline void CO_Tree::dump_tree() const { - if (empty()) + if (empty()) { std::cout << "(empty tree)" << std::endl; - else + } + else { dump_subtree(tree_iterator(*const_cast(this))); + } } inline CO_Tree::iterator CO_Tree::insert(const dimension_type key) { - if (empty()) + if (empty()) { return insert(key, Coefficient_zero()); + } else { tree_iterator itr(*this); itr.go_down_searching_key(key); - if (itr.index() == key) + if (itr.index() == key) { return iterator(itr); - else + } + else { return iterator(insert_precise(key, Coefficient_zero(), itr)); + } } } @@ -136,18 +143,21 @@ CO_Tree::erase(dimension_type key) { PPL_ASSERT(key != unused_index); - if (empty()) + if (empty()) { return end(); + } tree_iterator itr(*this); itr.go_down_searching_key(key); - if (itr.index() == key) + if (itr.index() == key) { return erase(itr); + } iterator result(itr); - if (result.index() < key) + if (result.index() < key) { ++result; + } PPL_ASSERT(result == end() || result.index() > key); #ifndef NDEBUG @@ -214,8 +224,9 @@ inline CO_Tree::iterator CO_Tree::bisect(dimension_type key) { - if (empty()) + if (empty()) { return end(); + } iterator last = end(); --last; return bisect_in(begin(), last, key); @@ -223,8 +234,9 @@ inline CO_Tree::const_iterator CO_Tree::bisect(dimension_type key) const { - if (empty()) + if (empty()) { return end(); + } const_iterator last = end(); --last; return bisect_in(begin(), last, key); @@ -251,8 +263,9 @@ inline CO_Tree::iterator CO_Tree::bisect_near(iterator hint, dimension_type key) { - if (hint == end()) + if (hint == end()) { return bisect(key); + } const dimension_type index = bisect_near(dfs_index(hint), key); return iterator(*this, index); @@ -260,8 +273,9 @@ inline CO_Tree::const_iterator CO_Tree::bisect_near(const_iterator hint, dimension_type key) const { - if (hint == end()) + if (hint == end()) { return bisect(key); + } const dimension_type index = bisect_near(dfs_index(hint), key); return const_iterator(*this, index); } @@ -281,7 +295,7 @@ rebuild_bigger_tree(); tree_iterator itr(*this); PPL_ASSERT(itr.index() == unused_index); - new (&(*itr)) data_type(data1); + new(&(*itr)) data_type(data1); // Set the index afterwards, so that if the constructor above throws // the tree's structure is consistent. itr.index() = key; @@ -329,12 +343,14 @@ inline void CO_Tree::move_data_element(data_type& to, data_type& from) { - // The following code is equivalent (but slower): - // - // - // new (&to) data_type(from); - // from.~data_type(); - // + /* + The following code is equivalent (but slower): + + + new(&to) data_type(from); + from.~data_type(); + + */ std::memcpy(&to, &from, sizeof(data_type)); } @@ -354,11 +370,12 @@ #if PPL_CO_TREE_EXTRA_DEBUG tree = &tree1; #endif - if (!tree1.empty()) + if (!tree1.empty()) { while (*current_index == unused_index) { ++current_index; ++current_data; } + } PPL_ASSERT(OK()); } @@ -517,11 +534,12 @@ #if PPL_CO_TREE_EXTRA_DEBUG tree = &tree1; #endif - if (!tree1.empty()) + if (!tree1.empty()) { while (*current_index == unused_index) { ++current_index; ++current_data; } + } PPL_ASSERT(OK()); } @@ -770,9 +788,10 @@ const dimension_type* p = tree.indexes; p += i; p -= (offset - 1); - while (*p == unused_index) + while (*p == unused_index) { ++p; - const ptrdiff_t distance = p - tree.indexes; + } + const std::ptrdiff_t distance = p - tree.indexes; PPL_ASSERT(distance >= 0); i = static_cast(distance); offset = least_significant_one_mask(i); @@ -785,9 +804,10 @@ const dimension_type* p = tree.indexes; p += i; p += (offset - 1); - while (*p == unused_index) + while (*p == unused_index) { --p; - const ptrdiff_t distance = p - tree.indexes; + } + const std::ptrdiff_t distance = p - tree.indexes; PPL_ASSERT(distance >= 0); i = static_cast(distance); offset = least_significant_one_mask(i); @@ -803,8 +823,9 @@ inline bool CO_Tree::tree_iterator::is_right_child() const { - if (is_root()) + if (is_root()) { return false; + } return (i & (2*offset)) != 0; } diff -Nru ppl-1.1/src/CO_Tree_templates.hh ppl-1.2/src/CO_Tree_templates.hh --- ppl-1.1/src/CO_Tree_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/CO_Tree_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* CO_Tree class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -39,8 +39,9 @@ reserved_size = (static_cast(1) << new_max_depth) - 1; if (is_greater_than_ratio(n, reserved_size, max_density_percent) - && reserved_size != 3) + && reserved_size != 3) { reserved_size = reserved_size*2 + 1; + } init(reserved_size); @@ -115,7 +116,7 @@ if (top_n == 1) { PPL_ASSERT(root.index() == unused_index); root.index() = i.index(); - new (&(*root)) data_type(*i); + new(&(*root)) data_type(*i); ++i; --stack_first_empty; } diff -Nru ppl-1.1/src/CO_Tree_types.hh ppl-1.2/src/CO_Tree_types.hh --- ppl-1.1/src/CO_Tree_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/CO_Tree_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/C_Polyhedron.cc ppl-1.2/src/C_Polyhedron.cc --- ppl-1.1/src/C_Polyhedron.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/C_Polyhedron.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* C_Polyhedron class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -39,8 +39,9 @@ const Linear_Expression expr(c.expression()); add_constraint(expr >= 0); } - else + else { add_constraint(c); + } } PPL_ASSERT_HEAVY(OK()); } @@ -84,8 +85,9 @@ bool PPL::C_Polyhedron::poly_hull_assign_if_exact(const C_Polyhedron& y) { // Dimension-compatibility check. - if (space_dimension() != y.space_dimension()) + if (space_dimension() != y.space_dimension()) { throw_dimension_incompatible("poly_hull_assign_if_exact(y)", "y", y); + } #define USE_BHZ09 0 #define USE_BFT00 1 #if USE_BHZ09 // [BagnaraHZ09] diff -Nru ppl-1.1/src/C_Polyhedron_defs.hh ppl-1.2/src/C_Polyhedron_defs.hh --- ppl-1.1/src/C_Polyhedron_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/C_Polyhedron_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* C_Polyhedron class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/C_Polyhedron_inlines.hh ppl-1.2/src/C_Polyhedron_inlines.hh --- ppl-1.1/src/C_Polyhedron_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/C_Polyhedron_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* C_Polyhedron class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/C_Polyhedron_types.hh ppl-1.2/src/C_Polyhedron_types.hh --- ppl-1.1/src/C_Polyhedron_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/C_Polyhedron_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/CREDITS.cc.dist ppl-1.2/src/CREDITS.cc.dist --- ppl-1.1/src/CREDITS.cc.dist 2013-10-28 12:47:20.000000000 +0000 +++ ppl-1.2/src/CREDITS.cc.dist 2016-02-11 12:40:41.000000000 +0000 @@ -1,4 +1,5 @@ -extern const char* const CREDITS_array[444] = { +#include "CREDITS.hh" +extern const char* const CREDITS_array[446] = { "", "Authors", "=======", @@ -13,8 +14,8 @@ "", " Roberto Bagnara [1] (BUGSENG srl and University of Parma)", " Patricia M. Hill [2] (BUGSENG srl and University of Leeds)", - " Enea Zaffanella [3] (BUGSENG srl and University of Parma)", " Abramo Bagnara (BUGSENG srl)", + " Enea Zaffanella [3] (University of Parma)", "", "", "Former Members of the Core Development Team:", @@ -30,29 +31,6 @@ "Current Contributors:", "---------------------", "", - " Massimo Benerecetti (University of Naples) is working on additional", - " operators on polyhedra.", - "", - " Andrea Cimino (former student of the University of Parma)", - " wrote most of the mixed integer programming", - " solver, and also most of the Java and OCaml", - " interfaces. He keeps helping us, especially", - " with the web site.", - "", - " Marco Faella (University of Naples) is working on additional", - " operators on polyhedra.", - "", - " Stefano Minopoli (University of Naples) is working on additional", - " operators on polyhedra.", - "", - " Marco Poletti (student of the University of Bologna)", - " implemented the sparse matrices that are used", - " in the MIP and PIP solvers of the PPL; he also", - " did experiments on the parallelization of the", - " sparse matrices' computations; he is now working", - " on improving the PPL's memory footprint and", - " on other improvements to the library.", - "", " Alessandro Zaccagnini [4] (University of Parma) has helped with", " the efficient implementation of GCD and LCM", " for checked numbers. He is now working on the", @@ -60,6 +38,9 @@ " Alessandro is always a very valuable source of", " mathematical advice.", "", + " Paulo Cesar Pereira de Andrade", + " Helps with Fedora packaging.", + "", "", "Past Contributors:", "------------------", @@ -74,6 +55,9 @@ " whether or not the set-union of two polyhedra", " is the same as their poly-hull.", "", + " Massimo Benerecetti (University of Naples) worked on the positive", + " time-elapse operator on polyhedra.", + "", " Fabio Biselli (student of the University of Parma)", " did some work on the PPL support for the", " approximation of floating point computations.", @@ -94,11 +78,19 @@ " one of the four students with which the PPL", " project started.", "", + " Andrea Cimino (former student of the University of Parma)", + " wrote most of the mixed integer programming", + " solver, and also most of the Java and OCaml", + " interfaces. He helped us a lot with the web site.", + "", " Katy Dobson (former student of the University of Leeds)", " worked on the formalization and definition of", " algorithms for rational grids and products", " of grids and polyhedra.", "", + " Marco Faella (University of Naples) worked on the positive", + " time-elapse operator on polyhedra.", + "", " Giordano Fracasso (former student of the University of Parma) wrote", " the initial version of the support for native", " and checked integer coefficients.", @@ -122,6 +114,9 @@ " with the generation of the library's documentation", " using Doxygen.", "", + " Stefano Minopoli (University of Naples) worked on the positive", + " time-elapse operator on polyhedra.", + "", " Matthew Mundell [6] (formerly at the University of Leeds) worked", " on the implementation of rational grids. He has", " also helped on other implementation issues.", @@ -131,6 +126,14 @@ " project started. Later, he helped a little", " with the library's documentation.", "", + " Marco Poletti (former student of the University of Bologna)", + " implemented the sparse matrices that are used", + " in the MIP and PIP solvers of the PPL; he also", + " did experiments on the parallelization of the", + " sparse matrices' computations; he also worked", + " on improving the PPL's memory footprint and", + " on other improvements to the library.", + "", " Barbara Quartieri (former student of the University of Parma) worked", " on our implementation of bounded differences and", " octagons.", diff -Nru ppl-1.1/src/CREDITS.hh.dist ppl-1.2/src/CREDITS.hh.dist --- ppl-1.1/src/CREDITS.hh.dist 2013-10-28 12:47:20.000000000 +0000 +++ ppl-1.2/src/CREDITS.hh.dist 2016-02-11 12:40:41.000000000 +0000 @@ -1,4 +1,4 @@ #ifndef PPL_CREDITS_hh #define PPL_CREDITS_hh 1 -extern const char* const CREDITS_array[444]; +extern const char* const CREDITS_array[446]; #endif // !defined(PPL_CREDITS_hh) diff -Nru ppl-1.1/src/c_streambuf.cc ppl-1.2/src/c_streambuf.cc --- ppl-1.1/src/c_streambuf.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/c_streambuf.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* c_streambuf class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,10 +24,13 @@ #include "ppl-config.h" #include "c_streambuf_defs.hh" #include "globals_defs.hh" -#include "assert.hh" +#include "assertions.hh" namespace Parma_Polyhedra_Library { +c_streambuf::~c_streambuf() { +} + c_streambuf::int_type c_streambuf::uflow() { const int_type c = underflow(); @@ -40,10 +43,12 @@ const int_type eof = traits_type::eof(); if (traits_type::eq_int_type(next_char_buf, eof)) { char buf; - if (cb_read(&buf, 1) == 1) + if (cb_read(&buf, 1) == 1) { next_char_buf = buf; - else + } + else { next_char_buf = eof; + } } return next_char_buf; } @@ -51,22 +56,26 @@ std::streamsize c_streambuf::xsgetn(char_type* s, std::streamsize n) { PPL_ASSERT(n >= 0); - if (n == 0) + if (n == 0) { return n; + } const int_type eof = traits_type::eof(); const size_t sz_n = static_cast(n); size_t a; - if (traits_type::eq_int_type(next_char_buf, eof)) + if (traits_type::eq_int_type(next_char_buf, eof)) { a = 0; + } else { s[0] = static_cast(next_char_buf); a = 1; } const size_t r = cb_read(s + a, sz_n - a) + a; - if (r > 0) + if (r > 0) { unget_char_buf = traits_type::to_int_type(s[r - 1]); - else + } + else { unget_char_buf = traits_type::eof(); + } return static_cast(r); } @@ -88,14 +97,17 @@ c_streambuf::int_type c_streambuf::overflow(int_type c) { const int_type eof = traits_type::eof(); - if (traits_type::eq_int_type(c, eof)) + if (traits_type::eq_int_type(c, eof)) { return (sync() != 0) ? eof : traits_type::not_eof(c); + } else { char buf = static_cast(c); - if (cb_write(&buf, 1) == 1) + if (cb_write(&buf, 1) == 1) { return c; - else + } + else { return eof; + } } } diff -Nru ppl-1.1/src/c_streambuf_defs.hh ppl-1.2/src/c_streambuf_defs.hh --- ppl-1.1/src/c_streambuf_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/c_streambuf_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* c_streambuf class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/c_streambuf_inlines.hh ppl-1.2/src/c_streambuf_inlines.hh --- ppl-1.1/src/c_streambuf_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/c_streambuf_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* c_streambuf class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -31,10 +31,6 @@ : unget_char_buf(traits_type::eof()), next_char_buf(traits_type::eof()) { } -inline -c_streambuf::~c_streambuf() { -} - } // namespace Parma_Polyhedra_Library #endif // !defined(PPL_c_streambuf_inlines_hh) diff -Nru ppl-1.1/src/c_streambuf_types.hh ppl-1.2/src/c_streambuf_types.hh --- ppl-1.1/src/c_streambuf_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/c_streambuf_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/DB_Matrix_defs.hh ppl-1.2/src/DB_Matrix_defs.hh --- ppl-1.1/src/DB_Matrix_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/DB_Matrix_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* DB_Matrix class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/DB_Matrix_inlines.hh ppl-1.2/src/DB_Matrix_inlines.hh --- ppl-1.1/src/DB_Matrix_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/DB_Matrix_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* DB_Matrix class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,7 @@ #include "globals_defs.hh" #include "Checked_Number_defs.hh" #include "distances_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace Parma_Polyhedra_Library { @@ -214,8 +214,9 @@ Temp& tmp1, Temp& tmp2) { const dimension_type x_num_rows = x.num_rows(); - if (x_num_rows != y.num_rows()) + if (x_num_rows != y.num_rows()) { return false; + } assign_r(tmp0, 0, ROUND_NOT_NEEDED); for (dimension_type i = x_num_rows; i-- > 0; ) { const DB_Row& x_i = x[i]; @@ -224,17 +225,18 @@ const T& x_i_j = x_i[j]; const T& y_i_j = y_i[j]; if (is_plus_infinity(x_i_j)) { - if (is_plus_infinity(y_i_j)) + if (is_plus_infinity(y_i_j)) { continue; + } else { pinf: assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); return true; } } - else if (is_plus_infinity(y_i_j)) + else if (is_plus_infinity(y_i_j)) { goto pinf; - + } const Temp* tmp1p; const Temp* tmp2p; if (x_i_j > y_i_j) { diff -Nru ppl-1.1/src/DB_Matrix_templates.hh ppl-1.2/src/DB_Matrix_templates.hh --- ppl-1.1/src/DB_Matrix_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/DB_Matrix_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* DB_Matrix class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -32,8 +32,9 @@ row_size(n_rows), row_capacity(compute_capacity(n_rows, max_num_columns())) { // Construct in direct order: will destroy in reverse order. - for (dimension_type i = 0; i < n_rows; ++i) + for (dimension_type i = 0; i < n_rows; ++i) { rows[i].construct(n_rows, row_capacity); + } PPL_ASSERT(OK()); } @@ -44,8 +45,9 @@ row_size(y.row_size), row_capacity(compute_capacity(y.row_size, max_num_columns())) { // Construct in direct order: will destroy in reverse order. - for (dimension_type i = 0, n_rows = rows.size(); i < n_rows; ++i) + for (dimension_type i = 0, n_rows = rows.size(); i < n_rows; ++i) { rows[i].construct_upward_approximation(y[i], row_capacity); + } PPL_ASSERT(OK()); } @@ -65,12 +67,14 @@ new_rows.insert(new_rows.end(), new_n_rows, DB_Row()); // Construct the new rows. dimension_type i = new_n_rows; - while (i-- > old_n_rows) + while (i-- > old_n_rows) { new_rows[i].construct(new_n_rows, row_capacity); + } // Steal the old rows. ++i; - while (i-- > 0) + while (i-- > 0) { swap(new_rows[i], rows[i]); + } // Put the new vector into place. using std::swap; swap(rows, new_rows); @@ -78,8 +82,9 @@ else { // Reallocation will NOT take place. rows.insert(rows.end(), new_n_rows - old_n_rows, DB_Row()); - for (dimension_type i = new_n_rows; i-- > old_n_rows; ) + for (dimension_type i = new_n_rows; i-- > old_n_rows; ) { rows[i].construct(new_n_rows, row_capacity); + } } } else { @@ -92,9 +97,10 @@ new_matrix.row_capacity = compute_capacity(new_n_rows, max_num_columns()); dimension_type i = new_n_rows; - while (i-- > old_n_rows) + while (i-- > old_n_rows) { new_matrix.rows[i].construct(new_matrix.row_size, new_matrix.row_capacity); + } // Copy the old rows. ++i; while (i-- > 0) { @@ -112,10 +118,12 @@ // Here we have the right number of rows. if (new_n_rows > row_size) { // We need more columns. - if (new_n_rows <= row_capacity) + if (new_n_rows <= row_capacity) { // But we have enough capacity: we resize existing rows. - for (dimension_type i = old_n_rows; i-- > 0; ) + for (dimension_type i = old_n_rows; i-- > 0; ) { rows[i].expand_within_capacity(new_n_rows); + } + } else { // Capacity exhausted: we must reallocate the rows and // make sure all the rows have the same capacity. @@ -150,12 +158,14 @@ // Construct the new rows (be careful: each new row must have // the same capacity as each one of the old rows). dimension_type i = new_n_rows; - while (i-- > old_n_rows) + while (i-- > old_n_rows) { new_rows[i].construct(new_n_rows, row_capacity); // Steal the old rows. + } ++i; - while (i-- > 0) + while (i-- > 0) { swap(new_rows[i], rows[i]); + } // Put the new vector into place. using std::swap; swap(rows, new_rows); @@ -165,8 +175,9 @@ rows.insert(rows.end(), new_n_rows - old_n_rows, DB_Row()); // Be careful: each new row must have // the same capacity as each one of the old rows. - for (dimension_type i = new_n_rows; i-- > old_n_rows; ) + for (dimension_type i = new_n_rows; i-- > old_n_rows; ) { rows[i].construct(new_n_rows, row_capacity); + } } } else { @@ -180,17 +191,20 @@ // Drop some rows. rows.resize(new_n_rows); // Shrink the existing rows. - for (dimension_type i = new_n_rows; i-- > 0; ) + for (dimension_type i = new_n_rows; i-- > 0; ) { rows[i].shrink(new_n_rows); + } old_n_rows = new_n_rows; } // Here we have the right number of rows. if (new_n_rows > row_size) { // We need more columns. - if (new_n_rows <= row_capacity) + if (new_n_rows <= row_capacity) { // But we have enough capacity: we resize existing rows. - for (dimension_type i = old_n_rows; i-- > 0; ) + for (dimension_type i = old_n_rows; i-- > 0; ) { rows[i].expand_within_capacity(new_n_rows); + } + } else { // Capacity exhausted: we must reallocate the rows and // make sure all the rows have the same capacity. @@ -229,16 +243,19 @@ bool DB_Matrix::ascii_load(std::istream& s) { dimension_type nrows; - if (!(s >> nrows)) + if (!(s >> nrows)) { return false; + } resize_no_copy(nrows); DB_Matrix& x = *this; - for (dimension_type i = 0; i < nrows; ++i) + for (dimension_type i = 0; i < nrows; ++i) { for (dimension_type j = 0; j < nrows; ++j) { Result r = input(x[i][j], s, ROUND_CHECK); - if (result_relation(r) != VR_EQ || is_minus_infinity(x[i][j])) + if (result_relation(r) != VR_EQ || is_minus_infinity(x[i][j])) { return false; + } } + } // Check invariants. PPL_ASSERT(OK()); @@ -252,11 +269,14 @@ bool operator==(const DB_Matrix& x, const DB_Matrix& y) { const dimension_type x_num_rows = x.num_rows(); - if (x_num_rows != y.num_rows()) + if (x_num_rows != y.num_rows()) { return false; - for (dimension_type i = x_num_rows; i-- > 0; ) - if (x[i] != y[i]) + } + for (dimension_type i = x_num_rows; i-- > 0; ) { + if (x[i] != y[i]) { return false; + } + } return true; } @@ -264,8 +284,9 @@ memory_size_type DB_Matrix::external_memory_in_bytes() const { memory_size_type n = rows.capacity() * sizeof(DB_Row); - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { n += rows[i].external_memory_in_bytes(row_capacity); + } return n; } @@ -291,8 +312,9 @@ const DB_Matrix& x = *this; const dimension_type n_rows = x.num_rows(); for (dimension_type i = 0; i < n_rows; ++i) { - if (!x[i].OK(row_size, row_capacity)) + if (!x[i].OK(row_size, row_capacity)) { return false; + } } // All checks passed. @@ -307,8 +329,9 @@ IO_Operators::operator<<(std::ostream& s, const DB_Matrix& c) { const dimension_type n = c.num_rows(); for (dimension_type i = 0; i < n; ++i) { - for (dimension_type j = 0; j < n; ++j) + for (dimension_type j = 0; j < n; ++j) { s << c[i][j] << " "; + } s << "\n"; } return s; diff -Nru ppl-1.1/src/DB_Matrix_types.hh ppl-1.2/src/DB_Matrix_types.hh --- ppl-1.1/src/DB_Matrix_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/DB_Matrix_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/DB_Row_defs.hh ppl-1.2/src/DB_Row_defs.hh --- ppl-1.1/src/DB_Row_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/DB_Row_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* DB_Row class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/DB_Row_inlines.hh ppl-1.2/src/DB_Row_inlines.hh --- ppl-1.1/src/DB_Row_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/DB_Row_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* DB_Row class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,7 +25,7 @@ #define PPL_DB_Row_inlines_hh 1 #include "checked_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -179,11 +179,12 @@ DB_Row& x = *this; PPL_ASSERT(capacity <= max_size()); #if !PPL_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS - if (capacity == 0) + if (capacity == 0) { ++capacity; + } #endif PPL_ASSERT(x.impl == 0); - x.impl = new (capacity) typename DB_Row_Impl_Handler::Impl(); + x.impl = new(capacity) typename DB_Row_Impl_Handler::Impl(); #if PPL_DB_ROW_EXTRA_DEBUG PPL_ASSERT(x.capacity_ == 0); x.capacity_ = capacity; diff -Nru ppl-1.1/src/DB_Row_templates.hh ppl-1.2/src/DB_Row_templates.hh --- ppl-1.1/src/DB_Row_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/DB_Row_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* DB_Row class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -66,7 +66,7 @@ #endif // Construct in direct order: will destroy in reverse order. for (dimension_type i = size(); i < new_size; ++i) { - new (&vec_[i]) T(PLUS_INFINITY, ROUND_NOT_NEEDED); + new(&vec_[i]) T(PLUS_INFINITY, ROUND_NOT_NEEDED); bump_size(); } } @@ -80,13 +80,15 @@ set_size(new_size); #if !PPL_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS // Make sure we do not try to destroy vec_[0]. - if (new_size == 0) + if (new_size == 0) { ++new_size; + } #endif // We assume construction was done "forward". // We thus perform destruction "backward". - for (dimension_type i = old_size; i-- > new_size; ) + for (dimension_type i = old_size; i-- > new_size; ) { vec_[i].~T(); + } } template @@ -96,7 +98,7 @@ #if PPL_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS // Construct in direct order: will destroy in reverse order. for (dimension_type i = 0; i < y_size; ++i) { - new (&vec_[i]) T(y.vec_[i]); + new(&vec_[i]) T(y.vec_[i]); bump_size(); } #else // PPL_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS @@ -105,7 +107,7 @@ bump_size(); // Construct in direct order: will destroy in reverse order. for (dimension_type i = 1; i < y_size; ++i) { - new (&vec_[i]) T(y.vec_[i]); + new(&vec_[i]) T(y.vec_[i]); bump_size(); } } @@ -116,8 +118,9 @@ memory_size_type DB_Row_Impl_Handler::Impl::external_memory_in_bytes() const { memory_size_type n = 0; - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { n += Parma_Polyhedra_Library::external_memory_in_bytes(vec_[i]); + } return n; } @@ -202,11 +205,14 @@ template bool operator==(const DB_Row& x, const DB_Row& y) { - if (x.size() != y.size()) + if (x.size() != y.size()) { return false; - for (dimension_type i = x.size(); i-- > 0; ) - if (x[i] != y[i]) + } + for (dimension_type i = x.size(); i-- > 0; ) { + if (x[i] != y[i]) { return false; + } + } return true; } diff -Nru ppl-1.1/src/DB_Row_types.hh ppl-1.2/src/DB_Row_types.hh --- ppl-1.1/src/DB_Row_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/DB_Row_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Dense_Row.cc ppl-1.2/src/Dense_Row.cc --- ppl-1.1/src/Dense_Row.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Dense_Row.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Dense_Row class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,25 +24,28 @@ #include "ppl-config.h" #include "Dense_Row_defs.hh" #include "Coefficient_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include "Sparse_Row_defs.hh" #include #include namespace PPL = Parma_Polyhedra_Library; -PPL::Dense_Row::Dense_Row(const Sparse_Row& y, dimension_type sz, dimension_type capacity) { +PPL::Dense_Row::Dense_Row(const Sparse_Row& y, + dimension_type sz, dimension_type capacity) { resize(sz, capacity); for (Sparse_Row::const_iterator i = y.begin(), - i_end = y.lower_bound(sz); i != i_end; ++i) + i_end = y.lower_bound(std::min(y.size(), sz)); i != i_end; ++i) { (*this)[i.index()] = *i; + } PPL_ASSERT(OK()); } void PPL::Dense_Row::resize(dimension_type new_size) { - if (new_size <= size()) + if (new_size <= size()) { shrink(new_size); + } else { if (new_size > capacity()) { // Reallocation is required. @@ -62,7 +65,7 @@ PPL_ASSERT(new_size <= impl.capacity); // Construct the additional elements. while (impl.size != new_size) { - new (&impl.vec[impl.size]) Coefficient(); + new(&impl.vec[impl.size]) Coefficient(); ++impl.size; } } @@ -128,8 +131,9 @@ void PPL::Dense_Row::clear() { - for (iterator i = begin(), i_end = end(); i != i_end; ++i) + for (iterator i = begin(), i_end = end(); i != i_end; ++i) { *i = 0; + } } void @@ -147,8 +151,9 @@ try { // Construct coefficients with value 0 in // new_row.impl.vec[i ... i + n - 1] - for ( ; j < i + n; ++j) - new (&(new_row.impl.vec[j])) Coefficient(0); + for ( ; j < i + n; ++j) { + new(&(new_row.impl.vec[j])) Coefficient(0); + } } catch (...) { // Destroy the zeroes constructed so far. while (j != i) { @@ -183,7 +188,7 @@ try { // Construct n zeroes where the moved elements resided. while (impl.size != target_size) { - new (&impl.vec[impl.size]) Coefficient(0); + new(&impl.vec[impl.size]) Coefficient(0); ++impl.size; } impl.size = new_size; @@ -193,8 +198,9 @@ // because the memmove() moved already-constructed objects. // NOTE: This loop can't throw, because destructors must not throw. - for (dimension_type j = target_size; j < new_size; ++j) + for (dimension_type j = target_size; j < new_size; ++j) { impl.vec[j].~Coefficient(); + } throw; } @@ -208,7 +214,7 @@ PPL_ASSERT(new_size <= impl.capacity); PPL_ASSERT(size() <= new_size && new_size <= max_size()); while (impl.size != new_size) { - new (&impl.vec[impl.size]) Coefficient(); + new(&impl.vec[impl.size]) Coefficient(); ++impl.size; } PPL_ASSERT(size() == new_size); @@ -249,11 +255,12 @@ while (impl.size != impl.capacity) { // Constructs (*this)[impl.size] with row[impl.size]. if (itr != itr_end && itr.index() == impl.size) { - new (&impl.vec[impl.size]) Coefficient(*itr); + new(&impl.vec[impl.size]) Coefficient(*itr); ++itr; } - else - new (&impl.vec[impl.size]) Coefficient(); + else { + new(&impl.vec[impl.size]) Coefficient(); + } ++impl.size; } PPL_ASSERT(size() == row.size()); @@ -274,8 +281,9 @@ impl.vec[impl.size] = *itr; ++itr; } - else + else { impl.vec[impl.size] = Coefficient_zero(); + } } } else { @@ -286,21 +294,23 @@ for (dimension_type i = 0; i < impl.size; ++i) { // The following code is equivalent to (*this)[i] = row[i]. if (itr != itr_end && itr.index() == impl.size) { - new (&impl.vec[impl.size]) Coefficient(*itr); + new(&impl.vec[impl.size]) Coefficient(*itr); ++itr; } - else - new (&impl.vec[impl.size]) Coefficient(); + else { + new(&impl.vec[impl.size]) Coefficient(); + } } // Construct the additional elements. for ( ; impl.size != row.size(); ++impl.size) { // Constructs (*this)[impl.size] with row[impl.size]. if (itr != itr_end && itr.index() == impl.size) { - new (&impl.vec[impl.size]) Coefficient(*itr); + new(&impl.vec[impl.size]) Coefficient(*itr); ++itr; } - else - new (&impl.vec[impl.size]) Coefficient(); + else { + new(&impl.vec[impl.size]) Coefficient(); + } } } else { @@ -326,8 +336,9 @@ Coefficient_traits::const_reference x_i = x[--i]; if (const int x_i_sign = sgn(x_i)) { gcd = x_i; - if (x_i_sign < 0) + if (x_i_sign < 0) { neg_assign(gcd); + } goto compute_gcd; } } @@ -335,8 +346,9 @@ return; compute_gcd: - if (gcd == 1) + if (gcd == 1) { return; + } while (i > 0) { Coefficient_traits::const_reference x_i = x[--i]; if (x_i != 0) { @@ -352,8 +364,9 @@ // integers we cannot make any assumption, so here we draw. // Overall, we win. gcd_assign(gcd, x_i, gcd); - if (gcd == 1) + if (gcd == 1) { return; + } } } // Divide the coefficients by the GCD. @@ -367,8 +380,9 @@ PPL::Dense_Row::reset(dimension_type first, dimension_type last) { PPL_ASSERT(first <= last); PPL_ASSERT(last <= size()); - for (dimension_type i = first; i < last; ++i) + for (dimension_type i = first; i < last; ++i) { (*this)[i] = 0; + } } void @@ -399,16 +413,20 @@ if (coeff1 == 1) { if (coeff2 == 1) { // Optimized implementation for coeff1==1, coeff2==1. - for (dimension_type i = start; i < end; ++i) - if (y[i] != 0) + for (dimension_type i = start; i < end; ++i) { + if (y[i] != 0) { x[i] += y[i]; + } + } return; } if (coeff2 == -1) { // Optimized implementation for coeff1==1, coeff2==-1. - for (dimension_type i = start; i < end; ++i) - if (y[i] != 0) + for (dimension_type i = start; i < end; ++i) { + if (y[i] != 0) { x[i] -= y[i]; + } + } return; } // Optimized implementation for coeff1==1. @@ -417,8 +435,9 @@ // The test against 0 gives rise to a consistent speed up: see // http://www.cs.unipr.it/pipermail/ppl-devel/2009-February/014000.html Coefficient_traits::const_reference y_i = y[i]; - if (y_i != 0) + if (y_i != 0) { add_mul_assign(x_i, y_i, coeff2); + } } return; } @@ -427,8 +446,9 @@ // Optimized implementation for coeff2==1. for (dimension_type i = start; i < end; ++i) { x[i] *= coeff1; - if (y[i] != 0) + if (y[i] != 0) { x[i] += y[i]; + } } return; } @@ -436,8 +456,9 @@ // Optimized implementation for coeff2==-1. for (dimension_type i = start; i < end; ++i) { x[i] *= coeff1; - if (y[i] != 0) + if (y[i] != 0) { x[i] -= y[i]; + } } return; } @@ -448,8 +469,9 @@ // The test against 0 gives rise to a consistent speed up: see // http://www.cs.unipr.it/pipermail/ppl-devel/2009-February/014000.html Coefficient_traits::const_reference y_i = y[i]; - if (y_i != 0) + if (y_i != 0) { add_mul_assign(x_i, y_i, coeff2); + } } } @@ -458,8 +480,9 @@ const Dense_Row& x = *this; const dimension_type x_size = x.size(); s << "size " << x_size << " "; - for (dimension_type i = 0; i < x_size; ++i) + for (dimension_type i = 0; i < x_size; ++i) { s << x[i] << ' '; + } s << "\n"; } @@ -468,17 +491,21 @@ bool PPL::Dense_Row::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "size") + if (!(s >> str) || str != "size") { return false; + } dimension_type new_size; - if (!(s >> new_size)) + if (!(s >> new_size)) { return false; + } resize(new_size); - for (dimension_type col = 0; col < new_size; ++col) - if (!(s >> (*this)[col])) + for (dimension_type col = 0; col < new_size; ++col) { + if (!(s >> (*this)[col])) { return false; + } + } return true; } @@ -491,8 +518,9 @@ PPL::memory_size_type PPL::Dense_Row::external_memory_in_bytes() const { memory_size_type n = impl.capacity * sizeof(Coefficient); - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { n += PPL::external_memory_in_bytes(impl.vec[i]); + } return n; } @@ -533,12 +561,14 @@ } if (capacity() == 0) { - if (impl.vec != 0) + if (impl.vec != 0) { is_broken = true; + } } else { - if (impl.vec == 0) + if (impl.vec == 0) { is_broken = true; + } } return !is_broken; @@ -570,12 +600,15 @@ const dimension_type x_size = x.size(); const dimension_type y_size = y.size(); - if (x_size != y_size) + if (x_size != y_size) { return false; + } - for (dimension_type i = x_size; i-- > 0; ) - if (x[i] != y[i]) + for (dimension_type i = x_size; i-- > 0; ) { + if (x[i] != y[i]) { return false; + } + } return true; } diff -Nru ppl-1.1/src/Dense_Row_defs.hh ppl-1.2/src/Dense_Row_defs.hh --- ppl-1.1/src/Dense_Row_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Dense_Row_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Dense_Row class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS //! A finite sequence of coefficients. @@ -433,12 +434,12 @@ typedef std::bidirectional_iterator_tag iterator_category; typedef Coefficient value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef value_type& reference; iterator(); - iterator(Dense_Row& row1, dimension_type i1); + iterator(Dense_Row& r, dimension_type i); Coefficient& operator*(); Coefficient_traits::const_reference operator*() const; @@ -467,19 +468,19 @@ private: Dense_Row* row; - dimension_type i; + dimension_type idx; }; class Parma_Polyhedra_Library::Dense_Row::const_iterator { public: typedef const Coefficient value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef Coefficient_traits::const_reference reference; const_iterator(); - const_iterator(const Dense_Row& row1, dimension_type i1); + const_iterator(const Dense_Row& r, dimension_type i); Coefficient_traits::const_reference operator*() const; @@ -505,7 +506,7 @@ private: const Dense_Row* row; - dimension_type i; + dimension_type idx; }; diff -Nru ppl-1.1/src/Dense_Row_inlines.hh ppl-1.2/src/Dense_Row_inlines.hh --- ppl-1.1/src/Dense_Row_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Dense_Row_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Dense_Row class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,7 +24,7 @@ #ifndef PPL_Dense_Row_inlines_hh #define PPL_Dense_Row_inlines_hh 1 -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -97,7 +97,7 @@ impl.capacity = y.capacity(); impl.vec = impl.coeff_allocator.allocate(impl.capacity); while (impl.size != y.size()) { - new (&impl.vec[impl.size]) Coefficient(y[impl.size]); + new(&impl.vec[impl.size]) Coefficient(y[impl.size]); ++impl.size; } } @@ -119,7 +119,7 @@ if (y.impl.vec != 0) { while (impl.size != y.size()) { - new (&impl.vec[impl.size]) Coefficient(y[impl.size]); + new(&impl.vec[impl.size]) Coefficient(y[impl.size]); ++impl.size; } } @@ -144,11 +144,11 @@ const dimension_type n = std::min(sz, y.size()); while (impl.size != n) { - new (&impl.vec[impl.size]) Coefficient(y[impl.size]); + new(&impl.vec[impl.size]) Coefficient(y[impl.size]); ++impl.size; } while (impl.size != sz) { - new (&impl.vec[impl.size]) Coefficient(); + new(&impl.vec[impl.size]) Coefficient(); ++impl.size; } @@ -185,8 +185,9 @@ if (this != &y && size() == y.size()) { // Avoid reallocation. - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { (*this)[i] = y[i]; + } return *this; } @@ -345,37 +346,37 @@ inline Dense_Row::iterator::iterator() - : row(NULL), i(0) { + : row(NULL), idx(0) { PPL_ASSERT(OK()); } inline -Dense_Row::iterator::iterator(Dense_Row& row1,dimension_type i1) - : row(&row1), i(i1) { +Dense_Row::iterator::iterator(Dense_Row& r, dimension_type i) + : row(&r), idx(i) { PPL_ASSERT(OK()); } inline Coefficient& Dense_Row::iterator::operator*() { - PPL_ASSERT(i < row->size()); - return (*row)[i]; + PPL_ASSERT(idx < row->size()); + return (*row)[idx]; } inline Coefficient_traits::const_reference Dense_Row::iterator::operator*() const { - PPL_ASSERT(i < row->size()); - return (*row)[i]; + PPL_ASSERT(idx < row->size()); + return (*row)[idx]; } inline dimension_type Dense_Row::iterator::index() const { - return i; + return idx; } inline Dense_Row::iterator& Dense_Row::iterator::operator++() { - PPL_ASSERT(i < row->size()); - ++i; + PPL_ASSERT(idx < row->size()); + ++idx; PPL_ASSERT(OK()); return *this; } @@ -389,8 +390,8 @@ inline Dense_Row::iterator& Dense_Row::iterator::operator--() { - PPL_ASSERT(i > 0); - --i; + PPL_ASSERT(idx > 0); + --idx; PPL_ASSERT(OK()); return *this; } @@ -404,7 +405,7 @@ inline bool Dense_Row::iterator::operator==(const iterator& x) const { - return (row == x.row) && (i == x.i); + return (row == x.row) && (idx == x.idx); } inline bool @@ -414,46 +415,47 @@ inline Dense_Row::iterator::operator const_iterator() const { - return const_iterator(*row, i); + return const_iterator(*row, idx); } inline bool Dense_Row::iterator::OK() const { - if (row == NULL) + if (row == NULL) { return true; + } // i can be equal to row.size() for past-the-end iterators - return (i <= row->size()); + return (idx <= row->size()); } inline Dense_Row::const_iterator::const_iterator() - : row(NULL), i(0) { + : row(NULL), idx(0) { PPL_ASSERT(OK()); } inline -Dense_Row::const_iterator::const_iterator(const Dense_Row& row1, - dimension_type i1) - : row(&row1), i(i1) { +Dense_Row::const_iterator::const_iterator(const Dense_Row& r, + dimension_type i) + : row(&r), idx(i) { PPL_ASSERT(OK()); } inline Coefficient_traits::const_reference Dense_Row::const_iterator::operator*() const { - PPL_ASSERT(i < row->size()); - return (*row)[i]; + PPL_ASSERT(idx < row->size()); + return (*row)[idx]; } inline dimension_type Dense_Row::const_iterator::index() const { - return i; + return idx; } inline Dense_Row::const_iterator& Dense_Row::const_iterator::operator++() { - PPL_ASSERT(i < row->size()); - ++i; + PPL_ASSERT(idx < row->size()); + ++idx; PPL_ASSERT(OK()); return *this; } @@ -467,8 +469,8 @@ inline Dense_Row::const_iterator& Dense_Row::const_iterator::operator--() { - PPL_ASSERT(i > 0); - --i; + PPL_ASSERT(idx > 0); + --idx; PPL_ASSERT(OK()); return *this; } @@ -482,7 +484,7 @@ inline bool Dense_Row::const_iterator::operator==(const const_iterator& x) const { - return (row == x.row) && (i == x.i); + return (row == x.row) && (idx == x.idx); } inline bool @@ -492,10 +494,11 @@ inline bool Dense_Row::const_iterator::OK() const { - if (row == NULL) + if (row == NULL) { return true; + } // i can be equal to row.size() for past-the-end iterators - return (i <= row->size()); + return (idx <= row->size()); } inline void diff -Nru ppl-1.1/src/Dense_Row_templates.hh ppl-1.2/src/Dense_Row_templates.hh --- ppl-1.1/src/Dense_Row_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Dense_Row_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Dense_Row class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -31,24 +31,27 @@ void Dense_Row::combine_needs_first(const Dense_Row& y, const Func1& /* f */, const Func2& g) { - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { g((*this)[i], y[i]); + } } template void Dense_Row::combine_needs_second(const Dense_Row& y, const Func1& g, const Func2& /* h */) { - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { g((*this)[i], y[i]); + } } template void Dense_Row::combine(const Dense_Row& y, const Func1& /* f */, const Func2& g, const Func3& /* h */) { - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { g((*this)[i], y[i]); + } } } // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/src/Dense_Row_types.hh ppl-1.2/src/Dense_Row_types.hh --- ppl-1.1/src/Dense_Row_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Dense_Row_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Determinate_defs.hh ppl-1.2/src/Determinate_defs.hh --- ppl-1.1/src/Determinate_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Determinate_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Determinate class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -30,7 +30,6 @@ #include "Variable_defs.hh" #include "globals_types.hh" #include -#include "assert.hh" namespace Parma_Polyhedra_Library { diff -Nru ppl-1.1/src/Determinate_inlines.hh ppl-1.2/src/Determinate_inlines.hh --- ppl-1.1/src/Determinate_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Determinate_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Determinate class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,7 +24,7 @@ #ifndef PPL_Determinate_inlines_hh #define PPL_Determinate_inlines_hh 1 -#include "assert.hh" +#include "assertions.hh" namespace Parma_Polyhedra_Library { @@ -120,16 +120,18 @@ template inline Determinate::~Determinate() { - if (prep->del_reference()) + if (prep->del_reference()) { delete prep; + } } template inline Determinate& Determinate::operator=(const Determinate& y) { y.prep->new_reference(); - if (prep->del_reference()) + if (prep->del_reference()) { delete prep; + } prep = y.prep; return *this; } diff -Nru ppl-1.1/src/Determinate_types.hh ppl-1.2/src/Determinate_types.hh --- ppl-1.1/src/Determinate_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Determinate_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Difference_Floating_Point_Expression_defs.hh ppl-1.2/src/Difference_Floating_Point_Expression_defs.hh --- ppl-1.1/src/Difference_Floating_Point_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Difference_Floating_Point_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declarations for the Difference_Floating_Point_Expression class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Difference_Floating_Point_Expression_inlines.hh ppl-1.2/src/Difference_Floating_Point_Expression_inlines.hh --- ppl-1.1/src/Difference_Floating_Point_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Difference_Floating_Point_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Difference_Floating_Point_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -35,7 +35,7 @@ ::Difference_Floating_Point_Expression( Floating_Point_Expression* const x, Floating_Point_Expression* const y) - : first_operand(x), second_operand(y){ + : first_operand(x), second_operand(y) { assert(x != 0); assert(y != 0); } diff -Nru ppl-1.1/src/Difference_Floating_Point_Expression_templates.hh ppl-1.2/src/Difference_Floating_Point_Expression_templates.hh --- ppl-1.1/src/Difference_Floating_Point_Expression_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Difference_Floating_Point_Expression_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Difference_Floating_Point_Expression class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -32,15 +32,17 @@ ::linearize(const FP_Interval_Abstract_Store& int_store, const FP_Linear_Form_Abstract_Store& lf_store, FP_Linear_Form& result) const { - if (!first_operand->linearize(int_store, lf_store, result)) + if (!first_operand->linearize(int_store, lf_store, result)) { return false; + } FP_Linear_Form rel_error; relative_error(result, rel_error); result += rel_error; FP_Linear_Form linearized_second_operand; if (!second_operand->linearize(int_store, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } result -= linearized_second_operand; relative_error(linearized_second_operand, rel_error); result += rel_error; diff -Nru ppl-1.1/src/Difference_Floating_Point_Expression_types.hh ppl-1.2/src/Difference_Floating_Point_Expression_types.hh --- ppl-1.1/src/Difference_Floating_Point_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Difference_Floating_Point_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/distances_defs.hh ppl-1.2/src/distances_defs.hh --- ppl-1.1/src/distances_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/distances_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Class declarations for several distances. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/distances_inlines.hh ppl-1.2/src/distances_inlines.hh --- ppl-1.1/src/distances_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/distances_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Inline functions implementing distances. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -99,8 +99,9 @@ L_Infinity_Distance_Specialization::combine(Temp& running, const Temp& current, Rounding_Dir) { - if (current > running) + if (current > running) { running = current; + } } template diff -Nru ppl-1.1/src/distances_types.hh ppl-1.2/src/distances_types.hh --- ppl-1.1/src/distances_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/distances_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Division_Floating_Point_Expression_defs.hh ppl-1.2/src/Division_Floating_Point_Expression_defs.hh --- ppl-1.1/src/Division_Floating_Point_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Division_Floating_Point_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declarations for the Division_Floating_Point_Expression class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Division_Floating_Point_Expression_inlines.hh ppl-1.2/src/Division_Floating_Point_Expression_inlines.hh --- ppl-1.1/src/Division_Floating_Point_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Division_Floating_Point_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Division_Floating_Point_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Division_Floating_Point_Expression_templates.hh ppl-1.2/src/Division_Floating_Point_Expression_templates.hh --- ppl-1.1/src/Division_Floating_Point_Expression_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Division_Floating_Point_Expression_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Division_Floating_Point_Expression class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -34,19 +34,22 @@ FP_Linear_Form& result) const { FP_Linear_Form linearized_second_operand; if (!second_operand->linearize(int_store, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } FP_Interval_Type intervalized_second_operand; this->intervalize(linearized_second_operand, int_store, intervalized_second_operand); // Check if we may divide by zero. if (intervalized_second_operand.lower() <= 0 - && intervalized_second_operand.upper() >= 0) + && intervalized_second_operand.upper() >= 0) { return false; + } - if (!first_operand->linearize(int_store, lf_store, result)) + if (!first_operand->linearize(int_store, lf_store, result)) { return false; + } FP_Linear_Form rel_error; relative_error(result, rel_error); result /= intervalized_second_operand; diff -Nru ppl-1.1/src/Division_Floating_Point_Expression_types.hh ppl-1.2/src/Division_Floating_Point_Expression_types.hh --- ppl-1.1/src/Division_Floating_Point_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Division_Floating_Point_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Doubly_Linked_Object_defs.hh ppl-1.2/src/Doubly_Linked_Object_defs.hh --- ppl-1.1/src/Doubly_Linked_Object_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Doubly_Linked_Object_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Doubly_Linked_Object class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Doubly_Linked_Object_inlines.hh ppl-1.2/src/Doubly_Linked_Object_inlines.hh --- ppl-1.1/src/Doubly_Linked_Object_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Doubly_Linked_Object_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Doubly_Linked_Object class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Doubly_Linked_Object_types.hh ppl-1.2/src/Doubly_Linked_Object_types.hh --- ppl-1.1/src/Doubly_Linked_Object_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Doubly_Linked_Object_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/EList_defs.hh ppl-1.2/src/EList_defs.hh --- ppl-1.1/src/EList_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/EList_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* EList class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/EList_inlines.hh ppl-1.2/src/EList_inlines.hh --- ppl-1.1/src/EList_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/EList_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* EList class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -105,9 +105,11 @@ template inline bool EList::OK() const { - for (const_iterator i = begin(), lend = end(); i != lend; ++i) - if (!i->OK()) + for (const_iterator i = begin(), lend = end(); i != lend; ++i) { + if (!i->OK()) { return false; + } + } return true; } diff -Nru ppl-1.1/src/EList_Iterator_defs.hh ppl-1.2/src/EList_Iterator_defs.hh --- ppl-1.1/src/EList_Iterator_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/EList_Iterator_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* EList_Iterator class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/EList_Iterator_inlines.hh ppl-1.2/src/EList_Iterator_inlines.hh --- ppl-1.1/src/EList_Iterator_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/EList_Iterator_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* EList_Iterator class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/EList_Iterator_types.hh ppl-1.2/src/EList_Iterator_types.hh --- ppl-1.1/src/EList_Iterator_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/EList_Iterator_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/EList_types.hh ppl-1.2/src/EList_types.hh --- ppl-1.1/src/EList_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/EList_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Expression_Adapter_defs.hh ppl-1.2/src/Expression_Adapter_defs.hh --- ppl-1.1/src/Expression_Adapter_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Expression_Adapter_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Expression_Adapter class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -170,11 +170,11 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Dense_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Dense_Row& r) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Sparse_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Sparse_Row& r) const; //! Returns \c true if there is a variable in [first,last) whose coefficient //! is nonzero in both \p *this and \p y. diff -Nru ppl-1.1/src/Expression_Adapter_inlines.hh ppl-1.2/src/Expression_Adapter_inlines.hh --- ppl-1.1/src/Expression_Adapter_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Expression_Adapter_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Expression_Adapter class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -198,14 +198,14 @@ template inline void -Expression_Adapter::get_row(Dense_Row& row) const { - inner().get_row(row); +Expression_Adapter::get_row(Dense_Row& r) const { + inner().get_row(r); } template inline void -Expression_Adapter::get_row(Sparse_Row& row) const { - inner().get_row(row); +Expression_Adapter::get_row(Sparse_Row& r) const { + inner().get_row(r); } template diff -Nru ppl-1.1/src/Expression_Adapter_types.hh ppl-1.2/src/Expression_Adapter_types.hh --- ppl-1.1/src/Expression_Adapter_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Expression_Adapter_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Expression_Hide_Inhomo_defs.hh ppl-1.2/src/Expression_Hide_Inhomo_defs.hh --- ppl-1.1/src/Expression_Hide_Inhomo_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Expression_Hide_Inhomo_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Expression_Hide_Inhomo class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -135,11 +135,11 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Dense_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Dense_Row& r) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Sparse_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Sparse_Row& r) const; }; #include "Expression_Hide_Inhomo_inlines.hh" diff -Nru ppl-1.1/src/Expression_Hide_Inhomo_inlines.hh ppl-1.2/src/Expression_Hide_Inhomo_inlines.hh --- ppl-1.1/src/Expression_Hide_Inhomo_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Expression_Hide_Inhomo_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Expression_Hide_Inhomo class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -54,10 +54,12 @@ ::is_equal_to(const Expression& y) const { const dimension_type x_dim = this->space_dimension(); const dimension_type y_dim = y.space_dimension(); - if (x_dim != y_dim) + if (x_dim != y_dim) { return false; - if (y.inhomogeneous_term() != 0) + } + if (y.inhomogeneous_term() != 0) { return false; + } // Note that the inhomogeneous term is not compared. return this->inner().is_equal_to(y, 1, x_dim + 1); } @@ -65,10 +67,12 @@ template inline Coefficient_traits::const_reference Expression_Hide_Inhomo::get(dimension_type i) const { - if (i == 0) + if (i == 0) { return Coefficient_zero(); - else + } + else { return this->inner().get(i); + } } template @@ -88,10 +92,12 @@ inline bool Expression_Hide_Inhomo::all_zeroes(dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return true; - if (start == 0) + } + if (start == 0) { ++start; + } return this->inner().all_zeroes(start, end); } @@ -99,8 +105,9 @@ inline dimension_type Expression_Hide_Inhomo::num_zeroes(dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return 0; + } dimension_type nz = 0; if (start == 0) { ++start; @@ -114,10 +121,12 @@ inline Coefficient Expression_Hide_Inhomo::gcd(dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return Coefficient_zero(); - if (start == 0) + } + if (start == 0) { ++start; + } return this->inner().gcd(start, end); } @@ -131,10 +140,12 @@ inline dimension_type Expression_Hide_Inhomo::last_nonzero(dimension_type first, dimension_type last) const { - if (first == last) + if (first == last) { return last; - if (first == 0) + } + if (first == 0) { ++first; + } return this->inner().last_nonzero(first, last); } @@ -142,10 +153,12 @@ inline dimension_type Expression_Hide_Inhomo::first_nonzero(dimension_type first, dimension_type last) const { - if (first == last) + if (first == last) { return last; - if (first == 0) + } + if (first == 0) { ++first; + } return this->inner().first_nonzero(first, last); } @@ -154,10 +167,12 @@ Expression_Hide_Inhomo ::all_zeroes_except(const Variables_Set& vars, dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return true; - if (start == 0) + } + if (start == 0) { ++start; + } return this->inner().all_zeroes_except(vars, start, end); } @@ -167,8 +182,9 @@ ::has_a_free_dimension_helper(std::set& y) const { bool had_0 = (y.count(0) == 1); this->inner().has_a_free_dimension_helper(y); - if (had_0) + if (had_0) { y.insert(0); + } } template @@ -177,10 +193,12 @@ Expression_Hide_Inhomo ::is_equal_to(const Expression& y, dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return true; - if (start == 0) + } + if (start == 0) { ++start; + } return this->inner().is_equal_to(y, start, end); } @@ -192,25 +210,27 @@ Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return true; - if (start == 0) + } + if (start == 0) { ++start; + } return this->inner().is_equal_to(y, c1, c2, start, end); } template inline void -Expression_Hide_Inhomo::get_row(Dense_Row& row) const { - this->inner().get_row(row); - row.reset(0); +Expression_Hide_Inhomo::get_row(Dense_Row& r) const { + this->inner().get_row(r); + r.reset(0); } template inline void -Expression_Hide_Inhomo::get_row(Sparse_Row& row) const { - this->inner().get_row(row); - row.reset(0); +Expression_Hide_Inhomo::get_row(Sparse_Row& r) const { + this->inner().get_row(r); + r.reset(0); } } // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/src/Expression_Hide_Inhomo_types.hh ppl-1.2/src/Expression_Hide_Inhomo_types.hh --- ppl-1.1/src/Expression_Hide_Inhomo_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Expression_Hide_Inhomo_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Expression_Hide_Last_defs.hh ppl-1.2/src/Expression_Hide_Last_defs.hh --- ppl-1.1/src/Expression_Hide_Last_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Expression_Hide_Last_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Expression_Hide_Last class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -143,11 +143,11 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Dense_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Dense_Row& r) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Sparse_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Sparse_Row& r) const; //! Returns \c true if there is a variable in [first,last) whose coefficient //! is nonzero in both \p *this and \p y. diff -Nru ppl-1.1/src/Expression_Hide_Last_inlines.hh ppl-1.2/src/Expression_Hide_Last_inlines.hh --- ppl-1.1/src/Expression_Hide_Last_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Expression_Hide_Last_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Expression_Hide_Last class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -90,8 +90,9 @@ ::is_equal_to(const Expression& y) const { const dimension_type x_dim = space_dimension(); const dimension_type y_dim = y.space_dimension(); - if (x_dim != y_dim) + if (x_dim != y_dim) { return false; + } return is_equal_to(y, 0, x_dim + 1); } @@ -175,8 +176,9 @@ inline void Expression_Hide_Last ::has_a_free_dimension_helper(std::set& x) const { - if (x.empty()) + if (x.empty()) { return; + } PPL_ASSERT(*(--x.end()) <= space_dimension()); this->inner().has_a_free_dimension_helper(x); } @@ -207,21 +209,21 @@ template inline void -Expression_Hide_Last::get_row(Dense_Row& row) const { - this->inner().get_row(row); +Expression_Hide_Last::get_row(Dense_Row& r) const { + this->inner().get_row(r); if (hide_last_) { - PPL_ASSERT(row.size() != 0); - row.resize(row.size() - 1); + PPL_ASSERT(r.size() != 0); + r.resize(r.size() - 1); } } template inline void -Expression_Hide_Last::get_row(Sparse_Row& row) const { - this->inner().get_row(row); +Expression_Hide_Last::get_row(Sparse_Row& r) const { + this->inner().get_row(r); if (hide_last_) { - PPL_ASSERT(row.size() != 0); - row.resize(row.size() - 1); + PPL_ASSERT(r.size() != 0); + r.resize(r.size() - 1); } } diff -Nru ppl-1.1/src/Expression_Hide_Last_types.hh ppl-1.2/src/Expression_Hide_Last_types.hh --- ppl-1.1/src/Expression_Hide_Last_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Expression_Hide_Last_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Float.cc ppl-1.2/src/Float.cc --- ppl-1.1/src/Float.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Float.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* IEC 559 floating point format related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Float_defs.hh ppl-1.2/src/Float_defs.hh --- ppl-1.1/src/Float_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Float_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* IEC 559 floating point format related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,6 @@ #include "globals_types.hh" #include "meta_programming.hh" #include "compiler.hh" -#include "assert.hh" #include "Concrete_Expression_types.hh" #include "Variable_types.hh" #include "Linear_Form_types.hh" diff -Nru ppl-1.1/src/Floating_Point_Expression_defs.hh ppl-1.2/src/Floating_Point_Expression_defs.hh --- ppl-1.1/src/Floating_Point_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Floating_Point_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Declarations for the Floating_Point_Expression class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,8 +24,8 @@ #ifndef PPL_Floating_Point_Expression_defs_hh #define PPL_Floating_Point_Expression_defs_hh 1 -#include "globals_defs.hh" #include "Floating_Point_Expression_types.hh" +#include "globals_defs.hh" #include "Linear_Form_types.hh" #include "Box_types.hh" #include diff -Nru ppl-1.1/src/Floating_Point_Expression_inlines.hh ppl-1.2/src/Floating_Point_Expression_inlines.hh --- ppl-1.1/src/Floating_Point_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Floating_Point_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Floating_Point_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -38,13 +38,15 @@ inline bool Floating_Point_Expression ::overflows(const FP_Linear_Form& lf) { - if (!lf.inhomogeneous_term().is_bounded()) + if (!lf.inhomogeneous_term().is_bounded()) { return true; + } dimension_type dimension = lf.space_dimension(); for (dimension_type i = 0; i < dimension; ++i) { - if (!lf.coefficient(Variable(i)).is_bounded()) + if (!lf.coefficient(Variable(i)).is_bounded()) { return true; + } } return false; diff -Nru ppl-1.1/src/Floating_Point_Expression_templates.hh ppl-1.2/src/Floating_Point_Expression_templates.hh --- ppl-1.1/src/Floating_Point_Expression_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Floating_Point_Expression_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Floating_Point_Expression class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Floating_Point_Expression_types.hh ppl-1.2/src/Floating_Point_Expression_types.hh --- ppl-1.1/src/Floating_Point_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Floating_Point_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Float_inlines.hh ppl-1.2/src/Float_inlines.hh --- ppl-1.1/src/Float_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Float_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* IEC 559 floating point format related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,18 +24,21 @@ #ifndef PPL_Float_inlines_hh #define PPL_Float_inlines_hh 1 -#include #include "Variable_defs.hh" #include "Linear_Form_defs.hh" +#include "assertions.hh" +#include namespace Parma_Polyhedra_Library { inline int float_ieee754_half::inf_sign() const { - if (word == NEG_INF) + if (word == NEG_INF) { return -1; - if (word == POS_INF) + } + if (word == POS_INF) { return 1; + } return 0; } @@ -46,10 +49,12 @@ inline int float_ieee754_half::zero_sign() const { - if (word == NEG_ZERO) + if (word == NEG_ZERO) { return -1; - if (word == POS_ZERO) + } + if (word == POS_ZERO) { return 1; + } return 0; } @@ -76,16 +81,18 @@ inline void float_ieee754_half::set_max(bool negative) { word = WRD_MAX; - if (negative) + if (negative) { word |= SGN_MASK; + } } inline void float_ieee754_half::build(bool negative, mpz_t mantissa, int exponent) { word = static_cast(mpz_get_ui(mantissa) & ((1UL << MANTISSA_BITS) - 1)); - if (negative) + if (negative) { word |= SGN_MASK; + } const int exponent_repr = exponent + EXPONENT_BIAS; PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS)); word |= static_cast(exponent_repr) << MANTISSA_BITS; @@ -93,10 +100,12 @@ inline int float_ieee754_single::inf_sign() const { - if (word == NEG_INF) + if (word == NEG_INF) { return -1; - if (word == POS_INF) + } + if (word == POS_INF) { return 1; + } return 0; } @@ -107,10 +116,12 @@ inline int float_ieee754_single::zero_sign() const { - if (word == NEG_ZERO) + if (word == NEG_ZERO) { return -1; - if (word == POS_ZERO) + } + if (word == POS_ZERO) { return 1; + } return 0; } @@ -137,16 +148,18 @@ inline void float_ieee754_single::set_max(bool negative) { word = WRD_MAX; - if (negative) + if (negative) { word |= SGN_MASK; + } } inline void float_ieee754_single::build(bool negative, mpz_t mantissa, int exponent) { word = static_cast(mpz_get_ui(mantissa) & ((1UL << MANTISSA_BITS) - 1)); - if (negative) + if (negative) { word |= SGN_MASK; + } const int exponent_repr = exponent + EXPONENT_BIAS; PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS)); word |= static_cast(exponent_repr) << MANTISSA_BITS; @@ -154,12 +167,15 @@ inline int float_ieee754_double::inf_sign() const { - if (lsp != LSP_INF) + if (lsp != LSP_INF) { return 0; - if (msp == MSP_NEG_INF) + } + if (msp == MSP_NEG_INF) { return -1; - if (msp == MSP_POS_INF) + } + if (msp == MSP_POS_INF) { return 1; + } return 0; } @@ -171,12 +187,15 @@ inline int float_ieee754_double::zero_sign() const { - if (lsp != LSP_ZERO) + if (lsp != LSP_ZERO) { return 0; - if (msp == MSP_NEG_ZERO) + } + if (msp == MSP_NEG_ZERO) { return -1; - if (msp == MSP_POS_ZERO) + } + if (msp == MSP_POS_ZERO) { return 1; + } return 0; } @@ -196,8 +215,9 @@ --msp; lsp = LSP_MAX; } - else + else { --lsp; + } } inline void @@ -206,16 +226,18 @@ ++msp; lsp = 0; } - else + else { ++lsp; + } } inline void float_ieee754_double::set_max(bool negative) { msp = MSP_MAX; lsp = LSP_MAX; - if (negative) + if (negative) { msp |= MSP_SGN_MASK; + } } inline void @@ -231,8 +253,9 @@ m >>= 32; #endif msp = static_cast(m & ((1UL << (MANTISSA_BITS - 32)) - 1)); - if (negative) + if (negative) { msp |= MSP_SGN_MASK; + } const int exponent_repr = exponent + EXPONENT_BIAS; PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS)); msp |= static_cast(exponent_repr) << (MANTISSA_BITS - 32); @@ -240,10 +263,12 @@ inline int float_ibm_single::inf_sign() const { - if (word == NEG_INF) + if (word == NEG_INF) { return -1; - if (word == POS_INF) + } + if (word == POS_INF) { return 1; + } return 0; } @@ -254,10 +279,12 @@ inline int float_ibm_single::zero_sign() const { - if (word == NEG_ZERO) + if (word == NEG_ZERO) { return -1; - if (word == POS_ZERO) + } + if (word == POS_ZERO) { return 1; + } return 0; } @@ -284,16 +311,18 @@ inline void float_ibm_single::set_max(bool negative) { word = WRD_MAX; - if (negative) + if (negative) { word |= SGN_MASK; + } } inline void float_ibm_single::build(bool negative, mpz_t mantissa, int exponent) { word = static_cast(mpz_get_ui(mantissa) & ((1UL << MANTISSA_BITS) - 1)); - if (negative) + if (negative) { word |= SGN_MASK; + } const int exponent_repr = exponent + EXPONENT_BIAS; PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS)); word |= static_cast(exponent_repr) << MANTISSA_BITS; @@ -301,13 +330,16 @@ inline int float_intel_double_extended::inf_sign() const { - if (lsp != LSP_INF) + if (lsp != LSP_INF) { return 0; + } const uint32_t a = msp & MSP_NEG_INF; - if (a == MSP_NEG_INF) + if (a == MSP_NEG_INF) { return -1; - if (a == MSP_POS_INF) + } + if (a == MSP_POS_INF) { return 1; + } return 0; } @@ -319,13 +351,16 @@ inline int float_intel_double_extended::zero_sign() const { - if (lsp != LSP_ZERO) + if (lsp != LSP_ZERO) { return 0; + } const uint32_t a = msp & MSP_NEG_INF; - if (a == MSP_NEG_ZERO) + if (a == MSP_NEG_ZERO) { return -1; - if (a == MSP_POS_ZERO) + } + if (a == MSP_POS_ZERO) { return 1; + } return 0; } @@ -345,8 +380,9 @@ --msp; lsp = ((msp & MSP_NEG_INF) == 0) ? LSP_DMAX : LSP_NMAX; } - else + else { --lsp; + } } inline void @@ -355,16 +391,18 @@ ++msp; lsp = LSP_DMAX + 1; } - else + else { ++lsp; + } } inline void float_intel_double_extended::set_max(bool negative) { msp = MSP_MAX; lsp = LSP_NMAX; - if (negative) + if (negative) { msp |= MSP_SGN_MASK; + } } inline void @@ -383,12 +421,15 @@ inline int float_ieee754_quad::inf_sign() const { - if (lsp != LSP_INF) + if (lsp != LSP_INF) { return 0; - if (msp == MSP_NEG_INF) + } + if (msp == MSP_NEG_INF) { return -1; - if (msp == MSP_POS_INF) + } + if (msp == MSP_POS_INF) { return 1; + } return 0; } @@ -400,12 +441,15 @@ inline int float_ieee754_quad::zero_sign() const { - if (lsp != LSP_ZERO) + if (lsp != LSP_ZERO) { return 0; - if (msp == MSP_NEG_ZERO) + } + if (msp == MSP_NEG_ZERO) { return -1; - if (msp == MSP_POS_ZERO) + } + if (msp == MSP_POS_ZERO) { return 1; + } return 0; } @@ -425,8 +469,9 @@ --msp; lsp = LSP_MAX; } - else + else { --lsp; + } } inline void @@ -435,16 +480,18 @@ ++msp; lsp = 0; } - else + else { ++lsp; + } } inline void float_ieee754_quad::set_max(bool negative) { msp = MSP_MAX; lsp = LSP_MAX; - if (negative) + if (negative) { msp |= MSP_SGN_MASK; + } } inline void @@ -454,8 +501,9 @@ lsp = parts[0]; msp = parts[1]; msp &= ((static_cast(1) << (MANTISSA_BITS - 64)) - 1); - if (negative) + if (negative) { msp |= MSP_SGN_MASK; + } const int exponent_repr = exponent + EXPONENT_BIAS; PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS)); msp |= static_cast(exponent_repr) << (MANTISSA_BITS - 64); diff -Nru ppl-1.1/src/Float_templates.hh ppl-1.2/src/Float_templates.hh --- ppl-1.1/src/Float_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Float_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* IEC 559 floating point format related functions: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -53,17 +53,18 @@ unsigned int f_mantissa_bits; switch (analyzed_format) { case IEEE754_HALF: - if (ieee754_half_result != ZERO_INTERVAL) + if (ieee754_half_result != ZERO_INTERVAL) { return ieee754_half_result; - + } to_compute = &ieee754_half_result; f_base = float_ieee754_half::BASE; f_exponent_bias = float_ieee754_half::EXPONENT_BIAS; f_mantissa_bits = float_ieee754_half::MANTISSA_BITS; break; case IEEE754_SINGLE: - if (ieee754_single_result != ZERO_INTERVAL) + if (ieee754_single_result != ZERO_INTERVAL) { return ieee754_single_result; + } to_compute = &ieee754_single_result; f_base = float_ieee754_single::BASE; @@ -71,8 +72,9 @@ f_mantissa_bits = float_ieee754_single::MANTISSA_BITS; break; case IEEE754_DOUBLE: - if (ieee754_double_result != ZERO_INTERVAL) + if (ieee754_double_result != ZERO_INTERVAL) { return ieee754_double_result; + } to_compute = &ieee754_double_result; f_base = float_ieee754_double::BASE; @@ -80,8 +82,9 @@ f_mantissa_bits = float_ieee754_double::MANTISSA_BITS; break; case IBM_SINGLE: - if (ibm_single_result != ZERO_INTERVAL) + if (ibm_single_result != ZERO_INTERVAL) { return ibm_single_result; + } to_compute = &ibm_single_result; f_base = float_ibm_single::BASE; @@ -89,8 +92,9 @@ f_mantissa_bits = float_ibm_single::MANTISSA_BITS; break; case IEEE754_QUAD: - if (ieee754_quad_result != ZERO_INTERVAL) + if (ieee754_quad_result != ZERO_INTERVAL) { return ieee754_quad_result; + } to_compute = &ieee754_quad_result; f_base = float_ieee754_quad::BASE; @@ -98,8 +102,9 @@ f_mantissa_bits = float_ieee754_quad::MANTISSA_BITS; break; case INTEL_DOUBLE_EXTENDED: - if (intel_double_extended_result != ZERO_INTERVAL) + if (intel_double_extended_result != ZERO_INTERVAL) { return intel_double_extended_result; + } to_compute = &intel_double_extended_result; f_base = float_intel_double_extended::BASE; @@ -133,10 +138,12 @@ typedef Linear_Form FP_Linear_Form; typedef typename std::map::iterator Iter; for (Iter i = lf_store.begin(); i != lf_store.end(); ) { - if((i->second).coefficient(var) != 0) + if ((i->second).coefficient(var) != 0) { i = lf_store.erase(i); - else + } + else { ++i; + } } } @@ -155,10 +162,12 @@ Const_Iter i2_end = ls2.end(); for (Iter i1 = ls1.begin(), i1_end = ls1.end(); i1 != i1_end; ) { Const_Iter i2 = ls2.find(i1->first); - if ((i2 == i2_end) || (i1->second != i2->second)) + if ((i2 == i2_end) || (i1->second != i2->second)) { i1 = ls1.erase(i1); - else + } + else { ++i1; + } } } diff -Nru ppl-1.1/src/fpu-c99_inlines.hh ppl-1.2/src/fpu-c99_inlines.hh --- ppl-1.1/src/fpu-c99_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/fpu-c99_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* C99 Floating point unit related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -48,10 +48,11 @@ const int old = fegetround(); if (fesetround(PPL_FPU_DOWNWARD) != 0 || fesetround(PPL_FPU_UPWARD) != 0 - || fesetround(old) != 0) + || fesetround(old) != 0) { throw std::logic_error("PPL configuration error:" " PPL_CAN_CONTROL_FPU evaluates to true," " but fesetround() returns nonzero."); + } } inline fpu_rounding_direction_type diff -Nru ppl-1.1/src/fpu_defs.hh ppl-1.2/src/fpu_defs.hh --- ppl-1.1/src/fpu_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/fpu_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Floating point unit related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/fpu-ia32.cc ppl-1.2/src/fpu-ia32.cc --- ppl-1.1/src/fpu-ia32.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/fpu-ia32.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* IA-32 floating point unit non-inline related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -72,4 +72,6 @@ } // namespace Parma_Polyhedra_Library -#endif // PPL_CAN_CONTROL_FPU && defined(PPL_FPMATH_MAY_USE_SSE) && defined(__i386__) && (defined(__GNUC__) || defined(__INTEL_COMPILER)) +#endif // PPL_CAN_CONTROL_FPU && defined(PPL_FPMATH_MAY_USE_SSE) + // && defined(__i386__) + // && (defined(__GNUC__) || defined(__INTEL_COMPILER)) diff -Nru ppl-1.1/src/fpu-ia32_inlines.hh ppl-1.2/src/fpu-ia32_inlines.hh --- ppl-1.1/src/fpu-ia32_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/fpu-ia32_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* IA-32 floating point unit inline related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -167,8 +167,9 @@ // NOTE: on entry to this function the current rounding mode // has to be the default one. extern bool have_sse_unit; - if (have_sse_unit) + if (have_sse_unit) { sse_set_control(PPL_SSE_CONTROL_DEFAULT); + } #endif } @@ -179,21 +180,24 @@ #endif #ifdef PPL_FPMATH_MAY_USE_SSE extern bool have_sse_unit; - if (have_sse_unit) + if (have_sse_unit) { sse_set_control(PPL_SSE_CONTROL_DEFAULT); + } #endif } inline int fpu_check_inexact() { #ifdef PPL_FPMATH_MAY_USE_387 - if (fpu_get_status() & FPU_INEXACT) + if (fpu_get_status() & FPU_INEXACT) { return 1; + } #endif #ifdef PPL_FPMATH_MAY_USE_SSE extern bool have_sse_unit; - if (have_sse_unit && (sse_get_control() & SSE_INEXACT)) + if (have_sse_unit && (sse_get_control() & SSE_INEXACT)) { return 1; + } #endif return 0; } diff -Nru ppl-1.1/src/fpu-none_inlines.hh ppl-1.2/src/fpu-none_inlines.hh --- ppl-1.1/src/fpu-none_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/fpu-none_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Null floating point unit related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/fpu-sparc_inlines.hh ppl-1.2/src/fpu-sparc_inlines.hh --- ppl-1.1/src/fpu-sparc_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/fpu-sparc_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* SPARC floating point unit related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/fpu_types.hh ppl-1.2/src/fpu_types.hh --- ppl-1.1/src/fpu_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/fpu_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Generator.cc ppl-1.2/src/Generator.cc --- ppl-1.1/src/Generator.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Generator.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Generator class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -57,9 +57,10 @@ PPL::Generator::point(const Linear_Expression& e, Coefficient_traits::const_reference d, Representation r) { - if (d == 0) + if (d == 0) { throw std::invalid_argument("PPL::point(e, d):\n" "d == 0."); + } Linear_Expression ec(e, r); ec.set_inhomogeneous_term(d); Generator g(ec, Generator::POINT, NECESSARILY_CLOSED); @@ -67,8 +68,9 @@ // If the divisor is negative, we negate it as well as // all the coefficients of the point, because we want to preserve // the invariant: the divisor of a point is strictly positive. - if (d < 0) + if (d < 0) { neg_assign(g.expr); + } // Enforce normalization. g.expr.normalize(); @@ -90,9 +92,10 @@ PPL::Generator::closure_point(const Linear_Expression& e, Coefficient_traits::const_reference d, Representation r) { - if (d == 0) + if (d == 0) { throw std::invalid_argument("PPL::closure_point(e, d):\n" "d == 0."); + } Linear_Expression ec(e, r); ec.set_inhomogeneous_term(d); @@ -101,8 +104,9 @@ // If the divisor is negative, we negate it as well as // all the coefficients of the point, because we want to preserve // the invariant: the divisor of a point is strictly positive. - if (d < 0) + if (d < 0) { neg_assign(g.expr); + } // Enforce normalization. g.expr.normalize(); @@ -123,9 +127,10 @@ PPL::Generator PPL::Generator::ray(const Linear_Expression& e, Representation r) { // The origin of the space cannot be a ray. - if (e.all_homogeneous_terms_are_zero()) + if (e.all_homogeneous_terms_are_zero()) { throw std::invalid_argument("PPL::ray(e):\n" "e == 0, but the origin cannot be a ray."); + } Linear_Expression ec(e, r); ec.set_inhomogeneous_term(0); @@ -137,9 +142,10 @@ PPL::Generator PPL::Generator::line(const Linear_Expression& e, Representation r) { // The origin of the space cannot be a line. - if (e.all_homogeneous_terms_are_zero()) + if (e.all_homogeneous_terms_are_zero()) { throw std::invalid_argument("PPL::line(e):\n" "e == 0, but the origin cannot be a line."); + } Linear_Expression ec(e, r); ec.set_inhomogeneous_term(0); @@ -167,8 +173,9 @@ // Become a point. set_is_ray_or_point(); expr.set_inhomogeneous_term(1); - if (is_not_necessarily_closed()) + if (is_not_necessarily_closed()) { set_epsilon_coefficient(1); + } PPL_ASSERT(OK()); return false; @@ -183,9 +190,10 @@ void PPL::Generator ::permute_space_dimensions(const std::vector& cycle) { - if (cycle.size() < 2) + if (cycle.size() < 2) { // No-op. No need to call sign_normalize(). return; + } expr.permute_space_dimensions(cycle); @@ -206,9 +214,10 @@ PPL::compare(const Generator& x, const Generator& y) { const bool x_is_line_or_equality = x.is_line_or_equality(); const bool y_is_line_or_equality = y.is_line_or_equality(); - if (x_is_line_or_equality != y_is_line_or_equality) + if (x_is_line_or_equality != y_is_line_or_equality) { // Equalities (lines) precede inequalities (ray/point). return y_is_line_or_equality ? 2 : -2; + } return compare(x.expr, y.expr); } @@ -217,12 +226,14 @@ PPL::Generator::is_equivalent_to(const Generator& y) const { const Generator& x = *this; const dimension_type x_space_dim = x.space_dimension(); - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } const Type x_type = x.type(); - if (x_type != y.type()) + if (x_type != y.type()) { return false; + } if (x_type == POINT && !(x.is_necessarily_closed() && y.is_necessarily_closed())) { @@ -251,8 +262,9 @@ void PPL::Generator::sign_normalize() { - if (is_line_or_equality()) + if (is_line_or_equality()) { expr.sign_normalize(); + } } bool @@ -322,28 +334,35 @@ i_end = expr.lower_bound(Variable(num_variables)); i != i_end; ++i) { c = *i; if (!first) { - if (c > 0) + if (c > 0) { s << " + "; + } else { s << " - "; neg_assign(c); } } - else + else { first = false; - if (c == -1) + } + if (c == -1) { s << "-"; - else if (c != 1) + } + else if (c != 1) { s << c << "*"; + } IO_Operators::operator<<(s, i.variable()); } - if (first) + if (first) { // A point or closure point in the origin. s << 0; - if (extra_parentheses) + } + if (extra_parentheses) { s << ")"; - if (needed_divisor) + } + if (needed_divisor) { s << "/" << expr.inhomogeneous_term(); + } s << ")"; } @@ -470,7 +489,7 @@ #endif return false; } - if (!is_necessarily_closed()) + if (!is_necessarily_closed()) { if (epsilon_coefficient() <= 0) { #ifndef NDEBUG std::cerr << "In the NNC topology, points must have epsilon > 0" @@ -478,6 +497,7 @@ #endif return false; } + } break; case CLOSURE_POINT: diff -Nru ppl-1.1/src/Generator_defs.hh ppl-1.2/src/Generator_defs.hh --- ppl-1.1/src/Generator_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Generator_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Generator class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Generator_inlines.hh ppl-1.2/src/Generator_inlines.hh --- ppl-1.1/src/Generator_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Generator_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Generator class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -73,8 +73,9 @@ inline void Generator::set_topology(Topology x) { - if (topology() == x) + if (topology() == x) { return; + } if (topology() == NECESSARILY_CLOSED) { // Add a column for the epsilon dimension. expr.set_space_dimension(expr.space_dimension() + 1); @@ -124,10 +125,12 @@ : expr(r), kind_(kind), topology_(topology) { - if (is_necessarily_closed()) + if (is_necessarily_closed()) { expr.set_space_dimension(space_dim); - else + } + else { expr.set_space_dimension(space_dim + 1); + } PPL_ASSERT(space_dimension() == space_dim); PPL_ASSERT(OK()); } @@ -137,12 +140,15 @@ : topology_(topology) { PPL_ASSERT(type != CLOSURE_POINT || topology == NOT_NECESSARILY_CLOSED); swap(expr, e); - if (topology == NOT_NECESSARILY_CLOSED) + if (topology == NOT_NECESSARILY_CLOSED) { expr.set_space_dimension(expr.space_dimension() + 1); - if (type == LINE) + } + if (type == LINE) { kind_ = LINE_OR_EQUALITY; - else + } + else { kind_ = RAY_OR_POINT_OR_INEQUALITY; + } strong_normalize(); } @@ -151,8 +157,9 @@ : kind_(kind), topology_(topology) { swap(expr, e); - if (topology == NOT_NECESSARILY_CLOSED) + if (topology == NOT_NECESSARILY_CLOSED) { expr.set_space_dimension(expr.space_dimension() + 1); + } strong_normalize(); } @@ -236,8 +243,9 @@ } } PPL_ASSERT(space_dimension() == space_dim); - if (expr.space_dimension() < old_expr_space_dim) + if (expr.space_dimension() < old_expr_space_dim) { strong_normalize(); + } } inline void @@ -273,18 +281,23 @@ inline Generator::Type Generator::type() const { - if (is_line()) + if (is_line()) { return LINE; - if (is_line_or_ray()) + } + if (is_line_or_ray()) { return RAY; - if (is_necessarily_closed()) + } + if (is_necessarily_closed()) { return POINT; + } else { // Checking the value of the epsilon coefficient. - if (epsilon_coefficient() == 0) + if (epsilon_coefficient() == 0) { return CLOSURE_POINT; - else + } + else { return POINT; + } } } @@ -310,17 +323,19 @@ inline Coefficient_traits::const_reference Generator::coefficient(const Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { throw_dimension_incompatible("coefficient(v)", "v", v); + } return expr.coefficient(v); } inline Coefficient_traits::const_reference Generator::divisor() const { Coefficient_traits::const_reference d = expr.inhomogeneous_term(); - if (!is_ray_or_point() || d == 0) + if (!is_ray_or_point() || d == 0) { throw_invalid_argument("divisor()", "*this is neither a point nor a closure point"); + } return d; } @@ -436,7 +451,7 @@ expr.ascii_dump(s); s << " "; - + switch (type()) { case Generator::LINE: s << "L "; @@ -451,10 +466,12 @@ s << "C "; break; } - if (is_necessarily_closed()) + if (is_necessarily_closed()) { s << "(C)"; - else + } + else { s << "(NNC)"; + } s << "\n"; } @@ -464,51 +481,63 @@ expr.ascii_load(s); - if (!(s >> str)) + if (!(s >> str)) { return false; - if (str == "L") + } + if (str == "L") { set_is_line(); - else if (str == "R" || str == "P" || str == "C") + } + else if (str == "R" || str == "P" || str == "C") { set_is_ray_or_point(); - else + } + else { return false; + } std::string str2; - if (!(s >> str2)) + if (!(s >> str2)) { return false; + } if (str2 == "(C)") { - if (is_not_necessarily_closed()) + if (is_not_necessarily_closed()) { // TODO: Avoid using the mark_as_*() methods if possible. mark_as_necessarily_closed(); + } } else { if (str2 == "(NNC)") { - if (is_necessarily_closed()) + if (is_necessarily_closed()) { // TODO: Avoid using the mark_as_*() methods if possible. mark_as_not_necessarily_closed(); + } } - else + else { return false; + } } // Checking for equality of actual and declared types. switch (type()) { case Generator::LINE: - if (str != "L") + if (str != "L") { return false; + } break; case Generator::RAY: - if (str != "R") + if (str != "R") { return false; + } break; case Generator::POINT: - if (str != "P") + if (str != "P") { return false; + } break; case Generator::CLOSURE_POINT: - if (str != "C") + if (str != "C") { return false; + } break; } @@ -537,12 +566,14 @@ Temp& tmp2) { // Generator kind compatibility check: we only compute distances // between (closure) points. - if (x.is_line_or_ray() || y.is_line_or_ray()) + if (x.is_line_or_ray() || y.is_line_or_ray()) { return false; + } const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } // All zero-dim generators have distance zero. if (x_space_dim == 0) { diff -Nru ppl-1.1/src/Generator_System.cc ppl-1.2/src/Generator_System.cc --- ppl-1.1/src/Generator_System.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Generator_System.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Generator_System class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,7 @@ #include "Constraint_defs.hh" #include "Scalar_Products_defs.hh" #include "Scalar_Products_inlines.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -47,18 +47,22 @@ // can be converted to a NECESSARILY_CLOSED one // only if it does not contain closure points. // This check has to be performed under the user viewpoint. - if (has_closure_points()) + if (has_closure_points()) { return false; + } // For a correct implementation, we have to remove those // closure points that were matching a point (i.e., those // that are in the generator system, but are invisible to // the user). const Generator_System& gs = *this; - for (dimension_type i = 0; i < sys.num_rows(); ) - if (gs[i].is_closure_point()) + for (dimension_type i = 0; i < sys.num_rows(); ) { + if (gs[i].is_closure_point()) { sys.remove_row(i, false); - else + } + else { ++i; + } + } sys.set_necessarily_closed(); } else { @@ -125,13 +129,16 @@ bool PPL::Generator_System::has_closure_points() const { - if (sys.is_necessarily_closed()) + if (sys.is_necessarily_closed()) { return false; + } // Adopt the point of view of the user. for (Generator_System::const_iterator i = begin(), - this_end = end(); i != this_end; ++i) - if (i->is_closure_point()) + this_end = end(); i != this_end; ++i) { + if (i->is_closure_point()) { return true; + } + } return false; } @@ -147,8 +154,9 @@ for (dimension_type i = sys.rows.size(); i-- > 0; ) { Generator& gen = sys.rows[i]; - if (!gen.is_line_or_ray()) + if (!gen.is_line_or_ray()) { gen.set_epsilon_coefficient(gen.expr.inhomogeneous_term()); + } } PPL_ASSERT(sys.OK()); @@ -158,16 +166,20 @@ PPL::Generator_System::has_points() const { const Generator_System& gs = *this; // Avoiding the repeated tests on topology. - if (sys.is_necessarily_closed()) + if (sys.is_necessarily_closed()) { for (dimension_type i = sys.num_rows(); i-- > 0; ) { - if (!gs[i].is_line_or_ray()) + if (!gs[i].is_line_or_ray()) { return true; + } } + } else { // !is_necessarily_closed() - for (dimension_type i = sys.num_rows(); i-- > 0; ) - if (gs[i].epsilon_coefficient() != 0) - return true; + for (dimension_type i = sys.num_rows(); i-- > 0; ) { + if (gs[i].epsilon_coefficient() != 0) { + return true; + } + } } return false; } @@ -183,8 +195,9 @@ const Generator& p = *i_next; if (cp.is_closure_point() && p.is_point() - && cp.is_matching_closure_point(p)) + && cp.is_matching_closure_point(p)) { i = i_next; + } } } } @@ -206,9 +219,10 @@ // We are sure that the matrix has no pending rows // and that the new row is not a pending generator. PPL_ASSERT(sys.num_pending_rows() == 0); - if (sys.topology() == g.topology()) + if (sys.topology() == g.topology()) { sys.insert(g, Recycle_Input()); - else + } + else { // `*this' and `g' have different topologies. if (sys.is_necessarily_closed()) { convert_into_non_necessarily_closed(); @@ -226,19 +240,22 @@ // If it was a point, set the epsilon coordinate to 1 // (i.e., set the coefficient equal to the divisor). // Note: normalization is preserved. - if (!g.is_line_or_ray()) + if (!g.is_line_or_ray()) { g.set_epsilon_coefficient(g.expr.inhomogeneous_term()); + } // Inserting the new generator. sys.insert(g, Recycle_Input()); } + } PPL_ASSERT(OK()); } void PPL::Generator_System::insert_pending(Generator& g, Recycle_Input) { - if (sys.topology() == g.topology()) + if (sys.topology() == g.topology()) { sys.insert_pending(g, Recycle_Input()); - else + } + else { // `*this' and `g' have different topologies. if (sys.is_necessarily_closed()) { convert_into_non_necessarily_closed(); @@ -257,11 +274,13 @@ // If it was a point, set the epsilon coordinate to 1 // (i.e., set the coefficient equal to the divisor). // Note: normalization is preserved. - if (!g.is_line_or_ray()) + if (!g.is_line_or_ray()) { g.set_epsilon_coefficient(g.expr.inhomogeneous_term()); + } // Inserting the new generator. sys.insert_pending(g, Recycle_Input()); } + } PPL_ASSERT(OK()); } @@ -276,13 +295,17 @@ // that lines are at the top of the system. if (sys.is_sorted()) { const dimension_type nrows = sys.num_rows(); - for (dimension_type i = 0; i < nrows && gs[i].is_line(); ++i) + for (dimension_type i = 0; i < nrows && gs[i].is_line(); ++i) { ++n; + } } - else - for (dimension_type i = sys.num_rows(); i-- > 0 ; ) - if (gs[i].is_line()) + else { + for (dimension_type i = sys.num_rows(); i-- > 0 ; ) { + if (gs[i].is_line()) { ++n; + } + } + } return n; } @@ -297,14 +320,20 @@ // that rays and points are at the bottom of the system and // rays have the inhomogeneous term equal to zero. if (sys.is_sorted()) { - for (dimension_type i = sys.num_rows(); i != 0 && gs[--i].is_ray_or_point(); ) - if (gs[i].is_line_or_ray()) + for (dimension_type i = sys.num_rows(); + i != 0 && gs[--i].is_ray_or_point(); ) { + if (gs[i].is_line_or_ray()) { ++n; + } + } } - else - for (dimension_type i = sys.num_rows(); i-- > 0 ; ) - if (gs[i].is_ray()) + else { + for (dimension_type i = sys.num_rows(); i-- > 0 ; ) { + if (gs[i].is_ray()) { ++n; + } + } + } return n; } @@ -345,17 +374,20 @@ // the generator is a point. if (sp_sign == 0) { if (g.is_point()) { - if (first_point_or_nonsaturating_ray_sign == 2) + if (first_point_or_nonsaturating_ray_sign == 2) { // It is the first time that we find a point and // we have not found a non-saturating ray yet. first_point_or_nonsaturating_ray_sign = 0; - else + } + else { // We already found a point or a non-saturating ray. - if (first_point_or_nonsaturating_ray_sign != 0) + if (first_point_or_nonsaturating_ray_sign != 0) { return Poly_Con_Relation::strictly_intersects(); + } + } } } - else + else { // Here we know that sp_sign != 0. switch (g.type()) { @@ -374,8 +406,9 @@ } else // We already found a point or a non-saturating ray. - if (sp_sign != first_point_or_nonsaturating_ray_sign) + if (sp_sign != first_point_or_nonsaturating_ray_sign) { return Poly_Con_Relation::strictly_intersects(); + } break; case Generator::POINT: @@ -390,10 +423,12 @@ } else // We already found a point or a non-saturating ray. - if (sp_sign != first_point_or_nonsaturating_ray_sign) + if (sp_sign != first_point_or_nonsaturating_ray_sign) { return Poly_Con_Relation::strictly_intersects(); + } break; } + } } } break; @@ -416,19 +451,22 @@ // only if the generator is a point. if (sp_sign == 0) { if (g.is_point()) { - if (first_point_or_nonsaturating_ray) + if (first_point_or_nonsaturating_ray) { // It is the first time that we have a point and // we have not found a non-saturating ray yet. first_point_or_nonsaturating_ray = false; - else + } + else { // We already found a point or a non-saturating ray before. - if (result == Poly_Con_Relation::is_disjoint()) + if (result == Poly_Con_Relation::is_disjoint()) { // Since g saturates c, we have a strict intersection if // none of the generators seen so far are included in `c'. return Poly_Con_Relation::strictly_intersects(); + } + } } } - else + else { // Here we know that sp_sign != 0. switch (g.type()) { @@ -452,18 +490,20 @@ if ((sp_sign > 0 && result == Poly_Con_Relation::is_disjoint()) || (sp_sign < 0 - && result.implies(Poly_Con_Relation::is_included()))) + && result.implies(Poly_Con_Relation::is_included()))) { // We have a strict intersection if either: // - `g' satisfies `c' but none of the generators seen // so far are included in `c'; or // - `g' does not satisfy `c' and all the generators // seen so far are included in `c'. return Poly_Con_Relation::strictly_intersects(); - if (sp_sign > 0) + } + if (sp_sign > 0) { // Here all the generators seen so far either saturate // or are included in `c'. // Since `g' does not saturate `c' ... result = Poly_Con_Relation::is_included(); + } } break; @@ -481,31 +521,36 @@ // - If point `g' does not satisfy `c', then all the // generators seen so far are disjoint from `c'. first_point_or_nonsaturating_ray = false; - if (sp_sign > 0) + if (sp_sign > 0) { result = Poly_Con_Relation::is_included(); - else if (sp_sign < 0) + } + else if (sp_sign < 0) { result = Poly_Con_Relation::is_disjoint(); + } } else { // We already found a point or a non-saturating ray before. if ((sp_sign > 0 && result == Poly_Con_Relation::is_disjoint()) || (sp_sign < 0 - && result.implies(Poly_Con_Relation::is_included()))) + && result.implies(Poly_Con_Relation::is_included()))) { // We have a strict intersection if either: // - `g' satisfies or saturates `c' but none of the // generators seen so far are included in `c'; or // - `g' does not satisfy `c' and all the generators // seen so far are included in `c'. return Poly_Con_Relation::strictly_intersects(); - if (sp_sign > 0) + } + if (sp_sign > 0) { // Here all the generators seen so far either saturate // or are included in `c'. // Since `g' does not saturate `c' ... result = Poly_Con_Relation::is_included(); + } } break; } + } } } break; @@ -529,17 +574,20 @@ // only if the generator is a point. if (sp_sign == 0) { if (g.is_point()) { - if (first_point_or_nonsaturating_ray) + if (first_point_or_nonsaturating_ray) { // It is the first time that we have a point and // we have not found a non-saturating ray yet. first_point_or_nonsaturating_ray = false; - else + } + else { // We already found a point or a non-saturating ray before. - if (result == Poly_Con_Relation::is_included()) + if (result == Poly_Con_Relation::is_included()) { return Poly_Con_Relation::strictly_intersects(); + } + } } } - else + else { // Here we know that sp_sign != 0. switch (g.type()) { @@ -564,13 +612,15 @@ && result.implies(Poly_Con_Relation::is_disjoint())) || (sp_sign <= 0 - && result == Poly_Con_Relation::is_included())) + && result == Poly_Con_Relation::is_included())) { return Poly_Con_Relation::strictly_intersects(); - if (sp_sign < 0) + } + if (sp_sign < 0) { // Here all the generators seen so far either saturate // or are disjoint from `c'. // Since `g' does not saturate `c' ... result = Poly_Con_Relation::is_disjoint(); + } } break; @@ -586,10 +636,12 @@ // - If point `g' strictly violates `c', then all the // generators seen so far are disjoint from `c'. first_point_or_nonsaturating_ray = false; - if (sp_sign > 0) + if (sp_sign > 0) { result = Poly_Con_Relation::is_included(); - else if (sp_sign < 0) + } + else if (sp_sign < 0) { result = Poly_Con_Relation::is_disjoint(); + } } else { // We already found a point or a non-saturating ray before. @@ -597,16 +649,19 @@ && result.implies(Poly_Con_Relation::is_disjoint())) || (sp_sign <= 0 - && result == Poly_Con_Relation::is_included())) + && result == Poly_Con_Relation::is_included())) { return Poly_Con_Relation::strictly_intersects(); - if (sp_sign < 0) + } + if (sp_sign < 0) { // Here all the generators seen so far either saturate // or are disjoint from `c'. // Since `g' does not saturate `c' ... result = Poly_Con_Relation::is_disjoint(); + } } break; } + } } } break; @@ -629,9 +684,11 @@ switch (c.type()) { case Constraint::EQUALITY: // Equalities must be saturated by all generators. - for (dimension_type i = gs.sys.num_rows(); i-- > 0; ) - if (sps(c, gs[i]) != 0) + for (dimension_type i = gs.sys.num_rows(); i-- > 0; ) { + if (sps(c, gs[i]) != 0) { return false; + } + } break; case Constraint::NONSTRICT_INEQUALITY: // Non-strict inequalities must be saturated by lines and @@ -640,13 +697,15 @@ const Generator& g = gs[i]; const int sp_sign = sps(c, g); if (g.is_line()) { - if (sp_sign != 0) + if (sp_sign != 0) { return false; + } } else // `g' is a ray, point or closure point. - if (sp_sign < 0) + if (sp_sign < 0) { return false; + } } break; case Constraint::STRICT_INEQUALITY: @@ -657,17 +716,20 @@ const int sp_sign = sps(c, g); switch (g.type()) { case Generator::POINT: - if (sp_sign <= 0) + if (sp_sign <= 0) { return false; + } break; case Generator::LINE: - if (sp_sign != 0) + if (sp_sign != 0) { return false; + } break; default: // `g' is a ray or closure point. - if (sp_sign < 0) + if (sp_sign < 0) { return false; + } break; } } @@ -713,8 +775,9 @@ // valid lines and rays into the origin of the space. const bool not_invertible = (v.space_dimension() > expr.space_dimension() || expr.coefficient(v) == 0); - if (not_invertible) + if (not_invertible) { x.remove_invalid_lines_and_rays(); + } // TODO: Consider normalizing individual rows in the loop above. // Strong normalization also resets the sortedness flag. @@ -723,8 +786,9 @@ #ifndef NDEBUG // Make sure that the (remaining) generators are still OK after fiddling // with their internal data. - for (dimension_type i = x.num_rows(); i-- > 0; ) + for (dimension_type i = x.num_rows(); i-- > 0; ) { PPL_ASSERT(x.sys[i].OK()); + } #endif PPL_ASSERT(sys.OK()); @@ -739,8 +803,9 @@ bool PPL::Generator_System::ascii_load(std::istream& s) { - if (!sys.ascii_load(s)) + if (!sys.ascii_load(s)) { return false; + } PPL_ASSERT(OK()); return true; @@ -752,7 +817,7 @@ // NOTE: the following swaps will mix generators without even trying // to preserve sortedness: as a matter of fact, it will almost always // be the case that the input generator system is NOT sorted. - + // Note that num_rows() is *not* constant, because it is decreased by // remove_row(). for (dimension_type i = 0; i < num_rows(); ) { @@ -761,8 +826,9 @@ sys.remove_row(i, false); set_sorted(false); } - else + else { ++i; + } } } @@ -792,14 +858,15 @@ PPL::IO_Operators::operator<<(std::ostream& s, const Generator_System& gs) { Generator_System::const_iterator i = gs.begin(); const Generator_System::const_iterator gs_end = gs.end(); - if (i == gs_end) + if (i == gs_end) { return s << "false"; + } while (true) { s << *i; ++i; - if (i == gs_end) + if (i == gs_end) { return s; + } s << ", "; } } - diff -Nru ppl-1.1/src/Generator_System_defs.hh ppl-1.2/src/Generator_System_defs.hh --- ppl-1.1/src/Generator_System_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Generator_System_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Generator_System class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -33,6 +33,7 @@ #include "Poly_Con_Relation_defs.hh" #include "Polyhedron_types.hh" #include +#include namespace Parma_Polyhedra_Library { @@ -679,7 +680,7 @@ class Parma_Polyhedra_Library::Generator_System_const_iterator : public std::iterator { public: diff -Nru ppl-1.1/src/Generator_System_inlines.hh ppl-1.2/src/Generator_System_inlines.hh --- ppl-1.1/src/Generator_System_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Generator_System_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Generator_System class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -98,13 +98,15 @@ const dimension_type old_space_dim = space_dimension(); sys.set_space_dimension_no_ok(space_dim); - if (space_dim < old_space_dim) + if (space_dim < old_space_dim) { // We may have invalid lines and rays now. remove_invalid_lines_and_rays(); + } #ifndef NDEBUG - for (dimension_type i = 0; i < sys.num_rows(); ++i) + for (dimension_type i = 0; i < sys.num_rows(); ++i) { PPL_ASSERT(sys[i].OK()); + } #endif PPL_ASSERT(sys.OK()); PPL_ASSERT(OK()); @@ -320,8 +322,9 @@ inline Generator_System_const_iterator& Generator_System_const_iterator::operator++() { ++i; - if (!gsp->is_necessarily_closed()) + if (!gsp->is_necessarily_closed()) { skip_forward(); + } return *this; } @@ -362,8 +365,9 @@ inline Generator_System::const_iterator Generator_System::begin() const { const_iterator i(sys.begin(), *this); - if (!sys.is_necessarily_closed()) + if (!sys.is_necessarily_closed()) { i.skip_forward(); + } return i; } diff -Nru ppl-1.1/src/Generator_System_types.hh ppl-1.2/src/Generator_System_types.hh --- ppl-1.1/src/Generator_System_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Generator_System_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Generator_types.hh ppl-1.2/src/Generator_types.hh --- ppl-1.1/src/Generator_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Generator_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/globals.cc ppl-1.2/src/globals.cc --- ppl-1.1/src/globals.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/globals.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Definitions of global objects. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,6 +28,9 @@ namespace Parma_Polyhedra_Library { +Throwable::~Throwable() { +} + const Throwable* volatile abandon_expensive_computations = 0; // Initialize Weightwatch_Traits static data members. diff -Nru ppl-1.1/src/globals_defs.hh ppl-1.2/src/globals_defs.hh --- ppl-1.1/src/globals_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/globals_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Declarations of global objects. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -82,14 +82,16 @@ #define WEIGHT_ADD(delta) \ do { \ - if (!In_Assert::asserting()) \ + if (!In_Assert::asserting()) { \ Weightwatch_Traits::weight += delta; \ + } \ } while (false) #define WEIGHT_ADD_MUL(delta, factor) \ do { \ - if (!In_Assert::asserting()) \ + if (!In_Assert::asserting()) { \ Weightwatch_Traits::weight += delta * factor; \ + } \ } while (false) #endif // !defined(NDEBUG) diff -Nru ppl-1.1/src/globals_inlines.hh ppl-1.2/src/globals_inlines.hh --- ppl-1.1/src/globals_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/globals_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Implementation of global objects: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -58,10 +58,11 @@ inline Weightwatch_Traits::Delta Weightwatch_Traits::compute_delta(unsigned long unscaled, unsigned scale) { - if ((std::numeric_limits::max() >> scale) < unscaled) + if ((std::numeric_limits::max() >> scale) < unscaled) { throw std::invalid_argument("PPL::Weightwatch_Traits::" "compute_delta(u, s):\n" "values of u and s cause wrap around."); + } return static_cast(unscaled) << scale; } @@ -70,20 +71,19 @@ threshold = weight + delta; } -inline -Throwable::~Throwable() { -} - inline void maybe_abandon() { #ifndef NDEBUG - if (In_Assert::asserting()) + if (In_Assert::asserting()) { return; + } #endif - if (Weightwatch_Traits::check_function != 0) + if (Weightwatch_Traits::check_function != 0) { Weightwatch_Traits::check_function(); - if (const Throwable* const p = abandon_expensive_computations) + } + if (const Throwable* const p = abandon_expensive_computations) { p->throw_me(); + } } inline dimension_type @@ -138,17 +138,20 @@ inline void ascii_dump(std::ostream& s, Representation r) { - if (r == DENSE) + if (r == DENSE) { s << "DENSE"; - else + } + else { s << "SPARSE"; + } } inline bool ascii_load(std::istream& is, Representation& r) { std::string s; - if (!(is >> s)) + if (!(is >> s)) { return false; + } if (s == "DENSE") { r = DENSE; diff -Nru ppl-1.1/src/globals_types.hh ppl-1.2/src/globals_types.hh --- ppl-1.1/src/globals_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/globals_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/GMP_Integer_defs.hh ppl-1.2/src/GMP_Integer_defs.hh --- ppl-1.1/src/GMP_Integer_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/GMP_Integer_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* GMP_Integer class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/GMP_Integer_inlines.hh ppl-1.2/src/GMP_Integer_inlines.hh --- ppl-1.1/src/GMP_Integer_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/GMP_Integer_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* GMP_Integer class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,7 +24,7 @@ #ifndef PPL_GMP_Integer_inlines_hh #define PPL_GMP_Integer_inlines_hh 1 -#include "assert.hh" +#include "assertions.hh" namespace Parma_Polyhedra_Library { diff -Nru ppl-1.1/src/GMP_Integer_types.hh ppl-1.2/src/GMP_Integer_types.hh --- ppl-1.1/src/GMP_Integer_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/GMP_Integer_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without @@ -14,8 +14,8 @@ #define PPL_GMP_Integer_types_hh 1 #include "Coefficient_traits_template.hh" -#include #include "mp_std_bits_defs.hh" +#include namespace Parma_Polyhedra_Library { diff -Nru ppl-1.1/src/Grid_Certificate.cc ppl-1.2/src/Grid_Certificate.cc --- ppl-1.1/src/Grid_Certificate.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Certificate.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Grid_Certificate class implementation (non-inline member functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,7 +25,7 @@ #include "ppl-config.h" #include "Grid_Certificate_defs.hh" #include "Grid_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace PPL = Parma_Polyhedra_Library; @@ -35,15 +35,16 @@ // As in Polyhedron assume that `gr' contains at least one point. PPL_ASSERT(!gr.marked_empty()); - if (gr.space_dimension() == 0) + if (gr.space_dimension() == 0) { return; + } // One of the systems must be in minimal form. if (gr.congruences_are_up_to_date()) { if (gr.congruences_are_minimized()) { num_proper_congruences = gr.con_sys.num_proper_congruences(); num_equalities = gr.con_sys.num_equalities(); } - else + else { if (gr.generators_are_up_to_date() && gr.generators_are_minimized()) { // Calculate number of congruences from generators. num_proper_congruences @@ -63,6 +64,7 @@ num_proper_congruences = mgr.con_sys.num_proper_congruences(); num_equalities = mgr.con_sys.num_equalities(); } + } } else { if (!gr.generators_are_minimized()) { @@ -87,10 +89,12 @@ PPL::Grid_Certificate::compare(const Grid_Certificate& y) const { PPL_ASSERT(OK() && y.OK()); if (num_equalities == y.num_equalities) { - if (num_proper_congruences == y.num_proper_congruences) + if (num_proper_congruences == y.num_proper_congruences) { return 0; - else + } + else { return (num_proper_congruences > y.num_proper_congruences) ? 1 : -1; + } } return (num_equalities > y.num_equalities) ? 1 : -1; } diff -Nru ppl-1.1/src/Grid_Certificate_defs.hh ppl-1.2/src/Grid_Certificate_defs.hh --- ppl-1.1/src/Grid_Certificate_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Certificate_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid_Certificate class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,7 +28,6 @@ #include "Grid_types.hh" #include "globals_defs.hh" -#include "assert.hh" #include //! The convergence certificate for the Grid widening operator. diff -Nru ppl-1.1/src/Grid_Certificate_inlines.hh ppl-1.2/src/Grid_Certificate_inlines.hh --- ppl-1.1/src/Grid_Certificate_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Certificate_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid_Certificate class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,6 +24,8 @@ #ifndef PPL_Grid_Certificate_inlines_hh #define PPL_Grid_Certificate_inlines_hh 1 +#include "assertions.hh" + namespace Parma_Polyhedra_Library { inline diff -Nru ppl-1.1/src/Grid_Certificate_types.hh ppl-1.2/src/Grid_Certificate_types.hh --- ppl-1.1/src/Grid_Certificate_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Certificate_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Grid_chdims.cc ppl-1.2/src/Grid_chdims.cc --- ppl-1.1/src/Grid_chdims.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_chdims.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Grid class implementation (non-inline operators that may change the dimension of the vector space). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,7 +25,7 @@ #include "ppl-config.h" #include "Grid_defs.hh" #include "Variables_Set_defs.hh" -#include "assert.hh" +#include "assertions.hh" namespace PPL = Parma_Polyhedra_Library; @@ -40,8 +40,9 @@ const dimension_type old_modulus_index = cgs.space_dimension() + 1; cgs.set_space_dimension(space_dimension() + dims); - if (congruences_are_minimized() || generators_are_minimized()) + if (congruences_are_minimized() || generators_are_minimized()) { dim_kinds.resize(old_modulus_index + dims, CON_VIRTUAL /* a.k.a. LINE */); + } gs.add_universe_rows_and_columns(dims); } @@ -74,8 +75,9 @@ // R^1 R^2 void PPL::Grid::add_space_dimensions_and_embed(dimension_type m) { - if (m == 0) + if (m == 0) { return; + } // The space dimension of the resulting grid must be at most the // maximum allowed space dimension. @@ -111,22 +113,26 @@ // dimensions. That is, for each new dimension we add the line // having that direction. This is done by invoking the function // add_space_dimensions(). - if (congruences_are_up_to_date()) - if (generators_are_up_to_date()) + if (congruences_are_up_to_date()) { + if (generators_are_up_to_date()) { // Adds rows and/or columns to both matrices. add_space_dimensions(con_sys, gen_sys, m); + } else { // Only congruences are up-to-date, so modify only them. con_sys.set_space_dimension(con_sys.space_dimension() + m); - if (congruences_are_minimized()) + if (congruences_are_minimized()) { dim_kinds.resize(con_sys.space_dimension() + 1, CON_VIRTUAL); + } } + } else { // Only generators are up-to-date, so modify only them. PPL_ASSERT(generators_are_up_to_date()); gen_sys.add_universe_rows_and_columns(m); - if (generators_are_minimized()) + if (generators_are_minimized()) { dim_kinds.resize(gen_sys.space_dimension() + 1, LINE); + } } // Update the space dimension. space_dim += m; @@ -146,8 +152,9 @@ // R^1 R^2 void PPL::Grid::add_space_dimensions_and_project(dimension_type m) { - if (m == 0) + if (m == 0) { return; + } // The space dimension of the resulting grid should be at most the // maximum allowed space dimension. @@ -180,16 +187,19 @@ // for each new dimensions `x[k]', we add the constraint x[k] = 0; // this is done by invoking the function add_space_dimensions() // giving the system of constraints as the second argument. - if (congruences_are_up_to_date()) - if (generators_are_up_to_date()) + if (congruences_are_up_to_date()) { + if (generators_are_up_to_date()) { // Add rows and/or columns to both matrices. add_space_dimensions(gen_sys, con_sys, m); + } else { // Only congruences are up-to-date so modify only them. con_sys.add_unit_rows_and_space_dimensions(m); - if (congruences_are_minimized()) + if (congruences_are_minimized()) { dim_kinds.resize(con_sys.space_dimension() + 1, EQUALITY); + } } + } else { // Only generators are up-to-date so modify only them. PPL_ASSERT(generators_are_up_to_date()); @@ -199,8 +209,9 @@ normalize_divisors(gen_sys); - if (generators_are_minimized()) + if (generators_are_minimized()) { dim_kinds.resize(gen_sys.space_dimension() + 1, EQUALITY); + } } // Now update the space dimension. space_dim += m; @@ -232,8 +243,9 @@ } // If `y' is a universe 0-dim grid, the result is `*this'. - if (added_columns == 0) + if (added_columns == 0) { return; + } // If `*this' is a universe 0-dim space grid, the result is `y'. if (space_dim == 0) { @@ -241,8 +253,9 @@ return; } - if (!congruences_are_up_to_date()) + if (!congruences_are_up_to_date()) { update_congruences(); + } con_sys.concatenate(y.congruences()); @@ -268,8 +281,9 @@ // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dim < min_space_dim) + if (space_dim < min_space_dim) { throw_dimension_incompatible("remove_space_dimensions(vs)", min_space_dim); + } const dimension_type new_space_dim = space_dim - vars.size(); @@ -303,10 +317,10 @@ void PPL::Grid::remove_higher_space_dimensions(const dimension_type new_dimension) { // Dimension-compatibility check. - if (new_dimension > space_dim) + if (new_dimension > space_dim) { throw_dimension_incompatible("remove_higher_space_dimensions(nd)", new_dimension); - + } // The removal of no dimensions from any grid is a no-op. // Note that this case also captures the only legal removal of // dimensions from a grid in a 0-dim space. @@ -339,8 +353,9 @@ dimension_type num_redundant = 0; const dimension_type num_old_gs = space_dim - new_dimension; for (dimension_type row = 0; row < num_old_gs; ++row) { - if (dim_kinds[row] != GEN_VIRTUAL) + if (dim_kinds[row] != GEN_VIRTUAL) { ++num_redundant; + } } if (num_redundant > 0) { // Chop zero rows from end of system, to keep minimal form. @@ -365,8 +380,9 @@ // Count the actual number of rows that are now redundant. dimension_type num_redundant = 0; for (dimension_type row = space_dim; row > new_dimension; --row) { - if (dim_kinds[row] != CON_VIRTUAL) + if (dim_kinds[row] != CON_VIRTUAL) { ++num_redundant; + } } con_sys.remove_rows(0, num_redundant, true); @@ -389,12 +405,14 @@ void PPL::Grid::expand_space_dimension(Variable var, dimension_type m) { // `var' must be one of the dimensions of the vector space. - if (var.space_dimension() > space_dim) + if (var.space_dimension() > space_dim) { throw_dimension_incompatible("expand_space_dimension(v, m)", "v", var); + } // Adding 0 dimensions leaves the same grid. - if (m == 0) + if (m == 0) { return; + } // The resulting space dimension must be at most the maximum. check_space_dimension_overflow(m, max_space_dimension() - space_dimension(), @@ -418,8 +436,9 @@ Coefficient_traits::const_reference coeff = cg.coefficient(var); // Only consider congruences that constrain `var'. - if (coeff == 0) + if (coeff == 0) { continue; + } Congruence cg_copy = cg; cg_copy.expr.set_coefficient(var, Coefficient_zero()); @@ -440,23 +459,27 @@ // TODO: this implementation is _really_ an executable specification. // `dest' should be one of the dimensions of the grid. - if (dest.space_dimension() > space_dim) + if (dest.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", "v", dest); + } // Folding only has effect if dimensions are given. - if (vars.empty()) + if (vars.empty()) { return; + } // All variables in `vars' must be dimensions of the grid. - if (vars.space_dimension() > space_dim) + if (vars.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", "vs.space_dimension()", vars.space_dimension()); + } // Moreover, `dest.id()' must not occur in `vars'. - if (vars.find(dest.id()) != vars.end()) + if (vars.find(dest.id()) != vars.end()) { throw_invalid_argument("fold_space_dimensions(vs, v)", "v should not occur in vs"); + } // All of the affine images we are going to compute are not invertible, // hence we will need to compute the grid generators of the polyhedron. // Since we keep taking copies, make sure that a single conversion diff -Nru ppl-1.1/src/Grid_conversion.cc ppl-1.2/src/Grid_conversion.cc --- ppl-1.1/src/Grid_conversion.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_conversion.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid class implementation: conversion(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -39,22 +39,26 @@ const dimension_type num_columns = sys.space_dimension() + 1; // Check for easy square failure case. - if (sys.num_rows() > num_columns) + if (sys.num_rows() > num_columns) { return false; + } // Check triangularity. dimension_type row = 0; for (dimension_type dim = num_columns; dim-- > 0; ) { - if (dim_kinds[dim] == CON_VIRTUAL) + if (dim_kinds[dim] == CON_VIRTUAL) { continue; + } const Congruence& cg = sys[row]; ++row; // Check diagonal. - if (cg.expr.get(dim) <= 0) + if (cg.expr.get(dim) <= 0) { return false; - if (!cg.expr.all_zeroes(dim + 1, num_columns)) + } + if (!cg.expr.all_zeroes(dim + 1, num_columns)) { return false; + } } // Check squareness. @@ -74,21 +78,25 @@ dimension_type row = sys.num_rows(); // Check for easy square fail case. - if (row > num_columns) + if (row > num_columns) { return false; + } // Check triangularity. while (num_columns > 0) { --num_columns; - if (dim_kinds[num_columns] == GEN_VIRTUAL) + if (dim_kinds[num_columns] == GEN_VIRTUAL) { continue; + } const Grid_Generator& gen = sys[--row]; // Check diagonal. - if (gen.expr.get(num_columns) <= 0) + if (gen.expr.get(num_columns) <= 0) { return false; + } // Check elements preceding diagonal. - if (!gen.expr.all_zeroes(0, num_columns)) + if (!gen.expr.all_zeroes(0, num_columns)) { return false; + } } // Check for squareness. @@ -99,8 +107,9 @@ Grid::multiply_grid(const Coefficient& multiplier, Grid_Generator& gen, Swapping_Vector& dest_rows, const dimension_type num_rows) { - if (multiplier == 1) + if (multiplier == 1) { return; + } if (gen.is_line()) { // Multiply every element of the line. @@ -112,8 +121,9 @@ for (dimension_type index = num_rows; index-- > 0; ) { Grid_Generator& generator = dest_rows[index]; - if (generator.is_parameter_or_point()) + if (generator.is_parameter_or_point()) { generator.expr *= multiplier; + } } } } @@ -122,15 +132,17 @@ Grid::multiply_grid(const Coefficient& multiplier, Congruence& cg, Swapping_Vector& dest, const dimension_type num_rows) { - if (multiplier == 1) + if (multiplier == 1) { return; + } if (cg.is_proper_congruence()) { // Multiply every element of every congruence. for (dimension_type index = num_rows; index-- > 0; ) { Congruence& congruence = dest[index]; - if (congruence.is_proper_congruence()) + if (congruence.is_proper_congruence()) { congruence.scale(multiplier); + } } } else { @@ -163,10 +175,11 @@ diagonal_lcm = 1; const dimension_type dims = source.space_dimension() + 1; dimension_type source_index = source.num_rows(); - for (dimension_type dim = dims; dim-- > 0; ) - if (dim_kinds[dim] == GEN_VIRTUAL) + for (dimension_type dim = dims; dim-- > 0; ) { + if (dim_kinds[dim] == GEN_VIRTUAL) { // Virtual generators map to equalities. ++dest_num_rows; + } else { --source_index; if (dim_kinds[dim] == PARAMETER) { @@ -179,6 +192,7 @@ } // Lines map to virtual congruences. } + } PPL_ASSERT(source_index == 0); // `source' must be regular. @@ -192,8 +206,9 @@ // diagonal elements. source_index = source.num_rows(); for (dimension_type dim = dims; dim-- > 0; ) { - if (dim_kinds[dim] == LINE) + if (dim_kinds[dim] == LINE) { --source_index; + } else { Linear_Expression le; le.set_space_dimension(dest.space_dimension()); @@ -258,13 +273,14 @@ // rows in `dest' that follow `dim_index' have zeroes at index // `dim'. dimension_type tmp_source_index = source_index; - if (dim_kinds[dim] != LINE) + if (dim_kinds[dim] != LINE) { ++dest_index; + } for (dimension_type dim_prec = dim; dim_prec-- > 0; ) { if (dim_kinds[dim_prec] != GEN_VIRTUAL) { --tmp_source_index; const Coefficient& source_dim = source[tmp_source_index].expr.get(dim); - + // In order to compute the transpose of the inverse of // `source', subtract source[tmp_source_index][dim] times the // column vector in `dest' at `dim' from the column vector in @@ -289,8 +305,9 @@ = dest.rows[dest_num_rows - 1].inhomogeneous_term(); for (dimension_type row = dest_num_rows; row-- > 0; ) { Congruence& cg = dest.rows[row]; - if (cg.is_proper_congruence()) + if (cg.is_proper_congruence()) { cg.set_modulus(modulus); + } } PPL_ASSERT(lower_triangular(dest, dim_kinds)); @@ -298,16 +315,19 @@ // Since we are reducing the system to "strong minimal form", // reduce the coefficients in the congruence system // using "diagonal" values. - for (dimension_type dim = dims, i = 0; dim-- > 0; ) - if (dim_kinds[dim] != CON_VIRTUAL) + for (dimension_type dim = dims, i = 0; dim-- > 0; ) { + if (dim_kinds[dim] != CON_VIRTUAL) { // Factor the "diagonal" congruence out of the preceding rows. reduce_reduced (dest.rows, dim, i++, 0, dim, dim_kinds, false); + } + } #ifndef NDEBUG // Make sure that all the rows are now OK. - for (dimension_type i = dest.num_rows(); i-- > 0; ) + for (dimension_type i = dest.num_rows(); i-- > 0; ) { PPL_ASSERT(dest[i].OK()); + } #endif PPL_ASSERT(dest.OK()); @@ -328,10 +348,11 @@ PPL_DIRTY_TEMP_COEFFICIENT(diagonal_lcm); diagonal_lcm = 1; const dimension_type dims = source.space_dimension() + 1; - for (dimension_type dim = dims; dim-- > 0; ) - if (dim_kinds[dim] == CON_VIRTUAL) + for (dimension_type dim = dims; dim-- > 0; ) { + if (dim_kinds[dim] == CON_VIRTUAL) { // Virtual congruences map to lines. ++dest_num_rows; + } else { if (dim_kinds[dim] == PROPER_CONGRUENCE) { // Dimension `dim' has a proper congruence row at @@ -345,6 +366,7 @@ ++source_num_rows; } + } // `source' must be regular. PPL_ASSERT(diagonal_lcm != 0); @@ -437,8 +459,9 @@ // rows in `dest' that follow row `dest_index' are zero at index // `dim'. dimension_type tmp_source_index = source_index; - if (dim_kinds[dim] != EQUALITY) + if (dim_kinds[dim] != EQUALITY) { ++dest_index; + } for (dimension_type dim_fol = dim + 1; dim_fol < dims; ++dim_fol) { if (dim_kinds[dim_fol] != CON_VIRTUAL) { --tmp_source_index; @@ -474,10 +497,11 @@ // reduce the coordinates in the grid_generator system // using "diagonal" values. for (dimension_type dim = 0, i = 0; dim < dims; ++dim) { - if (dim_kinds[dim] != GEN_VIRTUAL) + if (dim_kinds[dim] != GEN_VIRTUAL) { // Factor the "diagonal" generator out of the preceding rows. reduce_reduced (dest.sys.rows, dim, i++, dim, dims - 1, dim_kinds); + } } // Ensure that the parameter divisors are the same as the divisor of @@ -501,8 +525,9 @@ #ifndef NDEBUG // The previous code can modify the rows' fields, exploiting the friendness. // Check that all rows are OK now. - for (dimension_type i = dest.sys.rows.size(); i-- > 0; ) + for (dimension_type i = dest.sys.rows.size(); i-- > 0; ) { PPL_ASSERT(dest.sys.rows[i].OK()); + } #endif PPL_ASSERT(dest.sys.OK()); diff -Nru ppl-1.1/src/Grid_defs.hh ppl-1.2/src/Grid_defs.hh --- ppl-1.1/src/Grid_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Grid_Generator.cc ppl-1.2/src/Grid_Generator.cc --- ppl-1.1/src/Grid_Generator.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Generator.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid_Generator class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -56,9 +56,10 @@ PPL::Grid_Generator::parameter(const Linear_Expression& e, Coefficient_traits::const_reference d, Representation r) { - if (d == 0) + if (d == 0) { throw std::invalid_argument("PPL::parameter(e, d):\n" "d == 0."); + } // Add 1 to space dimension to allow for parameter divisor column. Linear_Expression ec(e, e.space_dimension() + 1, r); @@ -68,8 +69,9 @@ // If the divisor is negative, negate it and all the coefficients of // the parameter, so as to satisfy the invariant. - if (d < 0) + if (d < 0) { neg_assign(ec); + } // Using this constructor saves reallocation when creating the // coefficients. @@ -84,17 +86,19 @@ PPL::Grid_Generator::grid_point(const Linear_Expression& e, Coefficient_traits::const_reference d, Representation r) { - if (d == 0) + if (d == 0) { throw std::invalid_argument("PPL::grid_point(e, d):\n" "d == 0."); + } // Add 1 to space dimension to allow for parameter divisor column. Linear_Expression ec(e, 1 + e.space_dimension(), r); ec.set_inhomogeneous_term(d); // If the divisor is negative, negate it and all the coefficients of // the point, so as to satisfy the invariant. - if (d < 0) + if (d < 0) { neg_assign(ec); + } // Using this constructor saves reallocation when creating the // coefficients. @@ -119,9 +123,10 @@ PPL::Grid_Generator PPL::Grid_Generator::grid_line(const Linear_Expression& e, Representation r) { // The origin of the space cannot be a line. - if (e.all_homogeneous_terms_are_zero()) + if (e.all_homogeneous_terms_are_zero()) { throw std::invalid_argument("PPL::grid_line(e):\n" "e == 0, but the origin cannot be a line."); + } // Add 1 to space dimension to allow for parameter divisor column. Linear_Expression ec(e, 1 + e.space_dimension(), r); @@ -141,15 +146,16 @@ PPL_ASSERT(v2.space_dimension() <= space_dimension()); expr.swap_space_dimensions(v1, v2); // *this is still normalized but it may not be strongly normalized. - if (!is_parameter()) + if (!is_parameter()) { sign_normalize(); + } PPL_ASSERT(OK()); } bool PPL::Grid_Generator::remove_space_dimensions(const Variables_Set& vars) { PPL_ASSERT(vars.space_dimension() <= space_dimension()); - + expr.remove_space_dimensions(vars); PPL_ASSERT(OK()); @@ -159,9 +165,10 @@ void PPL::Grid_Generator ::permute_space_dimensions(const std::vector& cycle) { - if (cycle.size() < 2) + if (cycle.size() < 2) { // No-op. No need to call sign_normalize(). return; + } expr.permute_space_dimensions(cycle); @@ -169,8 +176,9 @@ // normalization is necessary. // Sign-normalizing a parameter changes its meaning, so do nothing for // parameters. - if (!is_parameter()) + if (!is_parameter()) { sign_normalize(); + } PPL_ASSERT(OK()); } @@ -197,19 +205,24 @@ bool PPL::Grid_Generator::ascii_load(std::istream& s) { - if (!expr.ascii_load(s)) + if (!expr.ascii_load(s)) { return false; + } std::string str; - if (!(s >> str)) + if (!(s >> str)) { return false; - if (str == "L") + } + if (str == "L") { set_is_line(); - else if (str == "P" || str == "Q") + } + else if (str == "P" || str == "Q") { set_is_parameter_or_point(); - else + } + else { return false; + } PPL_ASSERT(OK()); return true; @@ -217,8 +230,9 @@ void PPL::Grid_Generator::set_is_parameter() { - if (is_line()) + if (is_line()) { set_is_parameter_or_point(); + } else if (!is_line_or_parameter()) { // The grid generator is a point. expr.set(Variable(expr.space_dimension() - 1), expr.inhomogeneous_term()); @@ -238,9 +252,10 @@ PPL::compare(const Grid_Generator& x, const Grid_Generator& y) { const bool x_is_line_or_equality = x.is_line_or_equality(); const bool y_is_line_or_equality = y.is_line_or_equality(); - if (x_is_line_or_equality != y_is_line_or_equality) + if (x_is_line_or_equality != y_is_line_or_equality) { // Equalities (lines) precede inequalities (ray/point). return y_is_line_or_equality ? 2 : -2; + } return compare(x.expr, y.expr); } @@ -249,12 +264,14 @@ PPL::Grid_Generator::is_equivalent_to(const Grid_Generator& y) const { const Grid_Generator& x = *this; const dimension_type x_space_dim = x.space_dimension(); - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } const Type x_type = x.type(); - if (x_type != y.type()) + if (x_type != y.type()) { return false; + } Grid_Generator tmp_x = *this; Grid_Generator tmp_y = y; @@ -284,22 +301,25 @@ void PPL::Grid_Generator::scale_to_divisor(Coefficient_traits::const_reference d) { PPL_ASSERT(d != 0); - if (is_line()) + if (is_line()) { return; + } PPL_DIRTY_TEMP_COEFFICIENT(factor); exact_div_assign(factor, d, divisor()); set_divisor(d); PPL_ASSERT(factor > 0); - if (factor > 1) + if (factor > 1) { // Don't scale the first and last coefficients. expr.mul_assign(factor, 1, expr.space_dimension()); + } } void PPL::Grid_Generator::sign_normalize() { - if (is_line_or_equality()) + if (is_line_or_equality()) { expr.sign_normalize(); + } } bool @@ -336,8 +356,9 @@ break; case Grid_Generator::PARAMETER: s << "q("; - if (expr.coefficient(Variable(num_variables)) == 1) + if (expr.coefficient(Variable(num_variables)) == 1) { break; + } goto any_point; case Grid_Generator::POINT: s << "p("; @@ -359,28 +380,35 @@ i_end = expr.lower_bound(Variable(num_variables)); i != i_end; ++i) { c = *i; if (!first) { - if (c > 0) + if (c > 0) { s << " + "; + } else { s << " - "; neg_assign(c); } } - else + else { first = false; - if (c == -1) + } + if (c == -1) { s << "-"; - else if (c != 1) + } + else if (c != 1) { s << c << "*"; + } IO_Operators::operator<<(s, i.variable()); } - if (first) + if (first) { // A grid generator in the origin. s << 0; - if (extra_parentheses) + } + if (extra_parentheses) { s << ")"; - if (need_divisor) + } + if (need_divisor) { s << "/" << divisor(); + } s << ")"; } diff -Nru ppl-1.1/src/Grid_Generator_defs.hh ppl-1.2/src/Grid_Generator_defs.hh --- ppl-1.1/src/Grid_Generator_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Generator_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid_Generator class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Grid_Generator_inlines.hh ppl-1.2/src/Grid_Generator_inlines.hh --- ppl-1.1/src/Grid_Generator_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Generator_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid Generator class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -80,10 +80,12 @@ inline Grid_Generator::Grid_Generator(Linear_Expression& e, Type type) { swap(expr, e); - if (type == LINE) + if (type == LINE) { kind_ = LINE_OR_EQUALITY; - else + } + else { kind_ = RAY_OR_POINT_OR_INEQUALITY; + } PPL_ASSERT(OK()); } @@ -191,8 +193,9 @@ inline Grid_Generator::Type Grid_Generator::type() const { - if (is_line()) + if (is_line()) { return LINE; + } return is_point() ? POINT : PARAMETER; } @@ -224,20 +227,25 @@ inline void Grid_Generator::set_divisor(Coefficient_traits::const_reference d) { PPL_ASSERT(!is_line()); - if (is_line_or_parameter()) + if (is_line_or_parameter()) { expr.set_coefficient(Variable(space_dimension()), d); - else + } + else { expr.set_inhomogeneous_term(d); + } } inline Coefficient_traits::const_reference Grid_Generator::divisor() const { - if (is_line()) + if (is_line()) { throw_invalid_argument("divisor()", "*this is a line"); - if (is_line_or_parameter()) + } + if (is_line_or_parameter()) { return expr.coefficient(Variable(space_dimension())); - else + } + else { return expr.inhomogeneous_term(); + } } inline bool @@ -267,8 +275,9 @@ inline Coefficient_traits::const_reference Grid_Generator::coefficient(const Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { throw_dimension_incompatible("coefficient(v)", "v", v); + } return expr.coefficient(v); } diff -Nru ppl-1.1/src/Grid_Generator_System.cc ppl-1.2/src/Grid_Generator_System.cc --- ppl-1.1/src/Grid_Generator_System.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Generator_System.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid_Generator_System class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,7 @@ #include "Scalar_Products_defs.hh" #include "Scalar_Products_inlines.hh" #include "Variables_Set_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace PPL = Parma_Polyhedra_Library; @@ -36,13 +36,16 @@ PPL::Grid_Generator_System::insert(Grid_Generator_System& gs, Recycle_Input) { const dimension_type gs_num_rows = gs.num_rows(); - if (space_dimension() < gs.space_dimension()) + if (space_dimension() < gs.space_dimension()) { set_space_dimension(gs.space_dimension()); - else + } + else { gs.set_space_dimension(space_dimension()); + } - for (dimension_type i = 0; i < gs_num_rows; ++i) + for (dimension_type i = 0; i < gs_num_rows; ++i) { sys.insert(gs.sys.rows[i], Recycle_Input()); + } gs.clear(); @@ -61,8 +64,9 @@ // There is no need to add the origin as a parameter, // as it will be immediately flagged as redundant. // However, we still have to adjust space dimension. - if (space_dimension() < g.space_dimension()) + if (space_dimension() < g.space_dimension()) { set_space_dimension(g.space_dimension()); + } return; } @@ -111,8 +115,9 @@ // lines and rays into the origin of the space. const bool not_invertible = (v.space_dimension() >= expr.space_dimension() || expr.coefficient(v) == 0); - if (not_invertible) + if (not_invertible) { x.remove_invalid_lines_and_parameters(); + } } PPL_OUTPUT_DEFINITIONS(Grid_Generator_System) @@ -124,8 +129,9 @@ bool PPL::Grid_Generator_System::ascii_load(std::istream& s) { - if (!sys.ascii_load(s)) + if (!sys.ascii_load(s)) { return false; + } PPL_ASSERT(OK()); return true; @@ -175,13 +181,15 @@ const Grid_Generator_System& gs) { Grid_Generator_System::const_iterator i = gs.begin(); const Grid_Generator_System::const_iterator gs_end = gs.end(); - if (i == gs_end) + if (i == gs_end) { return s << "false"; + } while (true) { s << *i; ++i; - if (i == gs_end) + if (i == gs_end) { return s; + } s << ", "; } } @@ -229,15 +237,17 @@ // NOTE: the following swaps will mix grid generators without even trying // to preserve sortedness: as a matter of fact, it will almost always // be the case that the input generator system is NOT sorted. - + // Note that the num_rows() value is *not* constant because remove_row() // decreases it. for (dimension_type i = 0; i < num_rows(); ) { const Grid_Generator& g = (*this)[i]; - if (g.is_line_or_parameter() && g.all_homogeneous_terms_are_zero()) + if (g.is_line_or_parameter() && g.all_homogeneous_terms_are_zero()) { sys.remove_row(i, false); - else + } + else { ++i; + } } } @@ -245,8 +255,9 @@ PPL::Grid_Generator_System::has_points() const { const Grid_Generator_System& ggs = *this; for (dimension_type i = num_rows(); i-- > 0; ) { - if (!ggs[i].is_line_or_parameter()) + if (!ggs[i].is_line_or_parameter()) { return true; + } } return false; } @@ -262,13 +273,16 @@ // that lines are at the top of the system. if (sys.is_sorted()) { const dimension_type nrows = num_rows(); - for (dimension_type i = 0; i < nrows && ggs[i].is_line(); ++i) + for (dimension_type i = 0; i < nrows && ggs[i].is_line(); ++i) { ++n; + } } else { - for (dimension_type i = num_rows(); i-- > 0 ; ) - if (ggs[i].is_line()) + for (dimension_type i = num_rows(); i-- > 0 ; ) { + if (ggs[i].is_line()) { ++n; + } + } } return n; } @@ -285,14 +299,18 @@ // rays have the inhomogeneous term equal to zero. if (sys.is_sorted()) { for (dimension_type i = num_rows(); - i != 0 && ggs[--i].is_parameter_or_point(); ) - if (ggs[i].is_line_or_parameter()) + i != 0 && ggs[--i].is_parameter_or_point(); ) { + if (ggs[i].is_line_or_parameter()) { ++n; + } + } } else { - for (dimension_type i = num_rows(); i-- > 0 ; ) - if (ggs[i].is_parameter()) + for (dimension_type i = num_rows(); i-- > 0 ; ) { + if (ggs[i].is_parameter()) { ++n; + } + } } return n; } diff -Nru ppl-1.1/src/Grid_Generator_System_defs.hh ppl-1.2/src/Grid_Generator_System_defs.hh --- ppl-1.1/src/Grid_Generator_System_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Generator_System_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid_Generator_System class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -31,6 +31,7 @@ #include "Variables_Set_types.hh" #include "Polyhedron_types.hh" #include +#include namespace Parma_Polyhedra_Library { @@ -277,7 +278,7 @@ class const_iterator : public std::iterator { public: diff -Nru ppl-1.1/src/Grid_Generator_System_inlines.hh ppl-1.2/src/Grid_Generator_System_inlines.hh --- ppl-1.1/src/Grid_Generator_System_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Generator_System_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid_Generator_System class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Grid_Generator_System_types.hh ppl-1.2/src/Grid_Generator_System_types.hh --- ppl-1.1/src/Grid_Generator_System_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Generator_System_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Grid_Generator_types.hh ppl-1.2/src/Grid_Generator_types.hh --- ppl-1.1/src/Grid_Generator_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Generator_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Grid_inlines.hh ppl-1.2/src/Grid_inlines.hh --- ppl-1.1/src/Grid_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -258,19 +258,22 @@ inline void Grid::add_congruence(const Congruence& cg) { // Dimension-compatibility check. - if (space_dim < cg.space_dimension()) + if (space_dim < cg.space_dimension()) { throw_dimension_incompatible("add_congruence(cg)", "cg", cg); + } - if (!marked_empty()) + if (!marked_empty()) { add_congruence_no_check(cg); + } } inline void Grid::add_congruences(const Congruence_System& cgs) { // TODO: this is just an executable specification. // Space dimension compatibility check. - if (space_dim < cgs.space_dimension()) + if (space_dim < cgs.space_dimension()) { throw_dimension_incompatible("add_congruences(cgs)", "cgs", cgs); + } if (!marked_empty()) { Congruence_System cgs_copy = cgs; @@ -301,10 +304,12 @@ inline void Grid::add_constraint(const Constraint& c) { // Space dimension compatibility check. - if (space_dim < c.space_dimension()) + if (space_dim < c.space_dimension()) { throw_dimension_incompatible("add_constraint(c)", "c", c); - if (!marked_empty()) + } + if (!marked_empty()) { add_constraint_no_check(c); + } } inline void diff -Nru ppl-1.1/src/Grid_nonpublic.cc ppl-1.2/src/Grid_nonpublic.cc --- ppl-1.1/src/Grid_nonpublic.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_nonpublic.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Grid class implementation (non-inline private or protected functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,7 @@ #include "Grid_Generator_defs.hh" #include "Scalar_Products_defs.hh" #include "Scalar_Products_inlines.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -121,7 +121,7 @@ else { // Here `space_dim == 0'. // See if an inconsistent congruence has been passed. - for (dimension_type i = cgs.num_rows(); i-- > 0; ) + for (dimension_type i = cgs.num_rows(); i-- > 0; ) { if (cgs[i].is_inconsistent()) { // Inconsistent congruence found: the grid is empty. status.set_empty(); @@ -131,6 +131,7 @@ PPL_ASSERT(OK()); return; } + } set_zero_dim_univ(); } PPL_ASSERT(OK()); @@ -159,11 +160,13 @@ } // Non-empty valid generator systems have a supporting point, at least. - if (!ggs.has_points()) + if (!ggs.has_points()) { throw_invalid_generators("Grid(ggs)", "ggs"); + } - if (space_dim == 0) + if (space_dim == 0) { set_zero_dim_univ(); + } else { // Steal the rows from `ggs'. gen_sys.m_swap(ggs); @@ -188,12 +191,14 @@ if (x.congruences_are_minimized() && y.congruences_are_minimized()) { // Equivalent minimized congruence systems have: // - the same number of congruences; ... - if (x.con_sys.num_rows() != y.con_sys.num_rows()) + if (x.con_sys.num_rows() != y.con_sys.num_rows()) { return Grid::TVB_FALSE; + } // - the same number of equalities; ... const dimension_type x_num_equalities = x.con_sys.num_equalities(); - if (x_num_equalities != y.con_sys.num_equalities()) + if (x_num_equalities != y.con_sys.num_equalities()) { return Grid::TVB_FALSE; + } // - and if there are no equalities, the same congruences. // Delay this test: try cheaper tests on generators first. css_normalized = (x_num_equalities == 0); @@ -202,19 +207,24 @@ if (x.generators_are_minimized() && y.generators_are_minimized()) { // Equivalent minimized generator systems have: // - the same number of generators; ... - if (x.gen_sys.num_rows() != y.gen_sys.num_rows()) + if (x.gen_sys.num_rows() != y.gen_sys.num_rows()) { return Grid::TVB_FALSE; + } // - the same number of lines; ... const dimension_type x_num_lines = x.gen_sys.num_lines(); - if (x_num_lines != y.gen_sys.num_lines()) + if (x_num_lines != y.gen_sys.num_lines()) { return Grid::TVB_FALSE; + } // - and if there are no lines, the same generators. if (x_num_lines == 0) { // Check for syntactic identity. - if (x.gen_sys == y.gen_sys) + + if (x.gen_sys == y.gen_sys) { return Grid::TVB_TRUE; - else + } + else { return Grid::TVB_FALSE; + } } } @@ -222,10 +232,12 @@ // checks. if (css_normalized) { - if (x.con_sys == y.con_sys) + if (x.con_sys == y.con_sys) { return Grid::TVB_TRUE; - else + } + else { return Grid::TVB_FALSE; + } } return Grid::TVB_DONT_KNOW; @@ -240,15 +252,18 @@ const Grid& x = *this; #if BE_LAZY - if (!x.generators_are_up_to_date() && !x.update_generators()) + if (!x.generators_are_up_to_date() && !x.update_generators()) { // Updating found `x' empty. return true; - if (!y.congruences_are_up_to_date()) + } + if (!y.congruences_are_up_to_date()) { y.update_congruences(); + } #else - if (!x.generators_are_minimized() && !x.minimize()) + if (!x.generators_are_minimized() && !x.minimize()) { // Minimizing found `x' empty. return true; + } if (!y.congruences_are_minimized()) y.minimize(); #endif @@ -260,9 +275,11 @@ const Congruence_System& cgs = y.con_sys; const dimension_type num_rows = gs.num_rows(); - for (dimension_type i = num_rows; i-- > 0; ) - if (!cgs.satisfies_all_congruences(gs[i])) + for (dimension_type i = num_rows; i-- > 0; ) { + if (!cgs.satisfies_all_congruences(gs[i])) { return false; + } + } // Inclusion holds. return true; @@ -272,17 +289,19 @@ PPL::Grid::bounds(const Linear_Expression& expr, const char* method_call) const { // The dimension of `expr' must be at most the dimension of *this. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible(method_call, "e", expr); - + } // A zero-dimensional or empty grid bounds everything. if (space_dim == 0 || marked_empty() - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { return true; - if (!generators_are_minimized() && !minimize()) + } + if (!generators_are_minimized() && !minimize()) { // Minimizing found `this' empty. return true; + } return bounds_no_check(expr); } @@ -300,9 +319,10 @@ // unbounded. if (g.is_line_or_parameter()) { const int sp_sign = Scalar_Products::homogeneous_sign(expr, g); - if (sp_sign != 0) + if (sp_sign != 0) { // `*this' does not bound `expr'. return false; + } } } return true; @@ -349,14 +369,16 @@ const Grid_Generator& gen = gen_sys[row]; Scalar_Products::homogeneous_assign(sp, expr, gen); if (gen.is_line()) { - if (sgn(sp) != 0) + if (sgn(sp) != 0) { return false; + } continue; } // `gen' must be a parameter. PPL_ASSERT(gen.is_parameter()); - if (sgn(sp) != 0) - gcd_assign(freq_n, freq_n, sp); + if (sgn(sp) != 0) { + gcd_assign(freq_n, freq_n, sp); + } } const Grid_Generator& point = gen_sys[0]; PPL_ASSERT(point.is_point()); @@ -393,14 +415,16 @@ Coefficient& ext_n, Coefficient& ext_d, bool& included, Generator* point) const { if (bounds(expr, method_call)) { - if (marked_empty()) + if (marked_empty()) { return false; + } if (space_dim == 0) { ext_n = 0; ext_d = 1; included = true; - if (point != 0) + if (point != 0) { *point = Generator::point(); + } return true; } // Grid::bounds above ensures the generators are up to date. @@ -465,8 +489,9 @@ Grid& gr = const_cast(*this); - if (!generators_are_minimized()) + if (!generators_are_minimized()) { gr.simplify(gr.gen_sys, gr.dim_kinds); + } // `gen_sys' contained rows before being reduced, so it should // contain at least a single point afterward. @@ -489,14 +514,14 @@ Grid& x = const_cast(*this); - if (!congruences_are_minimized()) + if (!congruences_are_minimized()) { // Either the system of congruences is consistent, or the grid is // empty. if (simplify(x.con_sys, x.dim_kinds)) { x.set_empty(); return false; } - + } // Populate gen_sys with generators characterizing the grid // described by con_sys. conversion(x.con_sys, x.gen_sys, x.dim_kinds); @@ -510,15 +535,16 @@ bool PPL::Grid::minimize() const { // 0-dimension and empty grids are already minimized. - if (marked_empty()) + if (marked_empty()) { return false; - if (space_dim == 0) + } + if (space_dim == 0) { return true; - + } // Are both systems already minimized? - if (congruences_are_minimized() && generators_are_minimized()) + if (congruences_are_minimized() && generators_are_minimized()) { return true; - + } // Invoke update_generators, update_congruences or simplify, // depending on the state of the systems. if (congruences_are_up_to_date()) { @@ -584,8 +610,9 @@ // Check that the divisors in gen_sys are equal. for (dimension_type i = row + 1; i < num_rows; ++i) { const Grid_Generator& g = gen_sys[i]; - if (g.is_parameter_or_point()) + if (g.is_parameter_or_point()) { PPL_ASSERT(gen_sys_divisor == g.divisor()); + } } #endif // !defined(NDEBUG) @@ -593,13 +620,14 @@ divisor = gen_sys_divisor; // Adjust sys to include the gen_sys divisor. normalize_divisors(sys, divisor); - if (divisor != gen_sys_divisor) + if (divisor != gen_sys_divisor) { // Adjust gen_sys to use the new divisor. // // The points and parameters in gen_sys share a common divisor // value, so the new divisor will be the LCM of this common // divisor and `divisor', hence the third argument. normalize_divisors(gen_sys, divisor, &first_point); + } } void @@ -610,31 +638,36 @@ if (sys.space_dimension() > 0 && divisor > 0) { const dimension_type num_rows = sys.num_rows(); - if (first_point != 0) + if (first_point != 0) { lcm_assign(divisor, divisor, (*first_point).divisor()); + } else { PPL_ASSERT(num_rows > 0); // Move to the first point or parameter. dimension_type row = 0; - while (sys[row].is_line()) - if (++row == num_rows) + while (sys[row].is_line()) { + if (++row == num_rows) { // All rows are lines. return; + } + } // Calculate the LCM of the given divisor and the divisor of // every point or parameter. while (row < num_rows) { const Grid_Generator& g = sys[row]; - if (g.is_parameter_or_point()) + if (g.is_parameter_or_point()) { lcm_assign(divisor, divisor, g.divisor()); + } ++row; } } // Represent every point and every parameter using the newly // calculated divisor. - for (dimension_type i = num_rows; i-- > 0; ) + for (dimension_type i = num_rows; i-- > 0; ) { sys.sys.rows[i].scale_to_divisor(divisor); + } // Put the rows back into the linear system. PPL_ASSERT(sys.sys.OK()); @@ -648,13 +681,15 @@ // Dealing with a zero-dimensional space grid first. if (space_dim == 0) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { set_empty(); + } return; } - if (!congruences_are_up_to_date()) + if (!congruences_are_up_to_date()) { update_congruences(); + } con_sys.insert(cg); @@ -678,8 +713,9 @@ set_empty(); return; } - if (c.is_tautological()) + if (c.is_tautological()) { return; + } // Non-trivial inequality constraints are not allowed. throw_invalid_constraint("add_constraint(c)", "c"); } @@ -698,8 +734,9 @@ const Congruence cg(c); add_congruence_no_check(cg); } - else if (c.is_inconsistent()) + else if (c.is_inconsistent()) { set_empty(); + } } void diff -Nru ppl-1.1/src/Grid_public.cc ppl-1.2/src/Grid_public.cc --- ppl-1.1/src/Grid_public.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_public.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid class implementation (non-inline public functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,7 @@ #include "Scalar_Products_defs.hh" #include "Scalar_Products_inlines.hh" #include "Polyhedron_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace PPL = Parma_Polyhedra_Library; @@ -46,14 +46,18 @@ gen_sys = y.gen_sys; } else { - if (y.congruences_are_up_to_date()) + if (y.congruences_are_up_to_date()) { con_sys = y.con_sys; - else + } + else { con_sys.set_space_dimension(space_dim); - if (y.generators_are_up_to_date()) + } + if (y.generators_are_up_to_date()) { gen_sys = y.gen_sys; - else + } + else { gen_sys = Grid_Generator_System(y.space_dim); + } } } @@ -71,7 +75,7 @@ if (space_dim == 0) { // See if an inconsistent constraint has been passed. for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) + cs_end = cs.end(); i != cs_end; ++i) { if (i->is_inconsistent()) { // Inconsistent constraint found: the grid is empty. status.set_empty(); @@ -81,6 +85,7 @@ PPL_ASSERT(OK()); return; } + } set_zero_dim_univ(); PPL_ASSERT(OK()); return; @@ -88,11 +93,14 @@ Congruence_System cgs(cs.space_dimension()); for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) - if (i->is_equality()) + cs_end = cs.end(); i != cs_end; ++i) { + if (i->is_equality()) { cgs.insert(*i); - else + } + else { throw_invalid_constraints("Grid(cs)", "cs"); + } + } construct(cgs); } @@ -110,7 +118,7 @@ if (space_dim == 0) { // See if an inconsistent constraint has been passed. for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) + cs_end = cs.end(); i != cs_end; ++i) { if (i->is_inconsistent()) { // Inconsistent constraint found: the grid is empty. status.set_empty(); @@ -120,6 +128,7 @@ PPL_ASSERT(OK()); return; } + } set_zero_dim_univ(); PPL_ASSERT(OK()); return; @@ -127,11 +136,14 @@ Congruence_System cgs(space_dim); for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) - if (i->is_equality()) + cs_end = cs.end(); i != cs_end; ++i) { + if (i->is_equality()) { cgs.insert(*i); - else + } + else { throw_invalid_constraint("Grid(cs)", "cs"); + } + } construct(cgs); } @@ -149,10 +161,12 @@ // A zero-dim polyhedron causes no complexity problems. if (space_dim == 0) { - if (ph.is_empty()) + if (ph.is_empty()) { set_empty(); - else + } + else { set_zero_dim_univ(); + } return; } @@ -167,21 +181,23 @@ // Minimize the constraint description if it is needed and // the complexity allows it. - if (use_constraints && complexity == ANY_COMPLEXITY) + if (use_constraints && complexity == ANY_COMPLEXITY) { if (!ph.minimize()) { set_empty(); return; } - + } if (use_constraints) { // Only the equality constraints need be used. PPL_ASSERT(ph.constraints_are_up_to_date()); const Constraint_System& cs = ph.constraints(); Congruence_System cgs(space_dim); for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) - if (i->is_equality()) + cs_end = cs.end(); i != cs_end; ++i) { + if (i->is_equality()) { cgs.insert(*i); + } + } construct(cgs); } else { @@ -216,8 +232,9 @@ 1, space_dim + 1); e.linear_combine(g->expr, Coefficient_one(), -point_divisor, 1, space_dim + 1); - if (e.all_homogeneous_terms_are_zero()) + if (e.all_homogeneous_terms_are_zero()) { continue; + } } else { e.linear_combine(g->expr, Coefficient_one(), Coefficient_one(), @@ -234,45 +251,56 @@ PPL::Grid::operator=(const Grid& y) { space_dim = y.space_dim; dim_kinds = y.dim_kinds; - if (y.marked_empty()) + if (y.marked_empty()) { set_empty(); - else if (space_dim == 0) + } + else if (space_dim == 0) { set_zero_dim_univ(); + } else { status = y.status; - if (y.congruences_are_up_to_date()) + if (y.congruences_are_up_to_date()) { con_sys = y.con_sys; - if (y.generators_are_up_to_date()) + } + if (y.generators_are_up_to_date()) { gen_sys = y.gen_sys; + } } return *this; } PPL::dimension_type PPL::Grid::affine_dimension() const { - if (space_dim == 0 || is_empty()) + if (space_dim == 0 || is_empty()) { return 0; + } if (generators_are_up_to_date()) { - if (generators_are_minimized()) + if (generators_are_minimized()) { return gen_sys.num_rows() - 1; - if (!(congruences_are_up_to_date() && congruences_are_minimized())) + } + if (!(congruences_are_up_to_date() && congruences_are_minimized())) { return minimized_grid_generators().num_rows() - 1; + } } - else + else { minimized_congruences(); + } PPL_ASSERT(congruences_are_minimized()); dimension_type d = space_dim; - for (dimension_type i = con_sys.num_rows(); i-- > 0; ) - if (con_sys[i].is_equality()) + for (dimension_type i = con_sys.num_rows(); i-- > 0; ) { + if (con_sys[i].is_equality()) { --d; + } + } return d; } const PPL::Congruence_System& PPL::Grid::congruences() const { - if (marked_empty()) + if (marked_empty()) { return con_sys; + } if (space_dim == 0) { // Zero-dimensional universe. @@ -280,8 +308,9 @@ return con_sys; } - if (!congruences_are_up_to_date()) + if (!congruences_are_up_to_date()) { update_congruences(); + } return con_sys; } @@ -291,10 +320,12 @@ if (congruences_are_up_to_date() && !congruences_are_minimized()) { // Minimize the congruences. Grid& gr = const_cast(*this); - if (gr.simplify(gr.con_sys, gr.dim_kinds)) + if (gr.simplify(gr.con_sys, gr.dim_kinds)) { gr.set_empty(); - else + } + else { gr.set_congruences_minimized(); + } } return congruences(); } @@ -354,38 +385,42 @@ PPL::Poly_Con_Relation PPL::Grid::relation_with(const Congruence& cg) const { // Dimension-compatibility check. - if (space_dim < cg.space_dimension()) + if (space_dim < cg.space_dimension()) { throw_dimension_incompatible("relation_with(cg)", "cg", cg); + } - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { return Poly_Con_Relation::is_disjoint(); - else if (cg.is_equality()) + } + else if (cg.is_equality()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); - else if (cg.inhomogeneous_term() % cg.modulus() == 0) + } + else if (cg.inhomogeneous_term() % cg.modulus() == 0) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } } - if (!generators_are_up_to_date() && !update_generators()) + if (!generators_are_up_to_date() && !update_generators()) { // Updating found the grid empty. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } // Return one of the relations // 'strictly_intersects' a strict subset of the grid points satisfy cg // 'is_included' every grid point satisfies cg // 'is_disjoint' cg and the grid occupy separate spaces. - // There is always a point. - // Scalar product of the congruence and the first point that // satisfies the congruence. PPL_DIRTY_TEMP_COEFFICIENT(point_sp); @@ -406,20 +441,24 @@ switch (g.type()) { case Grid_Generator::POINT: - if (cg.is_proper_congruence()) + if (cg.is_proper_congruence()) { sp %= div; + } if (sp == 0) { // The point satisfies the congruence. - if (point_sp == 0) + if (point_sp == 0) { // Any previous points satisfied the congruence. known_to_intersect = true; - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } } else { if (point_sp == 0) { - if (known_to_intersect) + if (known_to_intersect) { return Poly_Con_Relation::strictly_intersects(); + } // Assign `sp' to `point_sp' as `sp' is the scalar product // of cg and a point g and is non-zero. point_sp = sp; @@ -435,41 +474,47 @@ if (sp != 0) { // Find the GCD between sp and the previous GCD. gcd_assign(div, div, sp); - if (point_sp % div == 0) + if (point_sp % div == 0) { // There is a point in the grid satisfying cg. return Poly_Con_Relation::strictly_intersects(); + } } } } break; case Grid_Generator::PARAMETER: - if (cg.is_proper_congruence()) + if (cg.is_proper_congruence()) { sp %= (div * g.divisor()); - if (sp == 0) + } + if (sp == 0) { // Parameter g satisfies the cg so the relation depends // entirely on the other generators. break; - if (known_to_intersect) + } + if (known_to_intersect) { // At least one point satisfies cg. However, the sum of such // a point and the parameter g fails to satisfy cg (due to g). return Poly_Con_Relation::strictly_intersects(); + } // Find the GCD between sp and the previous GCD. gcd_assign(div, div, sp); if (point_sp != 0) { // At least one of any previously encountered points fails to // satisfy cg. - if (point_sp % div == 0) + if (point_sp % div == 0) { // There is also a grid point that satisfies cg. return Poly_Con_Relation::strictly_intersects(); + } } break; case Grid_Generator::LINE: - if (sp == 0) + if (sp == 0) { // Line g satisfies the cg so the relation depends entirely on // the other generators. break; + } // Line g intersects the congruence. // @@ -488,13 +533,15 @@ } if (point_sp == 0) { - if (cg.is_equality()) + if (cg.is_equality()) { // Every generator satisfied the cg. return Poly_Con_Relation::is_included() && Poly_Con_Relation::saturates(); - else + } + else { // Every generator satisfied the cg. return Poly_Con_Relation::is_included(); + } } PPL_ASSERT(!known_to_intersect); @@ -504,20 +551,24 @@ PPL::Poly_Gen_Relation PPL::Grid::relation_with(const Grid_Generator& g) const { // Dimension-compatibility check. - if (space_dim < g.space_dimension()) + if (space_dim < g.space_dimension()) { throw_dimension_incompatible("relation_with(g)", "g", g); + } // The empty grid cannot subsume a generator. - if (marked_empty()) + if (marked_empty()) { return Poly_Gen_Relation::nothing(); + } // A universe grid in a zero-dimensional space subsumes all the // generators of a zero-dimensional space. - if (space_dim == 0) + if (space_dim == 0) { return Poly_Gen_Relation::subsumes(); + } - if (!congruences_are_up_to_date()) + if (!congruences_are_up_to_date()) { update_congruences(); + } return con_sys.satisfies_all_congruences(g) @@ -530,30 +581,36 @@ const dimension_type g_space_dim = g.space_dimension(); // Dimension-compatibility check. - if (space_dim < g_space_dim) + if (space_dim < g_space_dim) { throw_dimension_incompatible("relation_with(g)", "g", g); + } // The empty grid cannot subsume a generator. - if (marked_empty()) + if (marked_empty()) { return Poly_Gen_Relation::nothing(); + } // A universe grid in a zero-dimensional space subsumes all the // generators of a zero-dimensional space. - if (space_dim == 0) + if (space_dim == 0) { return Poly_Gen_Relation::subsumes(); + } - if (!congruences_are_up_to_date()) + if (!congruences_are_up_to_date()) { update_congruences(); + } const Linear_Expression expr(g.expression()); Grid_Generator gg(grid_point()); - if (g.is_point() || g.is_closure_point()) + if (g.is_point() || g.is_closure_point()) { // Points and closure points are converted to grid points. gg = grid_point(expr, g.divisor()); - else + } + else { // The generator is a ray or line. // In both cases, we convert it to a grid line gg = grid_line(expr); + } return con_sys.satisfies_all_congruences(gg) @@ -564,49 +621,56 @@ PPL::Poly_Con_Relation PPL::Grid::relation_with(const Constraint& c) const { // Dimension-compatibility check. - if (space_dim < c.space_dimension()) + if (space_dim < c.space_dimension()) { throw_dimension_incompatible("relation_with(c)", "c", c); + } if (c.is_equality()) { const Congruence cg(c); return relation_with(cg); } - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { - if (c.is_inconsistent()) - if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) + if (c.is_inconsistent()) { + if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) { // The constraint 0 > 0 implicitly defines the hyperplane 0 = 0; // thus, the zero-dimensional point also saturates it. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::is_disjoint(); - else if (c.inhomogeneous_term() == 0) + } + } + else if (c.inhomogeneous_term() == 0) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); - else + } + else { // The zero-dimensional point saturates // neither the positivity constraint 1 >= 0, // nor the strict positivity constraint 1 > 0. return Poly_Con_Relation::is_included(); + } } - if (!generators_are_up_to_date() && !update_generators()) + if (!generators_are_up_to_date() && !update_generators()) { // Updating found the grid empty. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } // Return one of the relations // 'strictly_intersects' a strict subset of the grid points satisfy c // 'is_included' every grid point satisfies c // 'is_disjoint' c and the grid occupy separate spaces. - // There is always a point. bool point_is_included = false; @@ -622,10 +686,12 @@ if (first_point == 0) { first_point = &g; const int sign = Scalar_Products::sign(c, g); - if (sign == 0) + if (sign == 0) { point_saturates = !c.is_strict_inequality(); - else if (sign > 0) + } + else if (sign > 0) { point_is_included = !c.is_equality(); + } break; } // Not the first point: convert `g' to be a parameter @@ -649,8 +715,9 @@ const int sign = c.is_strict_inequality() ? Scalar_Products::reduced_sign(c.expr, g.expr) : Scalar_Products::sign(c.expr, g.expr); - if (sign != 0) + if (sign != 0) { return Poly_Con_Relation::strictly_intersects(); + } } break; } // switch @@ -659,29 +726,35 @@ // If this program point is reached, then all lines and parameters // saturate the constraint. Hence, the result is determined by // the previosly computed relation with the point. - if (point_saturates) + if (point_saturates) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } - if (point_is_included) + if (point_is_included) { return Poly_Con_Relation::is_included(); + } return Poly_Con_Relation::is_disjoint(); } bool PPL::Grid::is_empty() const { - if (marked_empty()) + if (marked_empty()) { return true; + } // Try a fast-fail test: if generators are up-to-date then the // generator system (since it is well formed) contains a point. - if (generators_are_up_to_date()) + if (generators_are_up_to_date()) { return false; - if (space_dim == 0) + } + if (space_dim == 0) { return false; - if (congruences_are_minimized()) + } + if (congruences_are_minimized()) { // If the grid was empty it would be marked empty. return false; + } // Minimize the congruences to check if the grid is empty. Grid& gr = const_cast(*this); if (gr.simplify(gr.con_sys, gr.dim_kinds)) { @@ -694,17 +767,20 @@ bool PPL::Grid::is_universe() const { - if (marked_empty()) + if (marked_empty()) { return false; + } - if (space_dim == 0) + if (space_dim == 0) { return true; + } if (congruences_are_up_to_date()) { - if (congruences_are_minimized()) + if (congruences_are_minimized()) { // The minimized universe congruence system has only one row, // the integrality congruence. return con_sys.num_rows() == 1 && con_sys[0].is_tautological(); + } } else { update_congruences(); @@ -718,8 +794,9 @@ Linear_Expression expr; expr.set_space_dimension(space_dim); expr += Variable(i); - if (!con_sys.satisfies_all_congruences(grid_line(expr))) + if (!con_sys.satisfies_all_congruences(grid_line(expr))) { return false; + } } #ifndef NDEBUG Linear_Expression expr; @@ -734,20 +811,22 @@ // A zero-dimensional or empty grid is bounded. if (space_dim == 0 || marked_empty() - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { return true; - + } // TODO: Consider using con_sys when gen_sys is out of date. if (gen_sys.num_rows() > 1) { // Check if all generators are the same point. const Grid_Generator& first_point = gen_sys[0]; - if (first_point.is_line_or_parameter()) + if (first_point.is_line_or_parameter()) { return false; + } for (dimension_type row = gen_sys.num_rows(); row-- > 0; ) { const Grid_Generator& gen = gen_sys[row]; - if (gen.is_line_or_parameter() || gen != first_point) + if (gen.is_line_or_parameter() || gen != first_point) { return false; + } } } return true; @@ -758,13 +837,15 @@ // A zero-dimensional or empty grid is discrete. if (space_dim == 0 || marked_empty() - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { return true; - + } // Search for lines in the generator system. - for (dimension_type row = gen_sys.num_rows(); row-- > 1; ) - if (gen_sys[row].is_line()) + for (dimension_type row = gen_sys.num_rows(); row-- > 1; ) { + if (gen_sys[row].is_line()) { return false; + } + } // The system of generators is composed only by // points and parameters: the grid is discrete. @@ -779,19 +860,22 @@ bool PPL::Grid::contains_integer_point() const { // Empty grids have no points. - if (marked_empty()) + if (marked_empty()) { return false; + } // A zero-dimensional, universe grid has, by convention, an // integer point. - if (space_dim == 0) + if (space_dim == 0) { return true; + } // A grid has an integer point if its intersection with the integer // grid is non-empty. Congruence_System cgs; - for (dimension_type var_index = space_dim; var_index-- > 0; ) + for (dimension_type var_index = space_dim; var_index-- > 0; ) { cgs.insert(Variable(var_index) %= 0); + } Grid gr = *this; gr.add_recycled_congruences(cgs); @@ -802,44 +886,52 @@ PPL::Grid::constrains(const Variable var) const { // `var' should be one of the dimensions of the grid. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("constrains(v)", "v", var); + } // An empty grid constrains all variables. - if (marked_empty()) + if (marked_empty()) { return true; + } if (generators_are_up_to_date()) { // Since generators are up-to-date, the generator system (since it is // well formed) contains a point. Hence the grid is not empty. - if (congruences_are_up_to_date()) + if (congruences_are_up_to_date()) { // Here a variable is constrained if and only if it is // syntactically constrained. goto syntactic_check; + } if (generators_are_minimized()) { // Try a quick, incomplete check for the universe grid: // a universe grid constrains no variable. // Count the number of lines (they are linearly independent). dimension_type num_lines = 0; - for (dimension_type i = gen_sys.num_rows(); i-- > 0; ) - if (gen_sys[i].is_line()) + for (dimension_type i = gen_sys.num_rows(); i-- > 0; ) { + if (gen_sys[i].is_line()) { ++num_lines; + } + } - if (num_lines == space_dim) + if (num_lines == space_dim) { return false; + } } // Scan generators: perhaps we will find line(var). for (dimension_type i = gen_sys.num_rows(); i-- > 0; ) { const Grid_Generator& g_i = gen_sys[i]; - if (!g_i.is_line()) + if (!g_i.is_line()) { continue; + } if (sgn(g_i.coefficient(var)) != 0) { if (g_i.expression().all_zeroes(1, var.space_dimension()) - && g_i.expression().all_zeroes(var.space_dimension() + 1, space_dim + 1)) + && g_i.expression().all_zeroes(var.space_dimension() + 1, space_dim + 1)) { // The only nonzero coefficient in g_i is the one of var. return true; + } } } @@ -849,13 +941,16 @@ } // We must minimize to detect emptiness and obtain constraints. - if (!minimize()) + if (!minimize()) { return true; + } syntactic_check: - for (dimension_type i = con_sys.num_rows(); i-- > 0; ) - if (con_sys[i].coefficient(var) != 0) + for (dimension_type i = con_sys.num_rows(); i-- > 0; ) { + if (con_sys[i].coefficient(var) != 0) { return true; + } + } return false; } @@ -867,8 +962,9 @@ #endif // Check whether the status information is legal. - if (!status.OK()) + if (!status.OK()) { goto fail; + } if (marked_empty()) { if (check_not_empty) { @@ -895,9 +991,11 @@ // congruences `con_sys' is empty, and the generator system contains // one point. if (space_dim == 0) { - if (con_sys.has_no_rows()) - if (gen_sys.num_rows() == 1 && gen_sys[0].is_point()) + if (con_sys.has_no_rows()) { + if (gen_sys.num_rows() == 1 && gen_sys[0].is_point()) { return true; + } + } #ifndef NDEBUG cerr << "Zero-dimensional grid should have an empty congruence" << endl << "system and a generator system of a single point." << endl; @@ -925,7 +1023,7 @@ // Let us suppose that all the matrices are up-to-date; this means: // `con_sys' : number of congruences x poly_num_columns // `gen_sys' : number of generators x poly_num_columns - if (congruences_are_up_to_date()) + if (congruences_are_up_to_date()) { if (con_sys.space_dimension() != space_dim) { #ifndef NDEBUG cerr << "Incompatible size! (con_sys and space_dim)" @@ -933,7 +1031,7 @@ #endif goto fail; } - + } if (generators_are_up_to_date()) { if (gen_sys.space_dimension() != space_dim) { #ifndef NDEBUG @@ -976,14 +1074,17 @@ // Check that dim_kinds corresponds to the row kinds in gen_sys. for (dimension_type dim = space_dim, row = gen_sys.num_rows(); dim > 0; --dim) { - if (dim_kinds[dim] == GEN_VIRTUAL) + if (dim_kinds[dim] == GEN_VIRTUAL) { goto ok; + } if (gen_sys[--row].is_parameter_or_point() - && dim_kinds[dim] == PARAMETER) + && dim_kinds[dim] == PARAMETER) { goto ok; + } PPL_ASSERT(gen_sys[row].is_line()); - if (dim_kinds[dim] == LINE) + if (dim_kinds[dim] == LINE) { goto ok; + } #ifndef NDEBUG cerr << "Kinds in dim_kinds should match those in gen_sys." << endl; @@ -1006,8 +1107,9 @@ for (dimension_type row = gen_sys.num_rows(); row-- > 0; ) { const Grid_Generator& g = gs[row]; const Grid_Generator& g_copy = gen_sys[row]; - if (g.is_equal_to(g_copy)) + if (g.is_equal_to(g_copy)) { continue; + } #ifndef NDEBUG cerr << "Generators are declared minimized," " but they change under reduction.\n" @@ -1025,8 +1127,9 @@ if (congruences_are_up_to_date()) { // Check if the system of congruences is well-formed. - if (!con_sys.OK()) + if (!con_sys.OK()) { goto fail; + } Grid tmp_gr = *this; // Make a copy here, before changing tmp_gr, to check later. @@ -1084,14 +1187,17 @@ // Check that dim_kinds corresponds to the row kinds in con_sys. for (dimension_type dim = space_dim, row = 0; dim > 0; --dim) { - if (dim_kinds[dim] == CON_VIRTUAL) + if (dim_kinds[dim] == CON_VIRTUAL) { continue; + } if (con_sys[row++].is_proper_congruence() - && dim_kinds[dim] == PROPER_CONGRUENCE) + && dim_kinds[dim] == PROPER_CONGRUENCE) { continue; + } PPL_ASSERT(con_sys[row-1].is_equality()); - if (dim_kinds[dim] == EQUALITY) + if (dim_kinds[dim] == EQUALITY) { continue; + } #ifndef NDEBUG cerr << "Kinds in dim_kinds should match those in con_sys." << endl; #endif @@ -1113,16 +1219,19 @@ void PPL::Grid::add_constraints(const Constraint_System& cs) { // The dimension of `cs' must be at most `space_dim'. - if (space_dim < cs.space_dimension()) + if (space_dim < cs.space_dimension()) { throw_dimension_incompatible("add_constraints(cs)", "cs", cs); - if (marked_empty()) + } + if (marked_empty()) { return; + } for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { add_constraint_no_check(*i); - if (marked_empty()) + if (marked_empty()) { return; + } } } @@ -1130,16 +1239,18 @@ PPL::Grid::add_grid_generator(const Grid_Generator& g) { // The dimension of `g' must be at most space_dim. const dimension_type g_space_dim = g.space_dimension(); - if (space_dim < g_space_dim) + if (space_dim < g_space_dim) { throw_dimension_incompatible("add_grid_generator(g)", "g", g); + } // Deal with zero-dimension case first. if (space_dim == 0) { // Points and parameters are the only zero-dimension generators // that can be created. if (marked_empty()) { - if (g.is_parameter()) + if (g.is_parameter()) { throw_invalid_generator("add_grid_generator(g)", "g"); + } set_zero_dim_univ(); } PPL_ASSERT(OK()); @@ -1150,16 +1261,18 @@ || (!generators_are_up_to_date() && !update_generators())) { // Here the grid is empty: the specification says we can only // insert a point. - if (g.is_line_or_parameter()) + if (g.is_line_or_parameter()) { throw_invalid_generator("add_grid_generator(g)", "g"); + } gen_sys.insert(g); clear_empty(); } else { PPL_ASSERT(generators_are_up_to_date()); gen_sys.insert(g); - if (g.is_parameter_or_point()) + if (g.is_parameter_or_point()) { normalize_divisors(gen_sys); + } } // With the added generator, congruences are out of date. @@ -1174,29 +1287,34 @@ PPL::Grid::add_recycled_congruences(Congruence_System& cgs) { // Dimension-compatibility check. const dimension_type cgs_space_dim = cgs.space_dimension(); - if (space_dim < cgs_space_dim) + if (space_dim < cgs_space_dim) { throw_dimension_incompatible("add_recycled_congruences(cgs)", "cgs", cgs); + } - if (cgs.has_no_rows()) + if (cgs.has_no_rows()) { return; + } - if (marked_empty()) + if (marked_empty()) { return; + } if (space_dim == 0) { // In a 0-dimensional space the congruences are trivial (e.g., 0 // == 0 or 1 %= 0) or false (e.g., 1 == 0). In a system of // congruences `begin()' and `end()' are equal if and only if the // system contains only trivial congruences. - if (cgs.begin() != cgs.end()) + if (cgs.begin() != cgs.end()) { // There is a congruence, it must be false, the grid becomes empty. set_empty(); + } return; } // The congruences are required. - if (!congruences_are_up_to_date()) + if (!congruences_are_up_to_date()) { update_congruences(); + } // Swap (instead of copying) the coefficients of `cgs' (which is // writable). @@ -1214,18 +1332,21 @@ PPL::Grid::add_recycled_grid_generators(Grid_Generator_System& gs) { // Dimension-compatibility check. const dimension_type gs_space_dim = gs.space_dimension(); - if (space_dim < gs_space_dim) + if (space_dim < gs_space_dim) { throw_dimension_incompatible("add_recycled_grid_generators(gs)", "gs", gs); + } // Adding no generators leaves the grid the same. - if (gs.has_no_rows()) + if (gs.has_no_rows()) { return; + } // Adding valid generators to a zero-dimensional grid transforms it // to the zero-dimensional universe grid. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { set_zero_dim_univ(); + } else { PPL_ASSERT(gs.has_points()); } @@ -1236,8 +1357,9 @@ if (!marked_empty()) { // The grid contains at least one point. - if (!generators_are_up_to_date()) + if (!generators_are_up_to_date()) { update_generators(); + } normalize_divisors(gs, gen_sys); gen_sys.insert(gs, Recycle_Input()); @@ -1253,9 +1375,9 @@ // The grid is empty. // `gs' must contain at least one point. - if (!gs.has_points()) + if (!gs.has_points()) { throw_invalid_generators("add_recycled_grid_generators(gs)", "gs"); - + } // Adjust `gs' to the right dimension. gs.set_space_dimension(space_dim); @@ -1280,36 +1402,41 @@ void PPL::Grid::refine_with_constraint(const Constraint& c) { // The dimension of `c' must be at most `space_dim'. - if (space_dim < c.space_dimension()) + if (space_dim < c.space_dimension()) { throw_dimension_incompatible("refine_with_constraint(c)", "c", c); - if (marked_empty()) + } + if (marked_empty()) { return; + } refine_no_check(c); } void PPL::Grid::refine_with_constraints(const Constraint_System& cs) { // The dimension of `cs' must be at most `space_dim'. - if (space_dim < cs.space_dimension()) + if (space_dim < cs.space_dimension()) { throw_dimension_incompatible("refine_with_constraints(cs)", "cs", cs); + } for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) + cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) { refine_no_check(*i); + } } void PPL::Grid::unconstrain(const Variable var) { // Dimension-compatibility check. - if (space_dim < var.space_dimension()) + if (space_dim < var.space_dimension()) { throw_dimension_incompatible("unconstrain(var)", var.space_dimension()); + } // Do something only if the grid is non-empty. if (marked_empty() - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { // Empty: do nothing. return; - + } PPL_ASSERT(generators_are_up_to_date()); Grid_Generator l = grid_line(var); gen_sys.insert(l, Recycle_Input()); @@ -1324,19 +1451,21 @@ // The cylindrification with respect to no dimensions is a no-op. // This case also captures the only legal cylindrification // of a grid in a 0-dim space. - if (vars.empty()) + if (vars.empty()) { return; - + } // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dim < min_space_dim) + if (space_dim < min_space_dim) { throw_dimension_incompatible("unconstrain(vs)", min_space_dim); + } // Do something only if the grid is non-empty. if (marked_empty() - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { // Empty: do nothing. return; + } PPL_ASSERT(generators_are_up_to_date()); // Since `gen_sys' is not empty, the space dimension of the inserted @@ -1356,12 +1485,13 @@ PPL::Grid::intersection_assign(const Grid& y) { Grid& x = *this; // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("intersection_assign(y)", "y", y); - + } // If one of the two grids is empty, the intersection is empty. - if (x.marked_empty()) + if (x.marked_empty()) { return; + } if (y.marked_empty()) { x.set_empty(); return; @@ -1369,14 +1499,17 @@ // If both grids are zero-dimensional, then at this point they are // necessarily universe, so the intersection is also universe. - if (x.space_dim == 0) + if (x.space_dim == 0) { return; + } // The congruences must be up-to-date. - if (!x.congruences_are_up_to_date()) + if (!x.congruences_are_up_to_date()) { x.update_congruences(); - if (!y.congruences_are_up_to_date()) + } + if (!y.congruences_are_up_to_date()) { y.update_congruences(); + } if (!y.con_sys.has_no_rows()) { x.con_sys.insert(y.con_sys); @@ -1393,12 +1526,13 @@ PPL::Grid::upper_bound_assign(const Grid& y) { Grid& x = *this; // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("upper_bound_assign(y)", "y", y); - + } // The join of a grid `gr' with an empty grid is `gr'. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } if (x.marked_empty()) { x = y; return; @@ -1406,8 +1540,9 @@ // If both grids are zero-dimensional, then they are necessarily // universe grids, and so is their join. - if (x.space_dim == 0) + if (x.space_dim == 0) { return; + } // The generators must be up-to-date. if (!x.generators_are_up_to_date() && !x.update_generators()) { @@ -1415,10 +1550,10 @@ x = y; return; } - if (!y.generators_are_up_to_date() && !y.update_generators()) + if (!y.generators_are_up_to_date() && !y.update_generators()) { // Discovered `y' empty when updating generators. return; - + } // Match the divisors of the x and y generator systems. Grid_Generator_System gs(y.gen_sys); normalize_divisors(x.gen_sys, gs); @@ -1437,8 +1572,9 @@ const Grid& x = *this; // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("upper_bound_assign_if_exact(y)", "y", y); + } if (x.marked_empty() || y.marked_empty() @@ -1468,11 +1604,13 @@ PPL::Grid::difference_assign(const Grid& y) { Grid& x = *this; // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("difference_assign(y)", "y", y); + } - if (y.marked_empty() || x.marked_empty()) + if (y.marked_empty() || x.marked_empty()) { return; + } // If both grids are zero-dimensional, then they are necessarily // universe grids, so the result is empty. @@ -1505,8 +1643,9 @@ // The 2-complement of cg can be included in the result only if x // holds points other than those in cg. - if (x.relation_with(cg).implies(Poly_Con_Relation::is_included())) + if (x.relation_with(cg).implies(Poly_Con_Relation::is_included())) { continue; + } if (cg.is_proper_congruence()) { const Linear_Expression e(cg.expression()); @@ -1552,8 +1691,9 @@ PPL::Grid::simplify_using_context_assign(const Grid& y) { Grid& x = *this; // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("simplify_using_context_assign(y)", "y", y); + } // Filter away the zero-dimensional case. if (x.space_dim == 0) { @@ -1562,8 +1702,9 @@ PPL_ASSERT(OK()); return false; } - else + else { return !x.is_empty(); + } } // If `y' is empty, the biggest enlargement for `x' is the universe. @@ -1591,8 +1732,9 @@ } else { const Coefficient& y_modulus_i = y_con_sys_i.modulus(); - if (y_modulus_i > 1) + if (y_modulus_i > 1) { gr.refine_no_check(le == 1); + } else { Linear_Expression le2 = le; le2 *= 2; @@ -1635,14 +1777,16 @@ // Compute into `z' the intersection of `x' and `y'. const bool x_first = (x_cs_num_rows > y_cs_num_rows); Grid z(x_first ? x : y); - if (x_first) + if (x_first) { z.add_congruences(y_cs); + } else { // Only copy (and then recycle) the non-redundant congruences. Congruence_System tmp_cs; for (dimension_type i = 0; i < x_cs_num_rows; ++i) { - if (!redundant_by_y[i]) + if (!redundant_by_y[i]) { tmp_cs.insert(x_cs[i]); + } } z.add_recycled_congruences(tmp_cs); } @@ -1685,14 +1829,18 @@ if (c.is_proper_congruence()) { // If `g' is a parameter the congruence modulus must be scaled // up by the divisor of the generator. - if (g.is_parameter()) + if (g.is_parameter()) { sp %= (div * g.divisor()); - else - if (g.is_point()) + } + else { + if (g.is_point()) { sp %= div; + } + } } - if (sp == 0) + if (sp == 0) { continue; + } ++num_ruled_out_generators; } ruled_out_vec[j].congruence_index = i; @@ -1740,21 +1888,25 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_image(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' must be at most the dimension of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "e", expr); + } // `var' must be one of the dimensions of the grid. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "v", var); + } - if (marked_empty()) + if (marked_empty()) { return; + } Coefficient_traits::const_reference expr_var = expr.coefficient(var); @@ -1764,10 +1916,12 @@ if (generators_are_up_to_date()) { // Grid_Generator_System::affine_image() requires the third argument // to be a positive Coefficient. - if (denominator > 0) + if (denominator > 0) { gen_sys.affine_image(var, expr, denominator); - else + } + else { gen_sys.affine_image(var, -expr, -denominator); + } clear_generators_minimized(); // Strong normalization in gs::affine_image may have modified // divisors. @@ -1797,15 +1951,18 @@ else { // The transformation is not invertible. // We need an up-to-date system of generators. - if (!generators_are_up_to_date()) + if (!generators_are_up_to_date()) { minimize(); + } if (!marked_empty()) { // Grid_Generator_System::affine_image() requires the third argument // to be a positive Coefficient. - if (denominator > 0) + if (denominator > 0) { gen_sys.affine_image(var, expr, denominator); - else + } + else { gen_sys.affine_image(var, -expr, -denominator); + } clear_congruences_up_to_date(); clear_generators_minimized(); @@ -1823,22 +1980,26 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_preimage(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr); + } // `var' should be one of the dimensions of the grid. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "v", var); + } - if (marked_empty()) + if (marked_empty()) { return; + } Coefficient_traits::const_reference expr_var = expr.coefficient(var); @@ -1847,10 +2008,12 @@ if (congruences_are_up_to_date()) { // Congruence_System::affine_preimage() requires the third argument // to be a positive Coefficient. - if (denominator > 0) + if (denominator > 0) { con_sys.affine_preimage(var, expr, denominator); - else + } + else { con_sys.affine_preimage(var, -expr, -denominator); + } clear_congruences_minimized(); } if (generators_are_up_to_date()) { @@ -1877,14 +2040,17 @@ else { // The transformation is not invertible. // We need an up-to-date system of congruences. - if (!congruences_are_up_to_date()) + if (!congruences_are_up_to_date()) { minimize(); + } // Congruence_System::affine_preimage() requires the third argument // to be a positive Coefficient. - if (denominator > 0) + if (denominator > 0) { con_sys.affine_preimage(var, expr, denominator); - else + } + else { con_sys.affine_preimage(var, -expr, -denominator); + } clear_generators_up_to_date(); clear_congruences_minimized(); @@ -1900,45 +2066,53 @@ Coefficient_traits::const_reference denominator, Coefficient_traits::const_reference modulus) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_image(v, r, e, d, m)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d, m)", "e", expr); + } // `var' should be one of the dimensions of the grid. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d, m)", "v", var); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(v, r, e, d, m)", "r is the disequality relation symbol"); + } // Any image of an empty grid is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // If relsym is not EQUAL, then we return a safe approximation // by adding a line in the direction of var. if (relsym != EQUAL) { - if (modulus != 0) + if (modulus != 0) { throw_invalid_argument("generalized_affine_image(v, r, e, d, m)", "r != EQUAL && m != 0"); + } - if (!generators_are_up_to_date()) + if (!generators_are_up_to_date()) { minimize(); + } // Any image of an empty grid is empty. - if (marked_empty()) + if (marked_empty()) { return; + } add_grid_generator(grid_line(var)); @@ -1950,23 +2124,28 @@ affine_image(var, expr, denominator); - if (modulus == 0) + if (modulus == 0) { return; + } // Modulate dimension `var' according to `modulus'. - if (!generators_are_up_to_date()) + if (!generators_are_up_to_date()) { minimize(); + } // Test if minimization, possibly in affine_image, found an empty // grid. - if (marked_empty()) + if (marked_empty()) { return; + } - if (modulus < 0) + if (modulus < 0) { gen_sys.insert(parameter(-modulus * var)); - else + } + else { gen_sys.insert(parameter(modulus * var)); + } normalize_divisors(gen_sys); @@ -1984,40 +2163,47 @@ Coefficient_traits::const_reference denominator, Coefficient_traits::const_reference modulus) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d, m)", "d == 0"); + } // The dimension of `expr' should be at most the dimension of // `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d, m)", "e", expr); + } // `var' should be one of the dimensions of the grid. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d, m)", "v", var); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d, m)", "r is the disequality relation symbol"); + } // If relsym is not EQUAL, then we return a safe approximation // by adding a line in the direction of var. if (relsym != EQUAL) { - if (modulus != 0) + if (modulus != 0) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d, m)", "r != EQUAL && m != 0"); + } - if (!generators_are_up_to_date()) + if (!generators_are_up_to_date()) { minimize(); + } // Any image of an empty grid is empty. - if (marked_empty()) + if (marked_empty()) { return; + } add_grid_generator(grid_line(var)); @@ -2027,9 +2213,9 @@ PPL_ASSERT(relsym == EQUAL); // Any image of an empty grid is empty. - if (marked_empty()) + if (marked_empty()) { return; - + } // Check whether the affine relation is an affine function. if (modulus == 0) { affine_preimage(var, expr, denominator); @@ -2044,12 +2230,14 @@ = expr - (denominator + var_coefficient) * var; PPL_DIRTY_TEMP_COEFFICIENT(inverse_denominator); neg_assign(inverse_denominator, var_coefficient); - if (modulus < 0) + if (modulus < 0) { generalized_affine_image(var, EQUAL, inverse_expr, inverse_denominator, - modulus); - else + } + else { generalized_affine_image(var, EQUAL, inverse_expr, inverse_denominator, modulus); + } return; } @@ -2058,17 +2246,20 @@ // congruence induced by the affine relation. { Congruence cg((denominator*var %= expr) / denominator); - if (modulus < 0) + if (modulus < 0) { cg /= -modulus; - else + } + else { cg /= modulus; + } add_congruence_no_check(cg); } // If the resulting grid is empty, its preimage is empty too. // Note: DO check for emptiness here, as we will later add a line. - if (is_empty()) + if (is_empty()) { return; + } add_grid_generator(grid_line(var)); PPL_ASSERT(OK()); } @@ -2083,42 +2274,50 @@ // The dimension of `lhs' should be at most the dimension of // `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2, m)", "e1", lhs); + } // The dimension of `rhs' should be at most the dimension of // `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2, m)", "e2", rhs); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(e1, r, e2, m)", "r is the disequality relation symbol"); + } // Any image of an empty grid is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // If relsym is not EQUAL, then we return a safe approximation // by adding a line in the direction of var. if (relsym != EQUAL) { - if (modulus != 0) + if (modulus != 0) { throw_invalid_argument("generalized_affine_image(e1, r, e2, m)", "r != EQUAL && m != 0"); + } - if (!generators_are_up_to_date()) + if (!generators_are_up_to_date()) { minimize(); + } // Any image of an empty grid is empty. - if (marked_empty()) + if (marked_empty()) { return; + } for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end(); - i != i_end; ++i) + i != i_end; ++i) { add_grid_generator(grid_line(i.variable())); + } PPL_ASSERT(OK()); return; @@ -2128,8 +2327,9 @@ PPL_DIRTY_TEMP_COEFFICIENT(tmp_modulus); tmp_modulus = modulus; - if (tmp_modulus < 0) + if (tmp_modulus < 0) { neg_assign(tmp_modulus); + } // Compute the actual space dimension of `lhs', // i.e., the highest dimension having a non-zero coefficient in `lhs'. @@ -2145,8 +2345,9 @@ // direction of variables occurring in `lhs'. Grid_Generator_System new_lines; for (Linear_Expression::const_iterator i = lhs.begin(), - i_end = lhs.lower_bound(Variable(lhs_space_dim)); i != i_end; ++i) + i_end = lhs.lower_bound(Variable(lhs_space_dim)); i != i_end; ++i) { new_lines.insert(grid_line(i.variable())); + } const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim); if (lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) { @@ -2190,8 +2391,9 @@ // there is no need to add a further dimension. // Only add the lines and congruence if there are points. - if (is_empty()) + if (is_empty()) { return; + } // Existentially quantify all the variables occurring in the left hand // side expression. @@ -2213,41 +2415,48 @@ Coefficient_traits::const_reference modulus) { // The dimension of `lhs' must be at most the dimension of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2, m)", "lhs", lhs); + } // The dimension of `rhs' must be at most the dimension of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2, m)", "e2", rhs); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2, m)", "r is the disequality relation symbol"); + } // Any preimage of an empty grid is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // If relsym is not EQUAL, then we return a safe approximation // by adding a line in the direction of var. if (relsym != EQUAL) { - if (modulus != 0) + if (modulus != 0) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2, m)", "r != EQUAL && m != 0"); + } - if (!generators_are_up_to_date()) + if (!generators_are_up_to_date()) { minimize(); - + } // Any image of an empty grid is empty. - if (marked_empty()) + if (marked_empty()) { return; + } for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end(); - i != i_end; ++i) + i != i_end; ++i) { add_grid_generator(grid_line(i.variable())); + } PPL_ASSERT(OK()); return; @@ -2257,8 +2466,9 @@ PPL_DIRTY_TEMP_COEFFICIENT(tmp_modulus); tmp_modulus = modulus; - if (tmp_modulus < 0) + if (tmp_modulus < 0) { neg_assign(tmp_modulus); + } // Compute the actual space dimension of `lhs', // i.e., the highest dimension having a non-zero coefficient in `lhs'. @@ -2274,8 +2484,9 @@ // the direction of variables occurring in `lhs'. Grid_Generator_System new_lines; for (Linear_Expression::const_iterator i = lhs.begin(), - i_end = lhs.lower_bound(Variable(lhs_space_dim)); i != i_end; ++i) + i_end = lhs.lower_bound(Variable(lhs_space_dim)); i != i_end; ++i) { new_lines.insert(grid_line(i.variable())); + } const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim); @@ -2324,8 +2535,9 @@ add_congruence_no_check((lhs %= rhs) / tmp_modulus); // Any image of an empty grid is empty. - if (is_empty()) + if (is_empty()) { return; + } // Existentially quantify all the variables occurring in `lhs'. add_recycled_grid_generators(new_lines); @@ -2341,30 +2553,33 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0"); - + } // Dimension-compatibility checks. // `var' should be one of the dimensions of the grid. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "v", var); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "ub", ub_expr); + } // Any image of an empty grid is empty. - if (marked_empty()) + if (marked_empty()) { return; - + } // In all other cases, generalized_affine_preimage() must // just add a line in the direction of var. generalized_affine_image(var, @@ -2384,29 +2599,33 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0"); - + } // Dimension-compatibility checks. // `var' should be one of the dimensions of the grid. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "v", var); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "ub", ub_expr); + } // Any preimage of an empty grid is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // In all other cases, generalized_affine_preimage() must // just add a line in the direction of var. @@ -2422,19 +2641,22 @@ PPL::Grid::time_elapse_assign(const Grid& y) { Grid& x = *this; // Check dimension-compatibility. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("time_elapse_assign(y)", "y", y); + } // Deal with the zero-dimensional case. if (x.space_dim == 0) { - if (y.marked_empty()) + if (y.marked_empty()) { x.set_empty(); + } return; } // If either one of `x' or `y' is empty, the result is empty too. - if (x.marked_empty()) + if (x.marked_empty()) { return; + } if (y.marked_empty() || (!x.generators_are_up_to_date() && !x.update_generators()) || (!y.generators_are_up_to_date() && !y.update_generators())) { @@ -2450,17 +2672,19 @@ for (dimension_type i = gs_num_rows; i-- > 0; ) { Grid_Generator& g = gs.sys.rows[i]; - if (g.is_point()) + if (g.is_point()) { // Transform the point into a parameter. g.set_is_parameter(); + } } PPL_ASSERT(gs.sys.OK()); - if (gs_num_rows == 0) + if (gs_num_rows == 0) { // `y' was the grid containing a single point at the origin, so // the result is `x'. return; + } // Append `gs' to the generators of `x'. @@ -2477,23 +2701,26 @@ Coefficient& freq_n, Coefficient& freq_d, Coefficient& val_n, Coefficient& val_d) const { // The dimension of `expr' must be at most the dimension of *this. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("frequency(e, ...)", "e", expr); + } // Space dimension is 0: if empty, then return false; // otherwise the frequency is 1 and the value is 0. if (space_dim == 0) { - if (is_empty()) + if (is_empty()) { return false; + } freq_n = 0; freq_d = 1; val_n = 0; val_d = 1; return true; } - if (!generators_are_minimized() && !minimize()) + if (!generators_are_minimized() && !minimize()) { // Minimizing found `this' empty. return false; + } return frequency_no_check(expr, freq_n, freq_d, val_n, val_d); } @@ -2501,15 +2728,18 @@ /*! \relates Parma_Polyhedra_Library::Grid */ bool PPL::operator==(const Grid& x, const Grid& y) { - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { return false; - - if (x.marked_empty()) + } + if (x.marked_empty()) { return y.is_empty(); - if (y.marked_empty()) + } + if (y.marked_empty()) { return x.is_empty(); - if (x.space_dim == 0) + } + if (x.space_dim == 0) { return true; + } switch (x.quick_equivalence_test(y)) { case Grid::TVB_TRUE: @@ -2520,8 +2750,9 @@ default: if (x.is_included_in(y)) { - if (x.marked_empty()) + if (x.marked_empty()) { return y.is_empty(); + } return y.is_included_in(x); } return false; @@ -2533,25 +2764,31 @@ const Grid& x = *this; // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("contains(y)", "y", y); + } - if (y.marked_empty()) + if (y.marked_empty()) { return true; - if (x.marked_empty()) + } + if (x.marked_empty()) { return y.is_empty(); - if (y.space_dim == 0) + } + if (y.space_dim == 0) { return true; - if (x.quick_equivalence_test(y) == Grid::TVB_TRUE) + } + if (x.quick_equivalence_test(y) == Grid::TVB_TRUE) { return true; + } return y.is_included_in(x); } bool PPL::Grid::is_disjoint_from(const Grid& y) const { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("is_disjoint_from(y)", "y", y); + } Grid z = *this; z.intersection_assign(y); return z.is_empty(); @@ -2577,11 +2814,13 @@ gen_sys.ascii_dump(s); s << "dimension_kinds"; if ((generators_are_up_to_date() && generators_are_minimized()) - || (congruences_are_up_to_date() && congruences_are_minimized())) + || (congruences_are_up_to_date() && congruences_are_minimized())) { for (Dimension_Kinds::const_iterator i = dim_kinds.begin(); i != dim_kinds.end(); - ++i) + ++i) { s << " " << *i; + } + } s << endl; } @@ -2591,43 +2830,57 @@ PPL::Grid::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "space_dim") + if (!(s >> str) || str != "space_dim") { return false; + } - if (!(s >> space_dim)) + if (!(s >> space_dim)) { return false; + } - if (!status.ascii_load(s)) + if (!status.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "con_sys") + if (!(s >> str) || str != "con_sys") { return false; + } - if (!(s >> str)) + if (!(s >> str)) { return false; - if (str == "(up-to-date)") + } + if (str == "(up-to-date)") { set_congruences_up_to_date(); - else if (str != "(not_up-to-date)") + } + else if (str != "(not_up-to-date)") { return false; + } - if (!con_sys.ascii_load(s)) + if (!con_sys.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "gen_sys") + if (!(s >> str) || str != "gen_sys") { return false; + } - if (!(s >> str)) + if (!(s >> str)) { return false; - if (str == "(up-to-date)") + } + if (str == "(up-to-date)") { set_generators_up_to_date(); - else if (str != "(not_up-to-date)") + } + else if (str != "(not_up-to-date)") { return false; + } - if (!gen_sys.ascii_load(s)) + if (!gen_sys.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "dimension_kinds") + if (!(s >> str) || str != "dimension_kinds") { return false; + } if (!marked_empty() && ((generators_are_up_to_date() && generators_are_minimized()) @@ -2635,13 +2888,21 @@ dim_kinds.resize(space_dim + 1); for (Dimension_Kinds::size_type dim = 0; dim <= space_dim; ++dim) { short unsigned int dim_kind; - if (!(s >> dim_kind)) + if (!(s >> dim_kind)) { + return false; + } + switch (dim_kind) { + case 0: + dim_kinds[dim] = PARAMETER; + break; + case 1: + dim_kinds[dim] = LINE; + break; + case 2: + dim_kinds[dim] = GEN_VIRTUAL; + break; + default: return false; - switch(dim_kind) { - case 0: dim_kinds[dim] = PARAMETER; break; - case 1: dim_kinds[dim] = LINE; break; - case 2: dim_kinds[dim] = GEN_VIRTUAL; break; - default: return false; } } } @@ -2670,25 +2931,30 @@ // Dimension-compatibility check of `*cs_p', if any. if (cs_p != 0) { const dimension_type cs_p_space_dim = cs_p->space_dimension(); - if (cs_p->space_dimension() > space_dim) + if (cs_p->space_dimension() > space_dim) { throw_dimension_incompatible("wrap_assign(vs, ...)", cs_p_space_dim); + } } // Wrapping no variable is a no-op. - if (vars.empty()) + if (vars.empty()) { return; + } // Dimension-compatibility check of `vars'. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dim < min_space_dim) + if (space_dim < min_space_dim) { throw_dimension_incompatible("wrap_assign(vs, ...)", min_space_dim); + } // Wrapping an empty grid is a no-op. - if (marked_empty()) + if (marked_empty()) { return; - if (!generators_are_minimized() && !minimize()) + } + if (!generators_are_minimized() && !minimize()) { // Minimizing found `this' empty. return; + } // Set the wrap frequency for variables of width `w'. // This is independent of the signedness `s'. @@ -2723,8 +2989,9 @@ vars_end = vars.end(); i != vars_end; ++i) { const Variable x(*i); // Find the frequency and a value for `x' in `gr'. - if (!gr.frequency_no_check(x, f_n, f_d, v_n, v_d)) + if (!gr.frequency_no_check(x, f_n, f_d, v_n, v_d)) { continue; + } if (f_n == 0) { // `x' is a constant in `gr'. @@ -2747,8 +3014,9 @@ // The value v_n for `x' is wrapped modulo the 'wrap_frequency'. v_n %= wrap_frequency; // `v_n' is the value closest to 0 and may be negative. - if (r == UNSIGNED && v_n < 0) + if (r == UNSIGNED && v_n < 0) { v_n += wrap_frequency; + } unconstrain(x); add_constraint(x == v_n); } @@ -2768,10 +3036,11 @@ // congruence for `x'. add_congruence((x %= 0) / 1); } - if (o == OVERFLOW_WRAPS && f_n != wrap_frequency) + if (o == OVERFLOW_WRAPS && f_n != wrap_frequency) { // We know that `x' is not a constant, so, if overflow wraps, // `x' may wrap to a value modulo the `wrap_frequency'. add_grid_generator(parameter(wrap_frequency * x)); + } else if ((o == OVERFLOW_IMPOSSIBLE && 2*f_n >= wrap_frequency) || (f_n == wrap_frequency)) { // In these cases, `x' can only take a unique (ie constant) @@ -2814,11 +3083,12 @@ unconstrain(x); add_congruence(x %= 0); } - else + else { // `x' has at least one integral value. // `x' may also take other non-integral values, // but checking could be costly so we ignore this. add_grid_generator(parameter(x)); + } } else { // `x' is a constant `v' in `gr'. @@ -2840,15 +3110,17 @@ void PPL::Grid::drop_some_non_integer_points(Complexity_Class) { - if (marked_empty() || space_dim == 0) + if (marked_empty() || space_dim == 0) { return; + } // By adding integral congruences for each dimension to the // congruence system, defining \p *this, the grid will keep only // those points that have integral coordinates. All points in \p // *this with non-integral coordinates are removed. - for (dimension_type i = space_dim; i-- > 0; ) + for (dimension_type i = space_dim; i-- > 0; ) { add_congruence(Variable(i) %= 0); + } PPL_ASSERT(OK()); } @@ -2858,12 +3130,14 @@ Complexity_Class) { // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("drop_some_non_integer_points(vs, cmpl)", min_space_dim); + } - if (marked_empty() || min_space_dim == 0) + if (marked_empty() || min_space_dim == 0) { return; + } // By adding the integral congruences for each dimension in vars to // the congruence system defining \p *this, the grid will keep only @@ -2871,8 +3145,9 @@ // in vars. All points in \p *this with non-integral coordinates for // the dimensions in vars are removed. for (Variables_Set::const_iterator i = vars.begin(), - vars_end = vars.end(); i != vars_end; ++i) + vars_end = vars.end(); i != vars_end; ++i) { add_congruence(Variable(*i) %= 0); + } PPL_ASSERT(OK()); } @@ -2880,11 +3155,14 @@ /*! \relates Parma_Polyhedra_Library::Grid */ std::ostream& PPL::IO_Operators::operator<<(std::ostream& s, const Grid& gr) { - if (gr.is_empty()) + if (gr.is_empty()) { s << "false"; - else if (gr.is_universe()) + } + else if (gr.is_universe()) { s << "true"; - else + } + else { s << gr.minimized_congruences(); + } return s; } diff -Nru ppl-1.1/src/Grid_simplify.cc ppl-1.2/src/Grid_simplify.cc --- ppl-1.1/src/Grid_simplify.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_simplify.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid class implementation: simplify(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -22,7 +22,7 @@ site: http://bugseng.com/products/ppl/ . */ #include "ppl-config.h" -#include "assert.hh" +#include "assertions.hh" #include "Grid_defs.hh" namespace Parma_Polyhedra_Library { @@ -172,9 +172,10 @@ // all other parameters to match. for (dimension_type index = rows.size(); index-- > 0; ) { Grid_Generator& gen = rows[index]; - if (gen.is_parameter_or_point()) + if (gen.is_parameter_or_point()) { // Do not scale the last coefficient. gen.expr.mul_assign(reduced_pivot_col, 0, num_columns); + } } // Subtract from row a multiple of pivot such that the result in @@ -222,8 +223,9 @@ // other proper congruences in the same way. for (dimension_type index = sys.size(); index-- > 0; ) { Congruence& cg = sys[index]; - if (cg.is_proper_congruence()) + if (cg.is_proper_congruence()) { cg.scale(reduced_pivot_col); + } } // Subtract from row a multiple of pivot such that the result in // row[column] is zero. @@ -238,8 +240,9 @@ dimension_type last, dimension_type row_size) { while (first <= last) { const R& row = system[first++]; - if (!row.expr.all_zeroes(0, row_size)) + if (!row.expr.all_zeroes(0, row_size)) { return false; + } } return true; } @@ -253,8 +256,9 @@ // Subtract one to allow for the parameter divisor column const dimension_type num_columns = ggs.space_dimension() + 1; - if (dim_kinds.size() != num_columns) + if (dim_kinds.size() != num_columns) { dim_kinds.resize(num_columns); + } const dimension_type num_rows = ggs.num_rows(); @@ -269,12 +273,14 @@ // Move down over rows which have zero in column `dim'. while (row_index < num_rows - && ggs.sys.rows[row_index].expr.get(dim) == 0) + && ggs.sys.rows[row_index].expr.get(dim) == 0) { ++row_index; + } - if (row_index == num_rows) + if (row_index == num_rows) { // Element in column `dim' is zero in all rows from the pivot. dim_kinds[dim] = GEN_VIRTUAL; + } else { if (row_index != pivot_index) { using std::swap; @@ -289,12 +295,14 @@ ++row_index; Grid_Generator& row = ggs.sys.rows[row_index]; - if (row.expr.get(dim) == 0) + if (row.expr.get(dim) == 0) { continue; + } - if (row.is_line()) - if (pivot_is_line) + if (row.is_line()) { + if (pivot_is_line) { reduce_line_with_line(row, pivot, dim); + } else { PPL_ASSERT(pivot.is_parameter_or_point()); using std::swap; @@ -303,11 +311,13 @@ reduce_parameter_with_line(row, pivot, dim, ggs.sys.rows, num_columns + 1); } + } else { PPL_ASSERT(row.is_parameter_or_point()); - if (pivot_is_line) + if (pivot_is_line) { reduce_parameter_with_line(row, pivot, dim, ggs.sys.rows, num_columns + 1); + } else { PPL_ASSERT(pivot.is_parameter_or_point()); reduce_pc_with_pc(row, pivot, dim, dim, num_columns); @@ -315,8 +325,9 @@ } } - if (pivot_is_line) + if (pivot_is_line) { dim_kinds[dim] = LINE; + } else { PPL_ASSERT(pivot.is_parameter_or_point()); dim_kinds[dim] = PARAMETER; @@ -324,8 +335,9 @@ // Since we are reducing the system to "strong minimal form", // ensure that a positive value follows the leading zeros. - if (pivot.expr.get(dim) < 0) + if (pivot.expr.get(dim) < 0) { pivot.expr.negate(dim, num_columns); + } // Factor this row out of the preceding rows. reduce_reduced @@ -385,8 +397,9 @@ // NOTE: add one for the inhomogeneous term (but not the modulus). const dimension_type num_columns = cgs.space_dimension() + 1; - if (dim_kinds.size() != num_columns) + if (dim_kinds.size() != num_columns) { dim_kinds.resize(num_columns); + } const dimension_type num_rows = cgs.num_rows(); @@ -400,13 +413,15 @@ dimension_type row_index = pivot_index; // Move down over rows which have zero in column `dim'. - while (row_index < num_rows && cgs.rows[row_index].expr.get(dim) == 0) + while (row_index < num_rows && cgs.rows[row_index].expr.get(dim) == 0) { ++row_index; + } - if (row_index == num_rows) + if (row_index == num_rows) { // Element in column `dim' is zero in all rows from the pivot, // or `cgs' is empty of rows. dim_kinds[dim] = CON_VIRTUAL; + } else { // Here row_index != num_rows. if (row_index != pivot_index) { @@ -422,12 +437,14 @@ while (row_index < num_rows - 1) { ++row_index; Congruence& row = cgs.rows[row_index]; - if (row.expr.get(dim) == 0) + if (row.expr.get(dim) == 0) { continue; + } if (row.is_equality()) { - if (pivot_is_equality) + if (pivot_is_equality) { reduce_equality_with_equality(row, pivot, dim); + } else { PPL_ASSERT(pivot.is_proper_congruence()); using std::swap; @@ -438,8 +455,9 @@ } else { PPL_ASSERT(row.is_proper_congruence()); - if (pivot_is_equality) + if (pivot_is_equality) { reduce_congruence_with_equality(row, pivot, dim, cgs.rows); + } else { PPL_ASSERT(pivot.is_proper_congruence()); reduce_pc_with_pc(row, pivot, dim, 0, dim + 1); @@ -447,8 +465,9 @@ } } - if (pivot_is_equality) + if (pivot_is_equality) { dim_kinds[dim] = EQUALITY; + } else { PPL_ASSERT(pivot.is_proper_congruence()); dim_kinds[dim] = PROPER_CONGRUENCE; @@ -456,8 +475,9 @@ // Since we are reducing the system to "strong minimal form", // ensure that a positive value follows the leading zeros. - if (pivot.expr.get(dim) < 0) + if (pivot.expr.get(dim) < 0) { pivot.expr.negate(0, dim + 1); + } // Factor this row out of the preceding ones. reduce_reduced @@ -493,8 +513,9 @@ switch (dim_kinds[0]) { case PROPER_CONGRUENCE: - if (last_row.inhomogeneous_term() % last_row.modulus() == 0) + if (last_row.inhomogeneous_term() % last_row.modulus() == 0) { break; + } // The last row is a false proper congruence. last_row.set_modulus(Coefficient_zero()); dim_kinds[0] = EQUALITY; diff -Nru ppl-1.1/src/Grid_Status.cc ppl-1.2/src/Grid_Status.cc --- ppl-1.1/src/Grid_Status.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Status.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid::Status class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -23,7 +23,7 @@ #include "ppl-config.h" #include "Grid_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include #include @@ -55,8 +55,9 @@ std::string str; if (!(s >> str) || (str[0] != '+' && str[0] != '-') - || str.substr(1) != keyword) + || str.substr(1) != keyword) { return false; + } positive = (str[0] == '+'); return true; } @@ -88,71 +89,101 @@ PPL::Grid::Status::ascii_load(std::istream& s) { PPL_UNINITIALIZED(bool, positive); - if (!get_field(s, zero_dim_univ, positive)) + if (!get_field(s, zero_dim_univ, positive)) { return false; - if (positive) + } + if (positive) { set_zero_dim_univ(); + } - if (!get_field(s, empty, positive)) + if (!get_field(s, empty, positive)) { return false; - if (positive) + } + if (positive) { set_empty(); + } - if (!get_field(s, consys_min, positive)) + if (!get_field(s, consys_min, positive)) { return false; - if (positive) + } + if (positive) { set_c_minimized(); - else + } + else { reset_c_minimized(); + } - if (!get_field(s, gensys_min, positive)) + if (!get_field(s, gensys_min, positive)) { return false; - if (positive) + } + + if (positive) { set_g_minimized(); - else + } + else { reset_g_minimized(); + } - if (!get_field(s, consys_upd, positive)) + if (!get_field(s, consys_upd, positive)) { return false; - if (positive) + } + + if (positive) { set_c_up_to_date(); - else + } + else { reset_c_up_to_date(); + } - if (!get_field(s, gensys_upd, positive)) + if (!get_field(s, gensys_upd, positive)) { return false; - if (positive) + } + if (positive) { set_g_up_to_date(); - else + } + else { reset_g_up_to_date(); + } - if (!get_field(s, consys_pending, positive)) + if (!get_field(s, consys_pending, positive)) { return false; - if (positive) + } + if (positive) { set_c_pending(); - else + } + else { reset_c_pending(); + } - if (!get_field(s, gensys_pending, positive)) + if (!get_field(s, gensys_pending, positive)) { return false; - if (positive) + } + if (positive) { set_g_pending(); - else + } + else { reset_g_pending(); + } - if (!get_field(s, satc_upd, positive)) + if (!get_field(s, satc_upd, positive)) { return false; - if (positive) + } + if (positive) { set_sat_c_up_to_date(); - else + } + else { reset_sat_c_up_to_date(); + } - if (!get_field(s, satg_upd, positive)) + if (!get_field(s, satg_upd, positive)) { return false; - if (positive) + } + if (positive) { set_sat_g_up_to_date(); - else + } + else { reset_sat_g_up_to_date(); + } // Check invariants. PPL_ASSERT(OK()); @@ -166,15 +197,17 @@ using std::cerr; #endif - if (test_zero_dim_univ()) + if (test_zero_dim_univ()) { // Zero-dim universe is OK. return true; + } if (test_empty()) { Status copy = *this; copy.reset_empty(); - if (copy.test_zero_dim_univ()) + if (copy.test_zero_dim_univ()) { return true; + } #ifndef NDEBUG cerr << "The empty flag is incompatible with any other one." << endl << "Flags:" << endl; diff -Nru ppl-1.1/src/Grid_Status_idefs.hh ppl-1.2/src/Grid_Status_idefs.hh --- ppl-1.1/src/Grid_Status_idefs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Status_idefs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid::Status class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Grid_Status_inlines.hh ppl-1.2/src/Grid_Status_inlines.hh --- ppl-1.1/src/Grid_Status_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_Status_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid::Status class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -64,9 +64,10 @@ inline void Grid::Status::reset_zero_dim_univ() { // This is a no-op if the current status is not zero-dim. - if (flags == ZERO_DIM_UNIV) + if (flags == ZERO_DIM_UNIV) { // In the zero-dim space, if it is not the universe it is empty. flags = EMPTY; + } } inline void diff -Nru ppl-1.1/src/Grid_templates.hh ppl-1.2/src/Grid_templates.hh --- ppl-1.1/src/Grid_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Grid class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -51,8 +51,9 @@ return; } - if (space_dim == 0) + if (space_dim == 0) { set_zero_dim_univ(); + } else { // Initialize the space dimension as indicated by the box. con_sys.set_space_dimension(space_dim); @@ -68,7 +69,7 @@ bool closed = false; // TODO: Consider producing the system(s) in minimized form. if (box.has_lower_bound(v_k, l_n, l_d, closed)) { - if (box.has_upper_bound(v_k, u_n, u_d, closed)) + if (box.has_upper_bound(v_k, u_n, u_d, closed)) { if (l_n * u_d == u_n * l_d) { // A point interval sets dimension k of every point to a // single value. @@ -84,13 +85,15 @@ gcd_assign(u_n, l_d, point_divisor); // `u_n' now holds the gcd. exact_div_assign(u_n, point_divisor, u_n); - if (l_d < 0) + if (l_d < 0) { neg_assign(u_n); + } // l_d * u_n == abs(l_d * (point_divisor / gcd(l_d, point_divisor))) point.scale_to_divisor(l_d * u_n); // Set dimension k of the point to the lower bound. - if (l_d < 0) + if (l_d < 0) { neg_assign(u_n); + } // point[k + 1] = l_n * point_divisor / gcd(l_d, point_divisor) point.expr.set(Variable(k), l_n * u_n); PPL_ASSERT(point.OK()); @@ -99,6 +102,7 @@ continue; } + } } // A universe interval allows any value in dimension k. gen_sys.insert(grid_line(v_k)); @@ -113,8 +117,9 @@ template void Grid::map_space_dimensions(const Partial_Function& pfunc) { - if (space_dim == 0) + if (space_dim == 0) { return; + } if (pfunc.has_empty_codomain()) { // All dimensions vanish: the grid becomes zero_dimensional. @@ -124,9 +129,10 @@ space_dim = 0; set_empty(); } - else + else { // Removing all dimensions from a non-empty grid. set_zero_dim_univ(); + } PPL_ASSERT(OK()); return; @@ -153,11 +159,13 @@ visited[j] = true; // The following initialization is only to make the compiler happy. dimension_type k = 0; - if (!pfunc.maps(j, k)) + if (!pfunc.maps(j, k)) { throw_invalid_argument("map_space_dimensions(pfunc)", " pfunc is inconsistent"); - if (k == j) + } + if (k == j) { break; + } cycle.push_back(Variable(j)); // Go along the cycle. @@ -206,8 +214,9 @@ std::vector pfunc_maps(space_dim, not_a_dimension()); for (dimension_type j = space_dim; j-- > 0; ) { dimension_type pfunc_j; - if (pfunc.maps(j, pfunc_j)) + if (pfunc.maps(j, pfunc_j)) { pfunc_maps[j] = pfunc_j; + } } Grid_Generator_System new_gensys; @@ -216,9 +225,11 @@ // Get the divisor of the first point. Grid_Generator_System::const_iterator i; Grid_Generator_System::const_iterator old_gensys_end = old_gensys.end(); - for (i = old_gensys.begin(); i != old_gensys_end; ++i) - if (i->is_point()) + for (i = old_gensys.begin(); i != old_gensys_end; ++i) { + if (i->is_point()) { break; + } + } PPL_ASSERT(i != old_gensys_end); const Coefficient& system_divisor = i->divisor(); for (i = old_gensys.begin(); i != old_gensys_end; ++i) { @@ -237,12 +248,14 @@ } switch (old_g.type()) { case Grid_Generator::LINE: - if (!all_zeroes) + if (!all_zeroes) { new_gensys.insert(grid_line(expr)); + } break; case Grid_Generator::PARAMETER: - if (!all_zeroes) + if (!all_zeroes) { new_gensys.insert(parameter(expr, system_divisor)); + } break; case Grid_Generator::POINT: new_gensys.insert(grid_point(expr, old_g.divisor())); @@ -273,8 +286,9 @@ const M_row_type& pivot = rows[pivot_index]; const Coefficient& pivot_dim = pivot.expr.get(dim); - if (pivot_dim == 0) + if (pivot_dim == 0) { return; + } PPL_DIRTY_TEMP_COEFFICIENT(pivot_dim_half); pivot_dim_half = (pivot_dim + 1) / 2; @@ -289,14 +303,16 @@ if (generators) { --kinds_index; // Move over any virtual rows. - while (sys_dim_kinds[kinds_index] == GEN_VIRTUAL) + while (sys_dim_kinds[kinds_index] == GEN_VIRTUAL) { --kinds_index; + } } else { ++kinds_index; // Move over any virtual rows. - while (sys_dim_kinds[kinds_index] == CON_VIRTUAL) + while (sys_dim_kinds[kinds_index] == CON_VIRTUAL) { ++kinds_index; + } } // row_kind CONGRUENCE is included as PARAMETER @@ -315,21 +331,23 @@ // -5 < row_dim <= 5. row_dim_remainder = row_dim % pivot_dim; if (row_dim_remainder < 0) { - if (row_dim_remainder <= -pivot_dim_half) + if (row_dim_remainder <= -pivot_dim_half) { --num_rows_to_subtract; + } } - else if (row_dim_remainder > 0 && row_dim_remainder > pivot_dim_half) + else if (row_dim_remainder > 0 && row_dim_remainder > pivot_dim_half) { ++num_rows_to_subtract; - + } // Subtract num_rows_to_subtract copies of pivot from row i. Only the // entries from dim need to be subtracted, as the preceding // entries are all zero. // If num_rows_to_subtract is negative, these copies of pivot are // added to row i. - if (num_rows_to_subtract != 0) + if (num_rows_to_subtract != 0) { row.expr.linear_combine(pivot.expr, Coefficient_one(), -num_rows_to_subtract, start, end + 1); + } } } } diff -Nru ppl-1.1/src/Grid_types.hh ppl-1.2/src/Grid_types.hh --- ppl-1.1/src/Grid_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Grid_widenings.cc ppl-1.2/src/Grid_widenings.cc --- ppl-1.1/src/Grid_widenings.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Grid_widenings.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Grid class implementation (non-inline widening-related member functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,7 +24,7 @@ #include "ppl-config.h" #include "Grid_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace PPL = Parma_Polyhedra_Library; @@ -51,9 +51,10 @@ { const Congruence& cg = con_sys[x_row]; const Congruence& y_cg = y.con_sys[y_row]; - if (cg.is_equal_at_dimension(Variable(dim - 1), y_cg)) + if (cg.is_equal_at_dimension(Variable(dim - 1), y_cg)) { // The leading diagonal entries are equal. selected_cgs.insert(cg); + } ++x_row; ++y_row; } @@ -64,8 +65,9 @@ ++y_row; break; case CON_VIRTUAL: - if (y.dim_kinds[dim] != CON_VIRTUAL) + if (y.dim_kinds[dim] != CON_VIRTUAL) { ++y_row; + } break; } } @@ -75,15 +77,17 @@ PPL::Grid::congruence_widening_assign(const Grid& y, unsigned* tp) { Grid& x = *this; // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("widening_assign(y)", "y", y); + } // Assume `y' is contained in or equal to `x'. PPL_EXPECT_HEAVY(copy_contains(x, y)); // Leave `x' the same if `x' or `y' is zero-dimensional or empty. - if (x.space_dim == 0 || x.marked_empty() || y.marked_empty()) + if (x.space_dim == 0 || x.marked_empty() || y.marked_empty()) { return; + } // Ensure that the `x' congruences are in minimal form. if (x.congruences_are_up_to_date()) { @@ -96,8 +100,9 @@ x.set_congruences_minimized(); } } - else + else { x.update_congruences(); + } // Ensure that the `y' congruences are in minimal form. Grid& yy = const_cast(y); @@ -111,20 +116,22 @@ yy.set_congruences_minimized(); } } - else + else { yy.update_congruences(); + } - if (con_sys.num_equalities() < yy.con_sys.num_equalities()) + if (con_sys.num_equalities() < yy.con_sys.num_equalities()) { return; - + } // Copy into `cgs' the congruences of `x' that are common to `y', // according to the grid widening. Congruence_System cgs; x.select_wider_congruences(yy, cgs); - if (cgs.num_rows() == con_sys.num_rows()) + if (cgs.num_rows() == con_sys.num_rows()) { // All congruences were selected, thus the result is `x'. return; + } // A strict subset of the congruences was selected. @@ -137,12 +144,14 @@ // There are tokens available. If `result' is not a subset of // `x', then it is less precise and we use one of the available // tokens. - if (!x.contains(result)) + if (!x.contains(result)) { --(*tp); + } } - else + else { // No tokens. x.m_swap(result); + } PPL_ASSERT(x.OK(true)); } @@ -154,14 +163,16 @@ Grid& x = *this; // Check dimension compatibility. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("limited_extrapolation_assign(y, cgs)", "y", y); + } // `cgs' must be dimension-compatible with the two grids. const dimension_type cgs_space_dim = cgs.space_dimension(); - if (x.space_dim < cgs_space_dim) + if (x.space_dim < cgs_space_dim) { throw_dimension_incompatible("limited_extrapolation_assign(y, cgs)", "cgs", cgs); + } const dimension_type cgs_num_rows = cgs.num_rows(); // If `cgs' is empty (of rows), fall back to ordinary widening. @@ -173,22 +184,26 @@ // Assume `y' is contained in or equal to `x'. PPL_EXPECT_HEAVY(copy_contains(x, y)); - if (y.marked_empty()) + if (y.marked_empty()) { return; - if (x.marked_empty()) + } + if (x.marked_empty()) { return; + } // The limited widening between two grids in a zero-dimensional // space is also a grid in a zero-dimensional space. - if (x.space_dim == 0) + if (x.space_dim == 0) { return; + } // Update the generators of `x': these are used to select, from the // congruences in `cgs', those that must be added to the widened // grid. - if (!x.generators_are_up_to_date() && !x.update_generators()) + if (!x.generators_are_up_to_date() && !x.update_generators()) { // `x' is empty. return; + } if (tp == NULL || *tp == 0) { // Widening may change the grid, so add the congruences. @@ -198,15 +213,17 @@ // the relative ordering of congruences (just for aesthetics). for (dimension_type i = 0; i < cgs_num_rows; ++i) { const Congruence& cg = cgs[i]; - if (x.relation_with(cg) == Poly_Con_Relation::is_included()) + if (x.relation_with(cg) == Poly_Con_Relation::is_included()) { new_cgs.insert(cg); + } } x.congruence_widening_assign(y, tp); x.add_recycled_congruences(new_cgs); } - else + else { // There are tokens, so widening will leave the grid the same. x.congruence_widening_assign(y, tp); + } PPL_ASSERT(OK()); } @@ -234,9 +251,10 @@ { const Grid_Generator& gg = gen_sys[x_row]; const Grid_Generator& y_gg = y.gen_sys[y_row]; - if (gg.is_equal_at_dimension(dim, y_gg)) + if (gg.is_equal_at_dimension(dim, y_gg)) { // The leading diagonal entry is equal. widened_ggs.insert(gg); + } else { const Linear_Expression expr(gg.expression()); Grid_Generator line = grid_line(expr); @@ -252,8 +270,9 @@ ++y_row; break; case GEN_VIRTUAL: - if (y.dim_kinds[dim] != GEN_VIRTUAL) + if (y.dim_kinds[dim] != GEN_VIRTUAL) { ++y_row; + } break; } } @@ -264,15 +283,17 @@ Grid& x = *this; // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("generator_widening_assign(y)", "y", y); + } // Assume `y' is contained in or equal to `x'. PPL_EXPECT_HEAVY(copy_contains(x, y)); // Leave `x' the same if `x' or `y' is zero-dimensional or empty. - if (x.space_dim == 0 || x.marked_empty() || y.marked_empty()) + if (x.space_dim == 0 || x.marked_empty() || y.marked_empty()) { return; + } // Ensure that the `x' generators are in minimal form. if (x.generators_are_up_to_date()) { @@ -282,11 +303,13 @@ x.set_generators_minimized(); } } - else + else { x.update_generators(); + } - if (x.marked_empty()) + if (x.marked_empty()) { return; + } // Ensure that the `y' generators are in minimal form. Grid& yy = const_cast(y); @@ -297,23 +320,27 @@ yy.set_generators_minimized(); } } - else + else { yy.update_generators(); + } - if (gen_sys.num_rows() > yy.gen_sys.num_rows()) + if (gen_sys.num_rows() > yy.gen_sys.num_rows()) { return; + } - if (gen_sys.num_lines() > yy.gen_sys.num_lines()) + if (gen_sys.num_lines() > yy.gen_sys.num_lines()) { return; + } // Copy into `ggs' the generators of `x' that are common to `y', // according to the grid widening. Grid_Generator_System ggs; x.select_wider_generators(yy, ggs); - if (ggs.num_parameters() == gen_sys.num_parameters()) + if (ggs.num_parameters() == gen_sys.num_parameters()) { // All parameters are kept as parameters, thus the result is `x'. return; + } // A strict subset of the parameters was selected. @@ -326,12 +353,14 @@ // There are tokens available. If `result' is not a subset of // `x', then it is less precise and we use one of the available // tokens. - if (!x.contains(result)) + if (!x.contains(result)) { --(*tp); + } } - else + else { // No tokens. x.m_swap(result); + } PPL_ASSERT(x.OK(true)); } @@ -343,14 +372,16 @@ Grid& x = *this; // Check dimension compatibility. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("limited_extrapolation_assign(y, cgs)", "y", y); + } // `cgs' must be dimension-compatible with the two grids. const dimension_type cgs_space_dim = cgs.space_dimension(); - if (x.space_dim < cgs_space_dim) + if (x.space_dim < cgs_space_dim) { throw_dimension_incompatible("limited_extrapolation_assign(y, cgs)", "cgs", cgs); + } const dimension_type cgs_num_rows = cgs.num_rows(); // If `cgs' is empty (of rows), fall back to ordinary widening. @@ -362,22 +393,26 @@ // Assume `y' is contained in or equal to `x'. PPL_EXPECT_HEAVY(copy_contains(x, y)); - if (y.marked_empty()) + if (y.marked_empty()) { return; - if (x.marked_empty()) + } + if (x.marked_empty()) { return; + } // The limited widening between two grids in a zero-dimensional // space is also a grid in a zero-dimensional space. - if (x.space_dim == 0) + if (x.space_dim == 0) { return; + } // Update the generators of `x': these are used to select, from the // congruences in `cgs', those that must be added to the widened // grid. - if (!x.generators_are_up_to_date() && !x.update_generators()) + if (!x.generators_are_up_to_date() && !x.update_generators()) { // `x' is empty. return; + } if (tp == NULL || *tp == 0) { // Widening may change the grid, so add the congruences. @@ -387,15 +422,17 @@ // the relative ordering of congruences (just for aesthetics). for (dimension_type i = 0; i < cgs_num_rows; ++i) { const Congruence& cg = cgs[i]; - if (x.relation_with(cg) == Poly_Con_Relation::is_included()) + if (x.relation_with(cg) == Poly_Con_Relation::is_included()) { new_cgs.insert(cg); + } } x.generator_widening_assign(y, tp); x.add_recycled_congruences(new_cgs); } - else + else { // There are tokens, so widening will leave the grid the same. x.generator_widening_assign(y, tp); + } PPL_ASSERT(OK()); } @@ -405,8 +442,9 @@ Grid& x = *this; // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("widening_assign(y)", "y", y); + } // Assume `y' is contained in or equal to `x'. PPL_EXPECT_HEAVY(copy_contains(x, y)); @@ -435,14 +473,17 @@ Grid& x = *this; // Check dimension compatibility. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("limited_extrapolation_assign(y, cgs)", "y", y); + } + // `cgs' must be dimension-compatible with the two grids. const dimension_type cgs_space_dim = cgs.space_dimension(); - if (x.space_dim < cgs_space_dim) + if (x.space_dim < cgs_space_dim) { throw_dimension_incompatible("limited_extrapolation_assign(y, cgs)", "cgs", cgs); + } const dimension_type cgs_num_rows = cgs.num_rows(); // If `cgs' is empty (of rows), fall back to ordinary widening. @@ -454,22 +495,26 @@ // Assume `y' is contained in or equal to `x'. PPL_EXPECT_HEAVY(copy_contains(x, y)); - if (y.marked_empty()) + if (y.marked_empty()) { return; - if (x.marked_empty()) + } + if (x.marked_empty()) { return; + } // The limited widening between two grids in a zero-dimensional // space is also a grid in a zero-dimensional space. - if (x.space_dim == 0) + if (x.space_dim == 0) { return; + } // Update the generators of `x': these are used to select, from the // congruences in `cgs', those that must be added to the widened // grid. - if (!x.generators_are_up_to_date() && !x.update_generators()) + if (!x.generators_are_up_to_date() && !x.update_generators()) { // `x' is empty. return; + } if (tp == NULL || *tp == 0) { // Widening may change the grid, so add the congruences. @@ -479,15 +524,17 @@ // the relative ordering of congruences (just for aesthetics). for (dimension_type i = 0; i < cgs_num_rows; ++i) { const Congruence& cg = cgs[i]; - if (x.relation_with(cg) == Poly_Con_Relation::is_included()) + if (x.relation_with(cg) == Poly_Con_Relation::is_included()) { new_cgs.insert(cg); + } } x.widening_assign(y, tp); x.add_recycled_congruences(new_cgs); } - else + else { // There are tokens, so widening will leave the grid the same. x.widening_assign(y, tp); + } PPL_ASSERT(OK()); } diff -Nru ppl-1.1/src/H79_Certificate.cc ppl-1.2/src/H79_Certificate.cc --- ppl-1.1/src/H79_Certificate.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/H79_Certificate.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* H79_Certificate class implementation (non-inline member functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,7 +25,7 @@ #include "ppl-config.h" #include "H79_Certificate_defs.hh" #include "Polyhedron_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace PPL = Parma_Polyhedra_Library; @@ -45,8 +45,9 @@ for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { ++num_constraints; - if (i->is_equality()) + if (i->is_equality()) { --affine_dim; + } } // TODO: this is an inefficient workaround. @@ -56,16 +57,19 @@ // We have to reinforce the (normal) minimization of the generator // system. The future, lazy implementation of the strong minimization // process will solve this problem. - if (!ph.is_necessarily_closed()) + if (!ph.is_necessarily_closed()) { ph.minimize(); + } } int PPL::H79_Certificate::compare(const H79_Certificate& y) const { - if (affine_dim != y.affine_dim) + if (affine_dim != y.affine_dim) { return (affine_dim > y.affine_dim) ? 1 : -1; - if (num_constraints != y.num_constraints) + } + if (num_constraints != y.num_constraints) { return (num_constraints > y.num_constraints) ? 1 : -1; + } // All components are equal. return 0; } @@ -87,8 +91,9 @@ for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { ++ph_num_constraints; - if (i->is_equality()) + if (i->is_equality()) { --ph_affine_dim; + } } // TODO: this is an inefficient workaround. // For NNC polyhedra, generators might be no longer up-to-date @@ -97,22 +102,24 @@ // We have to reinforce the (normal) minimization of the generator // system. The future, lazy implementation of the strong minimization // process will solve this problem. - if (!ph.is_necessarily_closed()) + if (!ph.is_necessarily_closed()) { ph.minimize(); + } // If the affine dimension of `ph' is increasing, the chain is stabilizing. - if (ph_affine_dim > affine_dim) + if (ph_affine_dim > affine_dim) { return 1; + } // At this point the two polyhedra must have the same affine dimension. PPL_ASSERT(ph_affine_dim == affine_dim); // If the number of constraints of `ph' is decreasing, then the chain // is stabilizing. If it is increasing, the chain is not stabilizing. - if (ph_num_constraints != num_constraints) + if (ph_num_constraints != num_constraints) { return (ph_num_constraints < num_constraints) ? 1 : -1; + } // All components are equal. return 0; } - diff -Nru ppl-1.1/src/H79_Certificate_defs.hh ppl-1.2/src/H79_Certificate_defs.hh --- ppl-1.1/src/H79_Certificate_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/H79_Certificate_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* H79_Certificate class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,6 @@ #include "H79_Certificate_types.hh" #include "Polyhedron_types.hh" #include "globals_types.hh" -#include "assert.hh" #include //! A convergence certificate for the H79 widening operator. diff -Nru ppl-1.1/src/H79_Certificate_inlines.hh ppl-1.2/src/H79_Certificate_inlines.hh --- ppl-1.1/src/H79_Certificate_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/H79_Certificate_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* H79_Certificate class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/H79_Certificate_types.hh ppl-1.2/src/H79_Certificate_types.hh --- ppl-1.1/src/H79_Certificate_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/H79_Certificate_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Handler.cc ppl-1.2/src/Handler.cc --- ppl-1.1/src/Handler.cc 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/src/Handler.cc 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,36 @@ +/* Handler and derived classes' implementation (non-inline functions). + Copyright (C) 2001-2010 Roberto Bagnara + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) + +This file is part of the Parma Polyhedra Library (PPL). + +The PPL is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The PPL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. + +For the most up-to-date information see the Parma Polyhedra Library +site: http://bugseng.com/products/ppl/ . */ + +#include "ppl-config.h" +#include "Handler_defs.hh" + +namespace PPL = Parma_Polyhedra_Library; + +PPL::Implementation::Watchdog::Handler::~Handler() { +} + +void +PPL::Implementation::Watchdog::Handler_Function::act() const { + (*f)(); +} + diff -Nru ppl-1.1/src/Handler_defs.hh ppl-1.2/src/Handler_defs.hh --- ppl-1.1/src/Handler_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Handler_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Handler and derived classes' declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -71,7 +71,7 @@ virtual void act() const; private: - // declare holder as reference to volatile pointer to const Flag_Base + // Declare holder as reference to volatile pointer to const Flag_Base. const Flag_Base* volatile& h; Flag& f; }; diff -Nru ppl-1.1/src/Handler_inlines.hh ppl-1.2/src/Handler_inlines.hh --- ppl-1.1/src/Handler_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Handler_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Handler and derived classes' implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -30,10 +30,6 @@ namespace Watchdog { -inline -Handler::~Handler() { -} - template Handler_Flag::Handler_Flag(const Flag_Base* volatile& holder, Flag& flag) @@ -43,8 +39,9 @@ template void Handler_Flag::act() const { - if (h == 0 || static_cast(*h).priority() < f.priority()) + if (h == 0 || static_cast(*h).priority() < f.priority()) { h = &f; + } } inline @@ -52,11 +49,6 @@ : f(function) { } -inline void -Handler_Function::act() const { - (*f)(); -} - } // namespace Watchdog } // namespace Implementation diff -Nru ppl-1.1/src/Handler_types.hh ppl-1.2/src/Handler_types.hh --- ppl-1.1/src/Handler_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Handler_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Has_Assign_Or_Swap.hh ppl-1.2/src/Has_Assign_Or_Swap.hh --- ppl-1.1/src/Has_Assign_Or_Swap.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Has_Assign_Or_Swap.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Has_Assign_Or_Swap classes declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Init.cc ppl-1.2/src/Init.cc --- ppl-1.1/src/Init.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Init.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Init class implementation (non-inline functions and static variables). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -48,16 +48,7 @@ PPL::fpu_rounding_direction_type PPL::Init::old_rounding_direction; extern "C" void -ppl_set_GMP_memory_allocation_functions(void) -#if PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK - __attribute__((weak)); - -void -ppl_set_GMP_memory_allocation_functions(void) { -} -#else - ; -#endif +ppl_set_GMP_memory_allocation_functions(void); #if PPL_CAN_CONTROL_FPU \ && defined(PPL_ARM_CAN_CONTROL_FPU) && PPL_ARM_CAN_CONTROL_FPU @@ -75,12 +66,15 @@ int ppl_check_function() { int r = 0; - if (nf[0] == nf[1] || pf[0] == pf[1] || -nf[0] != pf[1] || -nf[1] != pf[0]) + if (nf[0] == nf[1] || pf[0] == pf[1] || -nf[0] != pf[1] || -nf[1] != pf[0]) { r |= 1; - if (nd[0] == nd[1] || pd[0] == pd[1] || -nd[0] != pd[1] || -nd[1] != pd[0]) + } + if (nd[0] == nd[1] || pd[0] == pd[1] || -nd[0] != pd[1] || -nd[1] != pd[0]) { r |= 2; - if (nl[0] == nl[1] || pl[0] == pl[1] || -nl[0] != pl[1] || -nl[1] != pl[0]) + } + if (nl[0] == nl[1] || pl[0] == pl[1] || -nl[0] != pl[1] || -nl[1] != pl[0]) { r |= 4; + } return r; } @@ -98,16 +92,17 @@ int (* volatile ppl_check_function_p)() = ppl_check_function; int (* volatile ppl_setround_function_p)(int) = ppl_setround_function; -} // Implementation +} // namespace Implementation -} // Parma_Polyhedra_Library +} // namespace Parma_Polyhedra_Library namespace { int ppl_test_rounding() { - if ((*ppl_setround_function_p)(FE_DOWNWARD) != 0) + if ((*ppl_setround_function_p)(FE_DOWNWARD) != 0) { return 255; + } nf[0] = nf1 / f2; nd[0] = nd1 / d2; @@ -116,8 +111,9 @@ pd[0] = pd1 / d2; pl[0] = pl1 / l2; - if ((*ppl_setround_function_p)(FE_UPWARD) != 0) + if ((*ppl_setround_function_p)(FE_UPWARD) != 0) { return 255; + } nf[1] = nf1 / f2; nd[1] = nd1 / d2; @@ -131,7 +127,7 @@ } // namespace -#endif // PPL_CAN_CONTROL_FPU +#endif // PPL_CAN_CONTROL_FPU // && defined(PPL_ARM_CAN_CONTROL_FPU) && PPL_ARM_CAN_CONTROL_FPU PPL::Init::Init() { @@ -171,10 +167,11 @@ fpu_set_rounding_direction(round_fpu_dir(ROUND_DIRECT)); #if defined(PPL_ARM_CAN_CONTROL_FPU) && PPL_ARM_CAN_CONTROL_FPU - if (ppl_test_rounding() != 0) + if (ppl_test_rounding() != 0) { throw std::logic_error("PPL configuration error:" " PPL_ARM_CAN_CONTROL_FPU evaluates to true," " but rounding does not work."); + } #endif // defined(PPL_ARM_CAN_CONTROL_FPU) && PPL_ARM_CAN_CONTROL_FPU #endif // PPL_CAN_CONTROL_FPU @@ -217,3 +214,31 @@ Coefficient_constants_finalize(); } } + +namespace Parma_Polyhedra_Library { + +namespace Implementation { + +namespace { + +static Parma_Polyhedra_Library::Init* Parma_Polyhedra_Library_initializer_p; + +} // namespace + +void +initialize_aux() { + if (Parma_Polyhedra_Library_initializer_p == 0) { + Parma_Polyhedra_Library_initializer_p = new Init(); + } +} + +void +finalize_aux() { + PPL_ASSERT(Parma_Polyhedra_Library_initializer_p != 0); + delete Parma_Polyhedra_Library_initializer_p; + Parma_Polyhedra_Library_initializer_p = 0; +} + +} // namespace Implementation + +} // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/src/Init_defs.hh ppl-1.2/src/Init_defs.hh --- ppl-1.1/src/Init_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Init_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Init class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/initializer.hh ppl-1.2/src/initializer.hh --- ppl-1.1/src/initializer.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/initializer.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Nifty counter object for the initialization of the library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -32,7 +32,16 @@ #else -static Parma_Polyhedra_Library::Init* Parma_Polyhedra_Library_initializer_p; +namespace Parma_Polyhedra_Library { + +namespace Implementation { + +void initialize_aux(); +void finalize_aux(); + +} // namespace Implementation + +} // namespace Parma_Polyhedra_Library #endif @@ -42,8 +51,7 @@ inline void initialize() { #ifdef PPL_NO_AUTOMATIC_INITIALIZATION - if (Parma_Polyhedra_Library_initializer_p == 0) - Parma_Polyhedra_Library_initializer_p = new Init(); + Implementation::initialize_aux(); #endif } @@ -51,9 +59,7 @@ inline void finalize() { #ifdef PPL_NO_AUTOMATIC_INITIALIZATION - PPL_ASSERT(Parma_Polyhedra_Library_initializer_p != 0); - delete Parma_Polyhedra_Library_initializer_p; - Parma_Polyhedra_Library_initializer_p = 0; + Implementation::finalize_aux(); #endif } diff -Nru ppl-1.1/src/Init_inlines.hh ppl-1.2/src/Init_inlines.hh --- ppl-1.1/src/Init_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Init_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Init class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Init_types.hh ppl-1.2/src/Init_types.hh --- ppl-1.1/src/Init_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Init_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Integer_Interval.hh ppl-1.2/src/Integer_Interval.hh --- ppl-1.1/src/Integer_Interval.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Integer_Interval.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Integer_Interval class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Interval_defs.hh ppl-1.2/src/Interval_defs.hh --- ppl-1.1/src/Interval_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Interval_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Declarations for the Interval class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,17 +24,14 @@ #ifndef PPL_Interval_defs_hh #define PPL_Interval_defs_hh 1 +#include "Interval_types.hh" #include "globals_defs.hh" #include "meta_programming.hh" #include "assign_or_swap.hh" #include "intervals_defs.hh" -#include "Interval_types.hh" #include "Interval_Info_defs.hh" #include -// Temporary! -#include - namespace Parma_Polyhedra_Library { enum Ternary { T_YES, T_NO, T_MAYBE }; @@ -158,15 +155,17 @@ I_Constraint lower_constraint() const { PPL_ASSERT(!is_empty()); - if (info().get_boundary_property(LOWER, SPECIAL)) + if (info().get_boundary_property(LOWER, SPECIAL)) { return I_Constraint(); + } return i_constraint(lower_is_open() ? GREATER_THAN : GREATER_OR_EQUAL, lower(), true); } I_Constraint upper_constraint() const { PPL_ASSERT(!is_empty()); - if (info().get_boundary_property(UPPER, SPECIAL)) + if (info().get_boundary_property(UPPER, SPECIAL)) { return I_Constraint(); + } return i_constraint(upper_is_open() ? LESS_THAN : LESS_OR_EQUAL, upper(), true); } @@ -376,78 +375,93 @@ //! Assigns to \p *this its topological closure. void topological_closure_assign() { - if (!Info::store_open || is_empty()) + if (!Info::store_open || is_empty()) { return; - if (lower_is_open() && !lower_is_boundary_infinity()) + } + if (lower_is_open() && !lower_is_boundary_infinity()) { info().set_boundary_property(LOWER, OPEN, false); - if (upper_is_open() && !upper_is_boundary_infinity()) + } + if (upper_is_open() && !upper_is_boundary_infinity()) { info().set_boundary_property(UPPER, OPEN, false); + } } void remove_inf() { PPL_ASSERT(!is_empty()); - if (!Info::store_open) + if (!Info::store_open) { return; + } info().set_boundary_property(LOWER, OPEN, true); } void remove_sup() { PPL_ASSERT(!is_empty()); - if (!Info::store_open) + if (!Info::store_open) { return; + } info().set_boundary_property(UPPER, OPEN, true); } int infinity_sign() const { PPL_ASSERT(OK()); - if (is_reverse_infinity(LOWER, lower(), info())) + if (is_reverse_infinity(LOWER, lower(), info())) { return 1; - else if (is_reverse_infinity(UPPER, upper(), info())) + } + else if (is_reverse_infinity(UPPER, upper(), info())) { return -1; - else + } + else { return 0; + } } bool contains_integer_point() const { PPL_ASSERT(OK()); - if (is_empty()) + if (is_empty()) { return false; - if (!is_bounded()) + } + if (!is_bounded()) { return true; + } Boundary l; if (lower_is_open()) { add_assign_r(l, lower(), Boundary(1), ROUND_DOWN); floor_assign_r(l, l, ROUND_DOWN); } - else + else { ceil_assign_r(l, lower(), ROUND_DOWN); + } Boundary u; if (upper_is_open()) { sub_assign_r(u, upper(), Boundary(1), ROUND_UP); ceil_assign_r(u, u, ROUND_UP); } - else + else { floor_assign_r(u, upper(), ROUND_UP); + } return u >= l; } void drop_some_non_integer_points() { - if (is_empty()) + if (is_empty()) { return; + } if (lower_is_open() && !lower_is_boundary_infinity()) { add_assign_r(lower(), lower(), Boundary(1), ROUND_DOWN); floor_assign_r(lower(), lower(), ROUND_DOWN); info().set_boundary_property(LOWER, OPEN, false); } - else + else { ceil_assign_r(lower(), lower(), ROUND_DOWN); + } if (upper_is_open() && !upper_is_boundary_infinity()) { sub_assign_r(upper(), upper(), Boundary(1), ROUND_UP); ceil_assign_r(upper(), upper(), ROUND_UP); info().set_boundary_property(UPPER, OPEN, false); } - else + else { floor_assign_r(upper(), upper(), ROUND_UP); + } } template @@ -455,14 +469,17 @@ wrap_assign(Bounded_Integer_Type_Width w, Bounded_Integer_Type_Representation r, const From& refinement) { - if (is_empty()) + if (is_empty()) { return I_EMPTY; - if (lower_is_boundary_infinity() || upper_is_boundary_infinity()) + } + if (lower_is_boundary_infinity() || upper_is_boundary_infinity()) { return assign(refinement); + } PPL_DIRTY_TEMP(Boundary, u); Result result = sub_2exp_assign_r(u, upper(), w, ROUND_UP); - if (result_overflow(result) == 0 && u > lower()) + if (result_overflow(result) == 0 && u > lower()) { return assign(refinement); + } info().clear(); switch (r) { case UNSIGNED: @@ -481,8 +498,9 @@ PPL_UNREACHABLE; break; } - if (le(LOWER, lower(), info(), UPPER, upper(), info())) + if (le(LOWER, lower(), info(), UPPER, upper(), info())) { return intersect_assign(refinement); + } PPL_DIRTY_TEMP(Interval, tmp); tmp.info().clear(); Boundary_NS::assign(LOWER, tmp.lower(), tmp.info(), diff -Nru ppl-1.1/src/Interval_Info_defs.hh ppl-1.2/src/Interval_Info_defs.hh --- ppl-1.1/src/Interval_Info_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Interval_Info_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Interval_Info class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,7 +25,6 @@ #define PPL_Interval_Info_defs_hh 1 #include "Boundary_defs.hh" - #include namespace Parma_Polyhedra_Library { @@ -66,10 +65,12 @@ template inline void set_bit(T& bits, unsigned int bit, bool value) { - if (value) + if (value) { bits |= static_cast(1) << bit; - else + } + else { reset_bit(bits, bit); + } } template @@ -145,10 +146,12 @@ } bool get_boundary_property(Boundary_Type, const Boundary_NS::Property& p) const { - if (p.type == Boundary_NS::Property::OPEN_) + if (p.type == Boundary_NS::Property::OPEN_) { return open; - else + } + else { return Boundary_NS::Property::unsupported_value; + } } void ascii_dump(std::ostream& s) const; @@ -198,18 +201,22 @@ switch (p.type) { case Boundary_NS::Property::SPECIAL_: if (store_special) { - if (t == LOWER) + if (t == LOWER) { set_bit(bitset, lower_special_bit, value); - else + } + else { set_bit(bitset, upper_special_bit, value); + } } break; case Boundary_NS::Property::OPEN_: if (store_open) { - if (t == LOWER) + if (t == LOWER) { set_bit(bitset, lower_open_bit, value); - else + } + else { set_bit(bitset, upper_open_bit, value); + } } break; default: @@ -219,19 +226,25 @@ bool get_boundary_property(Boundary_Type t, const Boundary_NS::Property& p) const { switch (p.type) { case Boundary_NS::Property::SPECIAL_: - if (!store_special) + if (!store_special) { return false; - if (t == LOWER) + } + if (t == LOWER) { return get_bit(bitset, lower_special_bit); - else + } + else { return get_bit(bitset, upper_special_bit); + } case Boundary_NS::Property::OPEN_: - if (!store_open) + if (!store_open) { return false; - else if (t == LOWER) + } + else if (t == LOWER) { return get_bit(bitset, lower_open_bit); - else + } + else { return get_bit(bitset, upper_open_bit); + } default: return false; } @@ -239,16 +252,19 @@ void set_interval_property(const Interval_NS::Property& p, bool value = true) { switch (p.type) { case Interval_NS::Property::CARDINALITY_0_: - if (cache_empty) + if (cache_empty) { set_bit(bitset, cardinality_0_bit, value); + } break; case Interval_NS::Property::CARDINALITY_1_: - if (cache_singleton) + if (cache_singleton) { set_bit(bitset, cardinality_1_bit, value); + } break; case Interval_NS::Property::CARDINALITY_IS_: - if (cache_empty || cache_singleton) + if (cache_empty || cache_singleton) { set_bit(bitset, cardinality_is_bit, value); + } break; default: break; diff -Nru ppl-1.1/src/Interval_Info_inlines.hh ppl-1.2/src/Interval_Info_inlines.hh --- ppl-1.1/src/Interval_Info_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Interval_Info_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Interval_Info class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -54,8 +54,9 @@ inline bool Interval_Info_Null_Open::ascii_load(std::istream& s) { std::string str; - if (!(s >> str)) + if (!(s >> str)) { return false; + } if (str == "open") { open = true; return true; diff -Nru ppl-1.1/src/Interval_Info_types.hh ppl-1.2/src/Interval_Info_types.hh --- ppl-1.1/src/Interval_Info_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Interval_Info_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Interval_inlines.hh ppl-1.2/src/Interval_inlines.hh --- ppl-1.1/src/Interval_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Interval_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Inline functions for the Interval class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -144,8 +144,9 @@ inline typename Enable_If::value || Is_Interval::value, bool>::type check_empty_arg(const T& x) { - if (f_info(x).may_be_empty) + if (f_info(x).may_be_empty) { return f_is_empty(x); + } else { PPL_ASSERT(!f_is_empty(x)); return false; @@ -163,10 +164,12 @@ operator==(const T1& x, const T2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return check_empty_arg(y); - else if (check_empty_arg(y)) + } + else if (check_empty_arg(y)) { return false; + } return eq(LOWER, f_lower(x), f_info(x), LOWER, f_lower(y), f_info(y)) && eq(UPPER, f_upper(x), f_info(x), UPPER, f_upper(y), f_info(y)); } @@ -190,10 +193,12 @@ Interval::contains(const T& y) const { PPL_ASSERT(OK()); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(y)) + if (check_empty_arg(y)) { return true; - if (check_empty_arg(*this)) + } + if (check_empty_arg(*this)) { return false; + } return le(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y)) && ge(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y)); } @@ -205,10 +210,12 @@ Interval::strictly_contains(const T& y) const { PPL_ASSERT(OK()); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(y)) + if (check_empty_arg(y)) { return !check_empty_arg(*this); - if (check_empty_arg(*this)) + } + if (check_empty_arg(*this)) { return false; + } return (lt(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y)) && ge(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y))) || (le(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y)) @@ -222,8 +229,9 @@ Interval::is_disjoint_from(const T& y) const { PPL_ASSERT(OK()); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(*this) || check_empty_arg(y)) + if (check_empty_arg(*this) || check_empty_arg(y)) { return true; + } return gt(LOWER, lower(), info(), UPPER, f_upper(y), f_info(y)) || lt(UPPER, upper(), info(), LOWER, f_lower(y), f_info(y)); } @@ -234,8 +242,9 @@ || Is_Interval::value, I_Result>::type Interval::assign(const From& x) { PPL_ASSERT(f_OK(x)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return assign(EMPTY); + } PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); const Result rl = Boundary_NS::assign(LOWER, lower(), to_info, @@ -253,10 +262,12 @@ || Is_Interval::value, I_Result>::type Interval::join_assign(const From& x) { PPL_ASSERT(f_OK(x)); - if (check_empty_arg(*this)) + if (check_empty_arg(*this)) { return assign(x); - if (check_empty_arg(x)) + } + if (check_empty_arg(x)) { return combine(V_EQ, V_EQ); + } Result rl; Result ru; rl = min_assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)); @@ -274,10 +285,12 @@ Interval::join_assign(const From1& x, const From2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return assign(y); - if (check_empty_arg(y)) + } + if (check_empty_arg(y)) { return assign(x); + } PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); Result rl; @@ -353,15 +366,17 @@ Interval::difference_assign(const From& x) { PPL_ASSERT(f_OK(x)); if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x)) - || gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) + || gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) { return combine(V_EQ, V_EQ); + } bool nl = ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)); bool nu = le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)); Result rl = V_EQ; Result ru = V_EQ; if (nl) { - if (nu) + if (nu) { return assign(EMPTY); + } else { info().clear_boundary_properties(LOWER); rl = complement(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x)); @@ -388,15 +403,17 @@ PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); if (lt(UPPER, f_upper(x), f_info(x), LOWER, f_lower(y), f_info(y)) - || gt(LOWER, f_lower(x), f_info(x), UPPER, f_upper(y), f_info(y))) + || gt(LOWER, f_lower(x), f_info(x), UPPER, f_upper(y), f_info(y))) { return assign(x); + } bool nl = ge(LOWER, f_lower(x), f_info(x), LOWER, f_lower(y), f_info(y)); bool nu = le(UPPER, f_upper(x), f_info(x), UPPER, f_upper(y), f_info(y)); Result rl = V_EQ; Result ru = V_EQ; if (nl) { - if (nu) + if (nu) { return assign(EMPTY); + } else { rl = complement(LOWER, lower(), info(), UPPER, f_upper(y), f_info(y)); ru = Boundary_NS::assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)); @@ -420,13 +437,15 @@ ::refine_existential(Relation_Symbol rel, const From& x) { PPL_ASSERT(OK()); PPL_ASSERT(f_OK(x)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return assign(EMPTY); + } switch (rel) { case LESS_THAN: { - if (lt(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) + if (lt(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(UPPER); Boundary_NS::assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x), true); @@ -434,8 +453,9 @@ } case LESS_OR_EQUAL: { - if (le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) + if (le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(UPPER); Boundary_NS::assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)); @@ -443,8 +463,9 @@ } case GREATER_THAN: { - if (gt(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) + if (gt(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(LOWER); Boundary_NS::assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x), true); @@ -452,8 +473,9 @@ } case GREATER_OR_EQUAL: { - if (ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) + if (ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(LOWER); Boundary_NS::assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)); @@ -463,14 +485,18 @@ return intersect_assign(x); case NOT_EQUAL: { - if (!f_is_singleton(x)) + if (!f_is_singleton(x)) { return combine(V_EQ, V_EQ); - if (check_empty_arg(*this)) + } + if (check_empty_arg(*this)) { return I_EMPTY; - if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) + } + if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) { remove_inf(); - if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) + } + if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) { remove_sup(); + } return I_ANY; } default: @@ -487,13 +513,15 @@ const From& x) { PPL_ASSERT(OK()); PPL_ASSERT(f_OK(x)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return combine(V_EQ, V_EQ); + } switch (rel) { case LESS_THAN: { - if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) + if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(UPPER); Result ru = Boundary_NS::assign(UPPER, upper(), info(), LOWER, f_lower(x), SCALAR_INFO, @@ -503,8 +531,9 @@ } case LESS_OR_EQUAL: { - if (le(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) + if (le(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(UPPER); Result ru = Boundary_NS::assign(UPPER, upper(), info(), LOWER, f_lower(x), SCALAR_INFO); @@ -513,8 +542,9 @@ } case GREATER_THAN: { - if (gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) + if (gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(LOWER); Result rl = Boundary_NS::assign(LOWER, lower(), info(), UPPER, f_upper(x), SCALAR_INFO, @@ -524,8 +554,9 @@ } case GREATER_OR_EQUAL: { - if (ge(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) + if (ge(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(LOWER); Result rl = Boundary_NS::assign(LOWER, lower(), info(), UPPER, f_upper(x), SCALAR_INFO); @@ -533,17 +564,21 @@ return I_ANY; } case EQUAL: - if (!f_is_singleton(x)) + if (!f_is_singleton(x)) { return assign(EMPTY); + } return intersect_assign(x); case NOT_EQUAL: { - if (check_empty_arg(*this)) + if (check_empty_arg(*this)) { return I_EMPTY; - if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) + } + if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) { remove_inf(); - if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) + } + if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) { remove_sup(); + } return I_ANY; } default: @@ -558,8 +593,9 @@ || Is_Interval::value, I_Result>::type Interval::neg_assign(const From& x) { PPL_ASSERT(f_OK(x)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return assign(EMPTY); + } PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); Result rl; @@ -582,19 +618,24 @@ Interval::add_assign(const From1& x, const From2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x) || check_empty_arg(y)) + if (check_empty_arg(x) || check_empty_arg(y)) { return assign(EMPTY); + } int inf_sign = Parma_Polyhedra_Library::infinity_sign(x); if (inf_sign != 0) { - if (Parma_Polyhedra_Library::infinity_sign(y) == -inf_sign) + if (Parma_Polyhedra_Library::infinity_sign(y) == -inf_sign) { return assign(EMPTY); + } } - else + else { inf_sign = Parma_Polyhedra_Library::infinity_sign(y); - if (inf_sign < 0) + } + if (inf_sign < 0) { return assign(MINUS_INFINITY); - else if (inf_sign > 0) + } + else if (inf_sign > 0) { return assign(PLUS_INFINITY); + } PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); Result rl = Boundary_NS::add_assign(LOWER, lower(), to_info, @@ -617,20 +658,24 @@ Interval::sub_assign(const From1& x, const From2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x) || check_empty_arg(y)) + if (check_empty_arg(x) || check_empty_arg(y)) { return assign(EMPTY); + } int inf_sign = Parma_Polyhedra_Library::infinity_sign(x); if (inf_sign != 0) { - if (Parma_Polyhedra_Library::infinity_sign(y) == inf_sign) + if (Parma_Polyhedra_Library::infinity_sign(y) == inf_sign) { return assign(EMPTY); + } } - else + else { inf_sign = -Parma_Polyhedra_Library::infinity_sign(y); - if (inf_sign < 0) + } + if (inf_sign < 0) { return assign(MINUS_INFINITY); - else if (inf_sign > 0) + } + else if (inf_sign > 0) { return assign(PLUS_INFINITY); - + } PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); Result rl; @@ -669,8 +714,9 @@ Interval::mul_assign(const From1& x, const From2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x) || check_empty_arg(y)) + if (check_empty_arg(x) || check_empty_arg(y)) { return assign(EMPTY); + } int xls = sgn_b(LOWER, f_lower(x), f_info(x)); int xus = (xls > 0) ? 1 : sgn_b(UPPER, f_upper(x), f_info(x)); int yls = sgn_b(LOWER, f_lower(y), f_info(y)); @@ -689,16 +735,21 @@ ls = xls; us = xus; inf: - if (ls == 0 && us == 0) + if (ls == 0 && us == 0) { return assign(EMPTY); - if (ls == -us) + } + if (ls == -us) { return set_infinities(); - if (ls < 0 || us < 0) + } + if (ls < 0 || us < 0) { inf_sign = -inf_sign; - if (inf_sign < 0) + } + if (inf_sign < 0) { return assign(MINUS_INFINITY); - else + } + else { return assign(PLUS_INFINITY); + } } } @@ -838,24 +889,31 @@ Interval::div_assign(const From1& x, const From2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x) || check_empty_arg(y)) + if (check_empty_arg(x) || check_empty_arg(y)) { return assign(EMPTY); + } int yls = sgn_b(LOWER, f_lower(y), f_info(y)); int yus = (yls > 0) ? 1 : sgn_b(UPPER, f_upper(y), f_info(y)); - if (yls == 0 && yus == 0) + if (yls == 0 && yus == 0) { return assign(EMPTY); + } int inf_sign = Parma_Polyhedra_Library::infinity_sign(x); if (inf_sign != 0) { - if (Parma_Polyhedra_Library::infinity_sign(y) != 0) + if (Parma_Polyhedra_Library::infinity_sign(y) != 0) { return assign(EMPTY); - if (yls == -yus) + } + if (yls == -yus) { return set_infinities(); - if (yls < 0 || yus < 0) - inf_sign = -inf_sign; - if (inf_sign < 0) + } + if (yls < 0 || yus < 0) { + inf_sign = -inf_sign; + } + if (inf_sign < 0) { return assign(MINUS_INFINITY); - else + } + else { return assign(PLUS_INFINITY); + } } int xls = sgn_b(LOWER, f_lower(x), f_info(x)); int xus = (xls > 0) ? 1 : sgn_b(UPPER, f_upper(x), f_info(x)); @@ -1025,22 +1083,27 @@ template inline std::ostream& operator<<(std::ostream& os, const Interval& x) { - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return os << "[]"; + } if (x.is_singleton()) { output(os, x.lower(), Numeric_Format(), ROUND_NOT_NEEDED); return os; } os << (x.lower_is_open() ? "(" : "["); - if (x.info().get_boundary_property(LOWER, SPECIAL)) + if (x.info().get_boundary_property(LOWER, SPECIAL)) { os << "-inf"; - else + } + else { output(os, x.lower(), Numeric_Format(), ROUND_NOT_NEEDED); + } os << ", "; - if (x.info().get_boundary_property(UPPER, SPECIAL)) + if (x.info().get_boundary_property(UPPER, SPECIAL)) { os << "+inf"; - else + } + else { output(os, x.upper(), Numeric_Format(), ROUND_NOT_NEEDED); + } os << (x.upper_is_open() ? ")" : "]"); return os; } @@ -1063,18 +1126,24 @@ Interval::ascii_load(std::istream& s) { using Parma_Polyhedra_Library::ascii_load; std::string str; - if (!(s >> str) || str != "info") + if (!(s >> str) || str != "info") { return false; - if (!info().ascii_load(s)) + } + if (!info().ascii_load(s)) { return false; - if (!(s >> str) || str != "lower") + } + if (!(s >> str) || str != "lower") { return false; - if (!ascii_load(s, lower())) + } + if (!ascii_load(s, lower())) { return false; - if (!(s >> str) || str != "upper") + } + if (!(s >> str) || str != "upper") { return false; - if (!ascii_load(s, upper())) + } + if (!ascii_load(s, upper())) { return false; + } PPL_ASSERT(OK()); return true; } diff -Nru ppl-1.1/src/intervals_defs.hh ppl-1.2/src/intervals_defs.hh --- ppl-1.1/src/intervals_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/intervals_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Helper classes for intervals. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,10 +24,9 @@ #ifndef PPL_intervals_defs_hh #define PPL_intervals_defs_hh 1 -#include "assert.hh" -#include - #include "Checked_Number_defs.hh" +#include "assertions.hh" +#include namespace Parma_Polyhedra_Library { @@ -157,7 +156,7 @@ Return_Type get() const { return value; } - operator Return_Type () const { + operator Return_Type() const { return get(); } }; @@ -191,7 +190,7 @@ Return_Type get() const { return *ptr; } - operator Return_Type () const { + operator Return_Type() const { return get(); } }; @@ -213,8 +212,9 @@ case V_LE: r = assign_r(to, c.value(), (ROUND_UP | ROUND_STRICT_RELATION)); r = result_relation_class(r); - if (r == V_EQ) + if (r == V_EQ) { return V_LE; + } goto lt; case V_LT: r = assign_r(to, c.value(), ROUND_UP); @@ -236,8 +236,9 @@ case V_GE: r = assign_r(to, c.value(), (ROUND_DOWN | ROUND_STRICT_RELATION)); r = result_relation_class(r); - if (r == V_EQ) + if (r == V_EQ) { return V_GE; + } goto gt; case V_GT: r = assign_r(to, c.value(), ROUND_DOWN); @@ -260,17 +261,21 @@ r = assign_r(to, c.value(), ROUND_CHECK); r = result_relation_class(r); PPL_ASSERT(r != V_LT && r != V_GT); - if (r == V_EQ) + if (r == V_EQ) { return V_EQ; - else + } + else { return V_EMPTY; + } case V_NE: r = assign_r(to, c.value(), ROUND_CHECK); r = result_relation_class(r); - if (r == V_EQ) + if (r == V_EQ) { return V_NE; - else + } + else { return V_LGE; + } default: break; } @@ -358,12 +363,14 @@ PPL_ASSERT(rel == V_EQ); return V_GE; case V_EQ: - if (is_integer(to)) + if (is_integer(to)) { return V_EQ; + } return V_EMPTY; case V_NE: - if (is_integer(to)) + if (is_integer(to)) { return V_NE; + } return V_LGE; default: return rel; diff -Nru ppl-1.1/src/Interval_templates.hh ppl-1.2/src/Interval_templates.hh --- ppl-1.1/src/Interval_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Interval_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Interval class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -100,11 +100,13 @@ if (y_ub < x_ub) { Iterator k = std::lower_bound(first, last, x_ub); if (k != last) { - if (x_ub < *k) + if (x_ub < *k) { x_ub = *k; + } } - else + else { x.upper_extend(); + } } } @@ -117,17 +119,21 @@ Iterator k = std::lower_bound(first, last, x_lb); if (k != last) { if (x_lb < *k) { - if (k != first) + if (k != first) { x_lb = *--k; - else + } + else { x.lower_extend(); + } } } else { - if (k != first) + if (k != first) { x_lb = *--k; - else + } + else { x.lower_extend(); + } } } } @@ -170,10 +176,12 @@ break; case V_EQ_PLUS_INFINITY: // Fall through. case V_LT_PLUS_INFINITY: - if (upper_r == V_EQ_PLUS_INFINITY || upper_r == V_LT_PLUS_INFINITY) + if (upper_r == V_EQ_PLUS_INFINITY || upper_r == V_LT_PLUS_INFINITY) { assign(UNIVERSE); - else + } + else { assign(EMPTY); + } break; default: PPL_UNREACHABLE; @@ -188,10 +196,12 @@ break; case V_EQ_MINUS_INFINITY: // Fall through. case V_GT_MINUS_INFINITY: - if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY) + if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY) { assign(UNIVERSE); - else + } + else { assign(EMPTY); + } break; case V_LT_PLUS_INFINITY: upper_open = true; @@ -207,19 +217,24 @@ if (!lower_boundary_infinity && !upper_boundary_infinity && (lower_bound > upper_bound - || (lower_open && lower_bound == upper_bound))) + || (lower_open && lower_bound == upper_bound))) { assign(EMPTY); + } else { - if (lower_boundary_infinity) + if (lower_boundary_infinity) { set_minus_infinity(LOWER, lower(), info(), lower_open); - else + } + else { Boundary_NS::assign(LOWER, lower(), info(), LOWER, lower_bound, SCALAR_INFO, lower_open); - if (upper_boundary_infinity) + } + if (upper_boundary_infinity) { set_plus_infinity(UPPER, upper(), info(), upper_open); - else + } + else { Boundary_NS::assign(UPPER, upper(), info(), UPPER, upper_bound, SCALAR_INFO, upper_open); + } } } @@ -239,56 +254,67 @@ // Eat leading white space. char c; do { - if (!is.get(c)) + if (!is.get(c)) { goto fail; + } } while (is_space(c)); // Get the opening parenthesis and handle the empty interval case. - if (c == '(') + if (c == '(') { lower_open = true; + } else if (c == '[') { - if (!is.get(c)) + if (!is.get(c)) { goto fail; + } if (c == ']') { // Empty interval. x.assign(EMPTY); return is; } - else + else { is.unget(); + } + } + else { + goto unexpected_char; } - else - goto unexpected; // Get the lower bound. lower_r = input(lower_bound, is, ROUND_DOWN); - if (lower_r == V_CVT_STR_UNK || lower_r == V_NAN) + if (lower_r == V_CVT_STR_UNK || lower_r == V_NAN) { goto fail; + } lower_r = result_relation_class(lower_r); // Match the comma separating the lower and upper bounds. do { - if (!is.get(c)) + if (!is.get(c)) { goto fail; + } } while (is_space(c)); - if (c != ',') - goto unexpected; + if (c != ',') { + goto unexpected_char; + } // Get the upper bound. upper_r = input(upper_bound, is, ROUND_UP); - if (upper_r == V_CVT_STR_UNK || upper_r == V_NAN) + if (upper_r == V_CVT_STR_UNK || upper_r == V_NAN) { goto fail; + } upper_r = result_relation_class(upper_r); // Get the closing parenthesis. do { - if (!is.get(c)) + if (!is.get(c)) { goto fail; + } } while (is_space(c)); - if (c == ')') + if (c == ')') { upper_open = true; + } else if (c != ']') { - unexpected: + unexpected_char: is.unget(); fail: is.setstate(std::ios::failbit); @@ -311,10 +337,12 @@ break; case V_EQ_PLUS_INFINITY: // Fall through. case V_LT_PLUS_INFINITY: - if (upper_r == V_EQ_PLUS_INFINITY || upper_r == V_LT_PLUS_INFINITY) + if (upper_r == V_EQ_PLUS_INFINITY || upper_r == V_LT_PLUS_INFINITY) { x.assign(UNIVERSE); - else + } + else { x.assign(EMPTY); + } return is; default: PPL_UNREACHABLE; @@ -331,10 +359,12 @@ upper_open = true; // Fall through. case V_EQ_MINUS_INFINITY: - if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY) + if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY) { x.assign(UNIVERSE); - else + } + else { x.assign(EMPTY); + } return is; case V_EQ_PLUS_INFINITY: // Fall through. case V_LT_PLUS_INFINITY: @@ -348,19 +378,24 @@ if (!lower_boundary_infinity && !upper_boundary_infinity && (lower_bound > upper_bound - || (lower_open && lower_bound == upper_bound))) + || (lower_open && lower_bound == upper_bound))) { x.assign(EMPTY); + } else { - if (lower_boundary_infinity) + if (lower_boundary_infinity) { set_minus_infinity(LOWER, x.lower(), x.info(), lower_open); - else + } + else { assign(LOWER, x.lower(), x.info(), LOWER, lower_bound, SCALAR_INFO, lower_open); - if (upper_boundary_infinity) + } + if (upper_boundary_infinity) { set_plus_infinity(UPPER, x.upper(), x.info(), upper_open); - else + } + else { assign(UPPER, x.upper(), x.info(), UPPER, upper_bound, SCALAR_INFO, upper_open); + } } return is; } @@ -380,12 +415,14 @@ } // Weakening the upper bound. if (!upper_is_boundary_infinity() && !y.upper_is_boundary_infinity() - && y.upper() <= upper()) + && y.upper() <= upper()) { upper_extend(); + } // Weakening the lower bound. if (!lower_is_boundary_infinity() && !y.lower_is_boundary_infinity() - && y.lower() >= lower()) + && y.lower() >= lower()) { lower_extend(); + } return true; } diff -Nru ppl-1.1/src/Interval_types.hh ppl-1.2/src/Interval_types.hh --- ppl-1.1/src/Interval_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Interval_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/iterator_to_const_defs.hh ppl-1.2/src/iterator_to_const_defs.hh --- ppl-1.1/src/iterator_to_const_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/iterator_to_const_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* iterator_to_const and const_iterator_to_const class declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -26,7 +26,6 @@ #include "iterator_to_const_types.hh" #include "Powerset_types.hh" -//#include "Ask_Tell_types.hh" #include #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS diff -Nru ppl-1.1/src/iterator_to_const_inlines.hh ppl-1.2/src/iterator_to_const_inlines.hh --- ppl-1.1/src/iterator_to_const_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/iterator_to_const_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* iterator_to_const and const_iterator_to_const class implementations: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/iterator_to_const_types.hh ppl-1.2/src/iterator_to_const_types.hh --- ppl-1.1/src/iterator_to_const_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/iterator_to_const_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Linear_Expression.cc ppl-1.2/src/Linear_Expression.cc --- ppl-1.1/src/Linear_Expression.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -56,11 +56,9 @@ case DENSE: impl = new Linear_Expression_Impl(); break; - case SPARSE: impl = new Linear_Expression_Impl(); break; - default: PPL_UNREACHABLE; } @@ -72,11 +70,9 @@ case DENSE: impl = new Linear_Expression_Impl(space_dim, x); break; - case SPARSE: impl = new Linear_Expression_Impl(space_dim, x); break; - default: PPL_UNREACHABLE; } @@ -87,11 +83,9 @@ case DENSE: impl = new Linear_Expression_Impl(*e.impl); break; - case SPARSE: impl = new Linear_Expression_Impl(*e.impl); break; - default: PPL_UNREACHABLE; } @@ -103,11 +97,9 @@ case DENSE: impl = new Linear_Expression_Impl(*e.impl); break; - case SPARSE: impl = new Linear_Expression_Impl(*e.impl); break; - default: PPL_UNREACHABLE; } @@ -119,11 +111,9 @@ case DENSE: impl = new Linear_Expression_Impl(*e.impl, space_dim); break; - case SPARSE: impl = new Linear_Expression_Impl(*e.impl, space_dim); break; - default: PPL_UNREACHABLE; } @@ -136,11 +126,9 @@ case DENSE: impl = new Linear_Expression_Impl(*e.impl, space_dim); break; - case SPARSE: impl = new Linear_Expression_Impl(*e.impl, space_dim); break; - default: PPL_UNREACHABLE; } @@ -152,11 +140,9 @@ case DENSE: impl = new Linear_Expression_Impl(n); break; - case SPARSE: impl = new Linear_Expression_Impl(n); break; - default: PPL_UNREACHABLE; } @@ -167,11 +153,9 @@ case DENSE: impl = new Linear_Expression_Impl(v); break; - case SPARSE: impl = new Linear_Expression_Impl(v); break; - default: PPL_UNREACHABLE; break; @@ -180,8 +164,9 @@ void PPL::Linear_Expression::set_representation(Representation r) { - if (representation() == r) + if (representation() == r) { return; + } Linear_Expression tmp(*this, r); swap(*this, tmp); } diff -Nru ppl-1.1/src/Linear_Expression_defs.hh ppl-1.2/src/Linear_Expression_defs.hh --- ppl-1.1/src/Linear_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -51,6 +51,7 @@ #include "Linear_Expression_Interface_defs.hh" #include "Variable_defs.hh" +#include namespace Parma_Polyhedra_Library { @@ -314,14 +315,21 @@ template explicit Linear_Expression(const LE_Adapter& e, - typename Enable_If::value, void*>::type = 0); + typename + Enable_If::value, + void*>::type = 0); /*! \brief Copy constructor from a linear expression adapter that takes a Representation. */ template - Linear_Expression(const LE_Adapter& e, Representation r, - typename Enable_If::value, void*>::type = 0); + Linear_Expression(const LE_Adapter& e, + Representation r, + typename + Enable_If::value, + void*>::type = 0); /*! \brief Copy constructor from a linear expression adapter that takes a @@ -332,8 +340,12 @@ */ template explicit - Linear_Expression(const LE_Adapter& e, dimension_type space_dim, - typename Enable_If::value, void*>::type = 0); + Linear_Expression(const LE_Adapter& e, + dimension_type space_dim, + typename + Enable_If::value, + void*>::type = 0); /*! \brief Copy constructor from a linear expression adapter that takes a @@ -341,8 +353,12 @@ */ template Linear_Expression(const LE_Adapter& e, - dimension_type space_dim, Representation r, - typename Enable_If::value, void*>::type = 0); + dimension_type space_dim, + Representation r, + typename + Enable_If::value, + void*>::type = 0); //! Assignment operator. Linear_Expression& operator=(const Linear_Expression& e); @@ -381,7 +397,7 @@ public: typedef std::bidirectional_iterator_tag iterator_category; typedef const Coefficient value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef Coefficient_traits::const_reference reference; @@ -393,32 +409,32 @@ //! The copy constructor. /*! - \param itr + \param i The %iterator that will be copied. This constructor takes \f$O(1)\f$ time. */ - const_iterator(const const_iterator& itr); + const_iterator(const const_iterator& i); ~const_iterator(); - //! Swaps itr with *this. + //! Swaps \p i with \p *this. /*! - \param itr - The %iterator that will be swapped with *this. + \param i + The %iterator that will be swapped with \p *this. This method takes \f$O(1)\f$ time. */ - void m_swap(const_iterator& itr); + void m_swap(const_iterator& i); - //! Assigns \p itr to *this . + //! Assigns \p i to *this . /*! - \param itr + \param i The %iterator that will be assigned into *this. This method takes \f$O(1)\f$ time. */ - const_iterator& operator=(const const_iterator& itr); + const_iterator& operator=(const const_iterator& i); //! Navigates to the next nonzero coefficient. /*! @@ -443,24 +459,24 @@ */ Variable variable() const; - //! Compares \p *this with x . + //! Compares \p *this with \p i. /*! - \param x + \param i The %iterator that will be compared with *this. */ - bool operator==(const const_iterator& x) const; + bool operator==(const const_iterator& i) const; - //! Compares \p *this with x . + //! Compares \p *this with \p i . /*! - \param x + \param i The %iterator that will be compared with *this. */ - bool operator!=(const const_iterator& x) const; + bool operator!=(const const_iterator& i) const; private: //! Constructor from a const_iterator_interface*. //! The new object takes ownership of the dynamic object. - const_iterator(Linear_Expression_Interface::const_iterator_interface* itr); + const_iterator(Linear_Expression_Interface::const_iterator_interface* i); Linear_Expression_Interface::const_iterator_interface* itr; @@ -775,14 +791,17 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; - //! Sets `row' to a copy of the row that implements *this. - void get_row(Dense_Row& row) const; + //! Sets \p r to a copy of the row that implements \p *this. + void get_row(Dense_Row& r) const; - //! Sets `row' to a copy of the row that implements *this. - void get_row(Sparse_Row& row) const; + //! Sets \p r to a copy of the row that implements \p *this. + void get_row(Sparse_Row& r) const; - //! Returns true if there is a variable in [first,last) whose coefficient - //! is nonzero in both *this and x. + /*! \brief + Returns \p true if there is a variable from index \p first (included) + to index \p last (excluded) whose coefficient is nonzero in both + \p *this and \p x. + */ bool have_a_common_variable(const Linear_Expression& x, Variable first, Variable last) const; diff -Nru ppl-1.1/src/Linear_Expression_Impl.cc ppl-1.2/src/Linear_Expression_Impl.cc --- ppl-1.1/src/Linear_Expression_Impl.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_Impl.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Impl class implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,7 +25,7 @@ #include "Linear_Expression_Impl_defs.hh" #include "Dense_Row_defs.hh" #include "Sparse_Row_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace Parma_Polyhedra_Library { @@ -39,8 +39,9 @@ template <> bool Linear_Expression_Impl::OK() const { - if (row.size() == 0) + if (row.size() == 0) { return false; + } for (Sparse_Row::const_iterator i = row.begin(), i_end = row.end(); i != i_end; ++i) { if (*i == 0) { @@ -59,8 +60,9 @@ Linear_Expression_Impl ::remove_space_dimensions(const Variables_Set& vars) { PPL_ASSERT(vars.space_dimension() <= space_dimension()); - if (vars.empty()) + if (vars.empty()) { return; + } // For each variable to be removed, replace the corresponding coefficient // by shifting left the coefficient to the right that will be kept. @@ -71,14 +73,16 @@ for (++vsi; vsi != vsi_end; ++vsi) { const dimension_type vsi_col = *vsi+1; // Move all columns in between to the left. - while (src_col < vsi_col) + while (src_col < vsi_col) { row.swap_coefficients(dst_col++, src_col++); + } ++src_col; } // Move any remaining columns. const dimension_type sz = row.size(); - while (src_col < sz) + while (src_col < sz) { row.swap_coefficients(dst_col++, src_col++); + } // The number of remaining coefficients is `dst_col'. row.resize(dst_col); @@ -90,8 +94,9 @@ Linear_Expression_Impl ::remove_space_dimensions(const Variables_Set& vars) { PPL_ASSERT(vars.space_dimension() <= space_dimension()); - if (vars.empty()) + if (vars.empty()) { return; + } // For each variable to be removed, replace the corresponding coefficient // by shifting left the coefficient to the right that will be kept. @@ -102,8 +107,9 @@ dimension_type num_removed = 0; while (vsi != vsi_end) { // Delete the element. - if (src != row_end && src.index() == *vsi + 1) + if (src != row_end && src.index() == *vsi + 1) { src = row.reset(src); + } ++num_removed; ++vsi; if (vsi != vsi_end) { @@ -133,18 +139,22 @@ template <> bool Linear_Expression_Impl::is_zero() const { - for (dimension_type i = row.size(); i-- > 0; ) - if (row[i] != 0) + for (dimension_type i = row.size(); i-- > 0; ) { + if (row[i] != 0) { return false; + } + } return true; } template <> bool Linear_Expression_Impl::all_homogeneous_terms_are_zero() const { - for (dimension_type i = 1; i < row.size(); ++i) - if (row[i] != 0) + for (dimension_type i = 1; i < row.size(); ++i) { + if (row[i] != 0) { return false; + } + } return true; } @@ -152,9 +162,11 @@ bool Linear_Expression_Impl::all_zeroes(dimension_type start, dimension_type end) const { - for (dimension_type i = start; i < end; ++i) - if (row[i] != 0) + for (dimension_type i = start; i < end; ++i) { + if (row[i] != 0) { return false; + } + } return true; } @@ -164,9 +176,11 @@ dimension_type end) const { PPL_ASSERT(start <= end); dimension_type result = 0; - for (dimension_type i = start; i < end; ++i) - if (row[i] == 0) + for (dimension_type i = start; i < end; ++i) { + if (row[i] == 0) { ++result; + } + } return result; } @@ -176,27 +190,33 @@ dimension_type end) const { dimension_type i; - for (i = start; i < end; ++i) - if (row[i] != 0) + for (i = start; i < end; ++i) { + if (row[i] != 0) { break; + } + } - if (i == end) + if (i == end) { return 0; + } PPL_ASSERT(row[i] != 0); Coefficient result = row[i]; ++i; - if (result < 0) + if (result < 0) { neg_assign(result); + } for ( ; i < end; ++i) { - if (row[i] == 0) + if (row[i] == 0) { continue; + } gcd_assign(result, row[i], result); - if (result == 1) + if (result == 1) { return result; + } } return result; @@ -209,21 +229,24 @@ Sparse_Row::const_iterator i = row.lower_bound(start); Sparse_Row::const_iterator i_end = row.lower_bound(end); - if (i == i_end) + if (i == i_end) { return 0; + } PPL_ASSERT(*i != 0); Coefficient result = *i; ++i; - if (result < 0) + if (result < 0) { neg_assign(result); + } for ( ; i != i_end; ++i) { gcd_assign(result, *i, result); - if (result == 1) + if (result == 1) { return result; + } } return result; @@ -236,9 +259,11 @@ Variables_Set::const_iterator j = vars.begin(); Variables_Set::const_iterator j_end = vars.end(); - for ( ; j != j_end; ++j) - if (row[*j + 1] != 0) + for ( ; j != j_end; ++j) { + if (row[*j + 1] != 0) { return false; + } + } return true; } @@ -254,10 +279,12 @@ for ( ; j != j_end; ++j) { i = row.lower_bound(i, *j + 1); - if (i == i_end) + if (i == i_end) { break; - if (i.index() == *j + 1) + } + if (i.index() == *j + 1) { return false; + } } return true; @@ -269,13 +296,16 @@ ::all_zeroes_except(const Variables_Set& vars, dimension_type start, dimension_type end) const { if (start == 0) { - if (row[0] != 0) + if (row[0] != 0) { return false; + } ++start; } - for (dimension_type i = start; i < end; ++i) - if (row[i] != 0 && vars.count(i - 1) == 0) + for (dimension_type i = start; i < end; ++i) { + if (row[i] != 0 && vars.count(i - 1) == 0) { return false; + } + } return true; } @@ -285,11 +315,13 @@ ::all_zeroes_except(const Variables_Set& vars, dimension_type start, dimension_type end) const { PPL_ASSERT(start <= end); - if (start == end) + if (start == end) { return true; + } if (start == 0) { - if (row.find(0) != row.end()) + if (row.find(0) != row.end()) { return false; + } start = 1; } @@ -297,9 +329,11 @@ PPL_ASSERT(start != 0); PPL_ASSERT(start <= end); for (Sparse_Row::const_iterator i = row.lower_bound(start), - i_end = row.lower_bound(end); i != i_end; ++i) - if (vars.count(i.index() - 1) == 0) + i_end = row.lower_bound(end); i != i_end; ++i) { + if (vars.count(i.index() - 1) == 0) { return false; + } + } return true; } @@ -307,9 +341,11 @@ template <> dimension_type Linear_Expression_Impl::last_nonzero() const { - for (dimension_type i = row.size(); i-- > 0; ) - if (row[i] != 0) + for (dimension_type i = row.size(); i-- > 0; ) { + if (row[i] != 0) { return i; + } + } return 0; } @@ -319,9 +355,11 @@ ::first_nonzero(dimension_type first, dimension_type last) const { PPL_ASSERT(first <= last); PPL_ASSERT(last <= row.size()); - for (dimension_type i = first; i < last; ++i) - if (row[i] != 0) + for (dimension_type i = first; i < last; ++i) { + if (row[i] != 0) { return i; + } + } return last; } @@ -332,9 +370,11 @@ ::last_nonzero(dimension_type first, dimension_type last) const { PPL_ASSERT(first <= last); PPL_ASSERT(last <= row.size()); - for (dimension_type i = last; i-- > first; ) - if (row[i] != 0) + for (dimension_type i = last; i-- > first; ) { + if (row[i] != 0) { return i; + } + } return last; } @@ -345,9 +385,11 @@ ::has_a_free_dimension_helper(std::set& x) const { typedef std::set set_t; set_t result; - for (set_t::const_iterator i = x.begin(), i_end = x.end(); i != i_end; ++i) - if (row[*i] == 0) + for (set_t::const_iterator i = x.begin(), i_end = x.end(); i != i_end; ++i) { + if (row[*i] == 0) { result.insert(*i); + } + } using std::swap; swap(x, result); } @@ -364,13 +406,16 @@ set_t::const_iterator i_end = x.end(); for ( ; i != i_end; ++i) { itr = row.lower_bound(itr, *i); - if (itr == itr_end) + if (itr == itr_end) { break; - if (itr.index() != *i) + } + if (itr.index() != *i) { result.insert(*i); + } } - for ( ; i != i_end; ++i) + for ( ; i != i_end; ++i) { result.insert(*i); + } using std::swap; swap(x, result); } @@ -386,9 +431,11 @@ PPL_ASSERT(start <= end); PPL_ASSERT(end <= row.size()); PPL_ASSERT(end <= y.row.size()); - for (dimension_type i = start; i < end; ++i) - if (row[i] != 0 && y.row[i] != 0) + for (dimension_type i = start; i < end; ++i) { + if (row[i] != 0 && y.row[i] != 0) { return true; + } + } return false; } @@ -404,9 +451,11 @@ PPL_ASSERT(end <= row.size()); PPL_ASSERT(end <= y.row.size()); for (Sparse_Row::const_iterator i = row.lower_bound(start), - i_end = row.lower_bound(end); i != i_end; ++i) - if (y.row[i.index()] != 0) + i_end = row.lower_bound(end); i != i_end; ++i) { + if (y.row[i.index()] != 0) { return true; + } + } return false; } @@ -435,12 +484,15 @@ Sparse_Row::const_iterator j = y.row.lower_bound(start); Sparse_Row::const_iterator j_end = y.row.lower_bound(end); while (i != i_end && j != j_end) { - if (i.index() == j.index()) + if (i.index() == j.index()) { return true; - if (i.index() < j.index()) + } + if (i.index() < j.index()) { ++i; - else + } + else { ++j; + } } return false; } @@ -449,8 +501,9 @@ void Linear_Expression_Impl::const_iterator ::skip_zeroes_forward() { - while (itr != row->end() && *itr == 0) + while (itr != row->end() && *itr == 0) { ++itr; + } } template <> @@ -465,4 +518,3 @@ } } // namespace Parma_Polyhedra_Library - diff -Nru ppl-1.1/src/Linear_Expression_Impl_defs.hh ppl-1.2/src/Linear_Expression_Impl_defs.hh --- ppl-1.1/src/Linear_Expression_Impl_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_Impl_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Impl class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,13 +25,13 @@ #define PPL_Linear_Expression_Impl_defs_hh 1 #include "Linear_Expression_Impl_types.hh" +#include "Linear_Expression_Interface_defs.hh" #include "Coefficient_defs.hh" #include "Variable_defs.hh" #include "Variables_Set_defs.hh" #include "Dense_Row_defs.hh" #include "Sparse_Row_defs.hh" #include -#include "Linear_Expression_Interface_defs.hh" namespace Parma_Polyhedra_Library { @@ -560,17 +560,17 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Sets `row' to a copy of the row that implements *this. - virtual void get_row(Dense_Row& row) const; - - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Sets `row' to a copy of the row that implements *this. - virtual void get_row(Sparse_Row& row) const; + // NOTE: This method is public, but it is not exposed in + // Linear_Expression, so that it can be used internally in the PPL, + // by friends of Linear_Expression. + //! Sets \p r to a copy of the row that implements \p *this. + virtual void get_row(Dense_Row& r) const; + + // NOTE: This method is public, but it is not exposed in + // Linear_Expression, so that it can be used internally in the PPL, + // by friends of Linear_Expression. + //! Sets \p r to a copy of the row that implements \p *this. + virtual void get_row(Sparse_Row& r) const; //! Implementation sizing constructor. /*! diff -Nru ppl-1.1/src/Linear_Expression_Impl_inlines.hh ppl-1.2/src/Linear_Expression_Impl_inlines.hh --- ppl-1.1/src/Linear_Expression_Impl_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_Impl_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Impl class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -60,8 +60,9 @@ Linear_Expression_Impl ::Linear_Expression_Impl(Coefficient_traits::const_reference n) : row(1) { - if (n != 0) + if (n != 0) { row.insert(0, n); + } PPL_ASSERT(OK()); } @@ -81,8 +82,9 @@ template inline Coefficient_traits::const_reference Linear_Expression_Impl::coefficient(Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { return Coefficient_zero(); + } return row.get(v.id() + 1); } @@ -92,10 +94,12 @@ ::set_coefficient(Variable v, Coefficient_traits::const_reference n) { PPL_ASSERT(v.space_dimension() <= space_dimension()); const dimension_type i = v.space_dimension(); - if (n == 0) + if (n == 0) { row.reset(i); - else + } + else { row.insert(i, n); + } PPL_ASSERT(OK()); } @@ -109,10 +113,12 @@ inline void Linear_Expression_Impl ::set_inhomogeneous_term(Coefficient_traits::const_reference n) { - if (n == 0) + if (n == 0) { row.reset(0); - else + } + else { row.insert(0, n); + } PPL_ASSERT(OK()); } @@ -148,8 +154,9 @@ Linear_Expression_Impl::operator+=(Coefficient_traits::const_reference n) { typename Row::iterator itr = row.insert(0); (*itr) += n; - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -159,8 +166,9 @@ Linear_Expression_Impl::operator-=(Coefficient_traits::const_reference n) { typename Row::iterator itr = row.insert(0); (*itr) -= n; - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -203,8 +211,9 @@ template <> inline dimension_type Linear_Expression_Impl::last_nonzero() const { - if (row.num_stored_elements() == 0) + if (row.num_stored_elements() == 0) { return 0; + } Sparse_Row::const_iterator i = row.end(); --i; return i.index(); @@ -218,10 +227,12 @@ PPL_ASSERT(last <= row.size()); Sparse_Row::const_iterator i = row.lower_bound(first); - if (i != row.end() && i.index() < last) + if (i != row.end() && i.index() < last) { return i.index(); - else + } + else { return last; + } } template <> @@ -233,8 +244,9 @@ Sparse_Row::const_iterator itr1 = row.lower_bound(first); Sparse_Row::const_iterator itr2 = row.lower_bound(last); - if (itr1 == itr2) + if (itr1 == itr2) { return last; + } --itr2; return itr2.index(); diff -Nru ppl-1.1/src/Linear_Expression_Impl_templates.hh ppl-1.2/src/Linear_Expression_Impl_templates.hh --- ppl-1.1/src/Linear_Expression_Impl_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_Impl_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Impl class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -126,8 +126,9 @@ Coefficient_traits::const_reference c2) { PPL_ASSERT(c1 != 0); PPL_ASSERT(c2 != 0); - if (space_dimension() < y.space_dimension()) + if (space_dimension() < y.space_dimension()) { set_space_dimension(y.space_dimension()); + } linear_combine(y, c1, c2, 0, y.space_dimension() + 1); PPL_ASSERT(OK()); } @@ -139,8 +140,9 @@ ::linear_combine_lax(const Linear_Expression_Impl& y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2) { - if (space_dimension() < y.space_dimension()) + if (space_dimension() < y.space_dimension()) { set_space_dimension(y.space_dimension()); + } linear_combine_lax(y, c1, c2, 0, y.space_dimension() + 1); PPL_ASSERT(OK()); } @@ -160,47 +162,55 @@ while (i != i_end && j != j_end) { if (i.index() < j.index()) { const int s = sgn(*i); - if (s != 0) + if (s != 0) { return 2*s; + } ++i; continue; } if (i.index() > j.index()) { const int s = sgn(*j); - if (s != 0) + if (s != 0) { return -2*s; + } ++j; continue; } PPL_ASSERT(i.index() == j.index()); const int s = cmp(*i, *j); - if (s < 0) + if (s < 0) { return -2; - if (s > 0) + } + if (s > 0) { return 2; + } PPL_ASSERT(s == 0); ++i; ++j; } for ( ; i != i_end; ++i) { const int s = sgn(*i); - if (s != 0) + if (s != 0) { return 2*s; + } } for ( ; j != j_end; ++j) { const int s = sgn(*j); - if (s != 0) + if (s != 0) { return -2*s; + } } // If all the coefficients in `x' equal all the coefficients in `y' // (starting from position 1) we compare coefficients in position 0, // i.e., inhomogeneous terms. const int comp = cmp(x.row.get(0), y.row.get(0)); - if (comp > 0) + if (comp > 0) { return 1; - if (comp < 0) + } + if (comp < 0) { return -1; + } PPL_ASSERT(comp == 0); // `x' and `y' are equal. @@ -209,11 +219,12 @@ template Linear_Expression_Impl::Linear_Expression_Impl(const Variable v) { - if (v.space_dimension() > max_space_dimension()) + if (v.space_dimension() > max_space_dimension()) { throw std::length_error("Linear_Expression_Impl::" "Linear_Expression_Impl(v):\n" "v exceeds the maximum allowed " "space dimension."); + } set_space_dimension(v.space_dimension()); (*this) += v; PPL_ASSERT(OK()); @@ -229,14 +240,14 @@ template void -Linear_Expression_Impl::get_row(Dense_Row& row) const { - row = this->row; +Linear_Expression_Impl::get_row(Dense_Row& r) const { + r = this->row; } template void -Linear_Expression_Impl::get_row(Sparse_Row& row) const { - row = this->row; +Linear_Expression_Impl::get_row(Sparse_Row& r) const { + r = this->row; } template @@ -244,8 +255,9 @@ Linear_Expression_Impl ::permute_space_dimensions(const std::vector& cycle) { const dimension_type n = cycle.size(); - if (n < 2) + if (n < 2) { return; + } if (n == 2) { row.swap_coefficients(cycle[0].space_dimension(), @@ -254,11 +266,13 @@ else { PPL_DIRTY_TEMP_COEFFICIENT(tmp); tmp = row.get(cycle.back().space_dimension()); - for (dimension_type i = n - 1; i-- > 0; ) + for (dimension_type i = n - 1; i-- > 0; ) { row.swap_coefficients(cycle[i + 1].space_dimension(), cycle[i].space_dimension()); - if (tmp == 0) + } + if (tmp == 0) { row.reset(cycle[0].space_dimension()); + } else { using std::swap; swap(tmp, row[cycle[0].space_dimension()]); @@ -280,16 +294,19 @@ Linear_Expression_Impl& Linear_Expression_Impl::operator+=(const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) + if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) { throw std::length_error("Linear_Expression_Impl& " "operator+=(e, v):\n" "v exceeds the maximum allowed space dimension."); - if (space_dimension() < v_space_dim) + } + if (space_dimension() < v_space_dim) { set_space_dimension(v_space_dim); + } typename Row::iterator itr = row.insert(v_space_dim); ++(*itr); - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -308,16 +325,19 @@ Linear_Expression_Impl& Linear_Expression_Impl::operator-=(const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) + if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) { throw std::length_error("Linear_Expression_Impl& " "operator-=(e, v):\n" "v exceeds the maximum allowed space dimension."); - if (space_dimension() < v_space_dim) + } + if (space_dimension() < v_space_dim) { set_space_dimension(v_space_dim); + } typename Row::iterator itr = row.insert(v_space_dim); --(*itr); - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -332,8 +352,9 @@ return *this; } for (typename Row::iterator i = row.begin(), - i_end = row.end(); i != i_end; ++i) + i_end = row.end(); i != i_end; ++i) { (*i) *= n; + } PPL_ASSERT(OK()); return *this; } @@ -346,10 +367,12 @@ const typename Row::iterator& i_end = row.end(); while (i != i_end) { (*i) /= n; - if (*i == 0) + if (*i == 0) { i = row.reset(i); - else + } + else { ++i; + } } PPL_ASSERT(OK()); return *this; @@ -360,8 +383,9 @@ void Linear_Expression_Impl::negate() { for (typename Row::iterator i = row.begin(), - i_end = row.end(); i != i_end; ++i) + i_end = row.end(); i != i_end; ++i) { neg_assign(*i); + } PPL_ASSERT(OK()); } @@ -371,18 +395,22 @@ Linear_Expression_Impl::add_mul_assign(Coefficient_traits::const_reference n, const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) + if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) { throw std::length_error("Linear_Expression_Impl& " "add_mul_assign(e, n, v):\n" "v exceeds the maximum allowed space dimension."); - if (space_dimension() < v_space_dim) + } + if (space_dimension() < v_space_dim) { set_space_dimension(v_space_dim); - if (n == 0) + } + if (n == 0) { return *this; + } typename Row::iterator itr = row.insert(v_space_dim); (*itr) += n; - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -394,18 +422,22 @@ ::sub_mul_assign(Coefficient_traits::const_reference n, const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) + if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) { throw std::length_error("Linear_Expression_Impl& " "sub_mul_assign(e, n, v):\n" "v exceeds the maximum allowed space dimension."); - if (space_dimension() < v_space_dim) + } + if (space_dimension() < v_space_dim) { set_space_dimension(v_space_dim); - if (n == 0) + } + if (n == 0) { return *this; + } typename Row::iterator itr = row.insert(v_space_dim); (*itr) -= n; - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -416,8 +448,9 @@ Linear_Expression_Impl ::add_mul_assign(Coefficient_traits::const_reference factor, const Linear_Expression_Impl& y) { - if (factor != 0) + if (factor != 0) { linear_combine(y, Coefficient_one(), factor); + } } template @@ -426,8 +459,9 @@ Linear_Expression_Impl ::sub_mul_assign(Coefficient_traits::const_reference factor, const Linear_Expression_Impl& y) { - if (factor != 0) + if (factor != 0) { linear_combine(y, Coefficient_one(), -factor); + } } template @@ -438,22 +472,27 @@ for (typename Row::const_iterator i = row.lower_bound(1), i_end = row.end(); i != i_end; ++i) { ev = *i; - if (ev == 0) + if (ev == 0) { continue; + } if (!first) { - if (ev > 0) + if (ev > 0) { s << " + "; + } else { s << " - "; neg_assign(ev); } } - else + else { first = false; - if (ev == -1) + } + if (ev == -1) { s << "-"; - else if (ev != 1) + } + else if (ev != 1) { s << ev << "*"; + } IO_Operators::operator<<(s, Variable(i.index() - 1)); } // Inhomogeneous term. @@ -461,21 +500,24 @@ it = row[0]; if (it != 0) { if (!first) { - if (it > 0) + if (it > 0) { s << " + "; + } else { s << " - "; neg_assign(it); } } - else + else { first = false; + } s << it; } - if (first) + if (first) { // The null linear expression. s << Coefficient_zero(); + } } template @@ -488,10 +530,12 @@ void Linear_Expression_Impl ::set(dimension_type i, Coefficient_traits::const_reference n) { - if (n == 0) + if (n == 0) { row.reset(i); - else + } + else { row.insert(i, n); + } PPL_ASSERT(OK()); } @@ -504,8 +548,9 @@ // each of the resulting coefficients will be nonzero iff the initial // coefficient was. for (typename Row::iterator i = row.lower_bound(start), - i_end = row.lower_bound(end); i != i_end; ++i) + i_end = row.lower_bound(end); i != i_end; ++i) { Parma_Polyhedra_Library::exact_div_assign(*i, *i, c); + } PPL_ASSERT(OK()); } @@ -517,13 +562,16 @@ if (c == 0) { typename Row::iterator i = row.lower_bound(start); const typename Row::iterator& i_end = row.end(); - while (i != i_end && i.index() < end) + while (i != i_end && i.index() < end) { i = row.reset(i); + } } else { for (typename Row::iterator - i = row.lower_bound(start), i_end = row.lower_bound(end); i != i_end; ++i) + i = row.lower_bound(start), i_end = row.lower_bound(end); + i != i_end; ++i) { (*i) *= c; + } } PPL_ASSERT(OK()); } @@ -557,8 +605,9 @@ PPL_ASSERT(c2 == 0); typename Row::iterator i = row.lower_bound(start); const typename Row::iterator& i_end = row.end(); - while (i != i_end && i.index() < end) + while (i != i_end && i.index() < end) { i = row.reset(i); + } } else { PPL_ASSERT(c1 == 0); @@ -587,8 +636,9 @@ ++i; ++j; } - while (i != i_end && i.index() < end) + while (i != i_end && i.index() < end) { i = row.reset(i); + } while (j != j_last) { i = row.insert(i, j.index(), *j); (*i) *= c2; @@ -602,8 +652,9 @@ PPL_ASSERT(c1 != 0); PPL_ASSERT(c2 == 0); for (typename Row::iterator i = row.lower_bound(start), - i_end = row.lower_bound(end); i != i_end; ++i) + i_end = row.lower_bound(end); i != i_end; ++i) { (*i) *= c1; + } } else { PPL_ASSERT(c1 != 0); @@ -620,17 +671,21 @@ typename Row::iterator i = row.lower_bound(1); typename Row::iterator i_end = row.end(); - for ( ; i != i_end; ++i) - if (*i != 0) + for ( ; i != i_end; ++i) { + if (*i != 0) { break; + } + } if (i != i_end && *i < 0) { - for ( ; i != i_end; ++i) + for ( ; i != i_end; ++i) { neg_assign(*i); + } // Negate the first coefficient, too. typename Row::iterator first = row.begin(); - if (first != row.end() && first.index() == 0) + if (first != row.end() && first.index() == 0) { neg_assign(*first); + } } PPL_ASSERT(OK()); } @@ -642,8 +697,9 @@ PPL_ASSERT(last <= row.size()); typename Row::iterator i = row.lower_bound(first); typename Row::iterator i_end = row.lower_bound(last); - for ( ; i != i_end; ++i) + for ( ; i != i_end; ++i) { neg_assign(*i); + } PPL_ASSERT(OK()); } @@ -732,31 +788,38 @@ typename Row2::const_iterator j_end = y.row.lower_bound(end); while (i != i_end && j != j_end) { if (i.index() == j.index()) { - if (*i != *j) + if (*i != *j) { return false; + } ++i; ++j; } else { if (i.index() < j.index()) { - if (*i != 0) + if (*i != 0) { return false; + } ++i; } else { PPL_ASSERT(i.index() > j.index()); - if (*j != 0) + if (*j != 0) { return false; + } ++j; } } } - for ( ; i != i_end; ++i) - if (*i != 0) + for ( ; i != i_end; ++i) { + if (*i != 0) { return false; - for ( ; j != j_end; ++j) - if (*j != 0) + } + } + for ( ; j != j_end; ++j) { + if (*j != 0) { return false; + } + } return true; } @@ -775,13 +838,16 @@ // Deal with trivial cases. if (c1 == 0) { - if (c2 == 0) + if (c2 == 0) { return true; - else + } + else { return y.all_zeroes(start, end); + } } - if (c2 == 0) + if (c2 == 0) { return x.all_zeroes(start, end); + } PPL_ASSERT(c1 != 0); PPL_ASSERT(c2 != 0); @@ -791,31 +857,38 @@ typename Row2::const_iterator j_end = y.row.lower_bound(end); while (i != i_end && j != j_end) { if (i.index() == j.index()) { - if ((*i) * c1 != (*j) * c2) + if ((*i) * c1 != (*j) * c2) { return false; + } ++i; ++j; } else { if (i.index() < j.index()) { - if (*i != 0) + if (*i != 0) { return false; + } ++i; } else { PPL_ASSERT(i.index() > j.index()); - if (*j != 0) + if (*j != 0) { return false; + } ++j; } } } - for ( ; i != i_end; ++i) - if (*i != 0) + for ( ; i != i_end; ++i) { + if (*i != 0) { return false; - for ( ; j != j_end; ++j) - if (*j != 0) + } + } + for ( ; j != j_end; ++j) { + if (*j != 0) { return false; + } + } return true; } @@ -1209,8 +1282,8 @@ template Linear_Expression_Impl::const_iterator -::const_iterator(const Row& row1, dimension_type i) - : row(&row1), itr(row1.lower_bound(i)) { +::const_iterator(const Row& r, dimension_type i) + : row(&r), itr(r.lower_bound(i)) { skip_zeroes_forward(); } @@ -1270,8 +1343,9 @@ s << "size " << (space_dimension() + 1) << " "; for (dimension_type i = 0; i < row.size(); ++i) { s << row.get(i); - if (i != row.size() - 1) + if (i != row.size() - 1) { s << ' '; + } } } @@ -1280,14 +1354,17 @@ Linear_Expression_Impl::ascii_load(std::istream& s) { std::string str; - if (!(s >> str)) + if (!(s >> str)) { return false; - if (str != "size") + } + if (str != "size") { return false; + } dimension_type new_size; - if (!(s >> new_size)) + if (!(s >> new_size)) { return false; + } row.resize(0); row.resize(new_size); @@ -1295,10 +1372,12 @@ PPL_DIRTY_TEMP_COEFFICIENT(c); for (dimension_type j = 0; j < new_size; ++j) { - if (!(s >> c)) + if (!(s >> c)) { return false; - if (c != 0) + } + if (c != 0) { row.insert(j, c); + } } PPL_ASSERT(OK()); diff -Nru ppl-1.1/src/Linear_Expression_Impl_types.hh ppl-1.2/src/Linear_Expression_Impl_types.hh --- ppl-1.1/src/Linear_Expression_Impl_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_Impl_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Linear_Expression_inlines.hh ppl-1.2/src/Linear_Expression_inlines.hh --- ppl-1.1/src/Linear_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -149,11 +149,12 @@ const dimension_type v_space_dim = v.space_dimension(); const dimension_type w_space_dim = w.space_dimension(); const dimension_type space_dim = std::max(v_space_dim, w_space_dim); - if (space_dim > Linear_Expression::max_space_dimension()) + if (space_dim > Linear_Expression::max_space_dimension()) { throw std::length_error("Linear_Expression " "PPL::operator+(v, w):\n" "v or w exceed the maximum allowed " "space dimension."); + } if (v_space_dim >= w_space_dim) { Linear_Expression e(v); e -= w; @@ -254,11 +255,12 @@ const dimension_type v_space_dim = v.space_dimension(); const dimension_type w_space_dim = w.space_dimension(); const dimension_type space_dim = std::max(v_space_dim, w_space_dim); - if (space_dim > Linear_Expression::max_space_dimension()) + if (space_dim > Linear_Expression::max_space_dimension()) { throw std::length_error("Linear_Expression " "PPL::operator+(v, w):\n" "v or w exceed the maximum allowed " "space dimension."); + } if (v_space_dim >= w_space_dim) { Linear_Expression e(v); e += w; @@ -549,14 +551,14 @@ inline void Linear_Expression -::get_row(Dense_Row& row) const { - return impl->get_row(row); +::get_row(Dense_Row& r) const { + return impl->get_row(r); } inline void Linear_Expression -::get_row(Sparse_Row& row) const { - return impl->get_row(row); +::get_row(Sparse_Row& r) const { + return impl->get_row(r); } inline void @@ -624,27 +626,27 @@ inline Linear_Expression::const_iterator -::const_iterator(const const_iterator& x) - : itr(x.itr->clone()) { +::const_iterator(const const_iterator& i) + : itr(i.itr->clone()) { } inline Linear_Expression::const_iterator ::~const_iterator() { - // Note that this does nothing if itr==NULL. + // Note that this does nothing if itr == NULL. delete itr; } inline void -Linear_Expression::const_iterator::m_swap(const_iterator& x) { +Linear_Expression::const_iterator::m_swap(const_iterator& i) { using std::swap; - swap(itr, x.itr); + swap(itr, i.itr); } inline Linear_Expression::const_iterator& Linear_Expression::const_iterator -::operator=(const const_iterator& itr) { - const_iterator tmp = itr; +::operator=(const const_iterator& i) { + const_iterator tmp = i; using std::swap; swap(*this, tmp); return *this; @@ -682,23 +684,23 @@ inline bool Linear_Expression::const_iterator -::operator==(const const_iterator& x) const { +::operator==(const const_iterator& i) const { PPL_ASSERT(itr != NULL); - PPL_ASSERT(x.itr != NULL); - return *itr == *(x.itr); + PPL_ASSERT(i.itr != NULL); + return *itr == *(i.itr); } inline bool Linear_Expression::const_iterator -::operator!=(const const_iterator& x) const { - return !(*this == x); +::operator!=(const const_iterator& i) const { + return !(*this == i); } inline Linear_Expression::const_iterator -::const_iterator(Linear_Expression_Interface::const_iterator_interface* itr) - : itr(itr) { - PPL_ASSERT(itr != NULL); +::const_iterator(Linear_Expression_Interface::const_iterator_interface* i) + : itr(i) { + PPL_ASSERT(i != NULL); } inline Linear_Expression::const_iterator @@ -721,74 +723,94 @@ template inline -Linear_Expression::Linear_Expression(const LE_Adapter& e, - typename Enable_If::value, void*>::type) +Linear_Expression +::Linear_Expression(const LE_Adapter& e, + typename Enable_If::value, + void*>::type) : impl(NULL) { Linear_Expression tmp(e.representation()); tmp.set_space_dimension(e.space_dimension()); tmp.set_inhomogeneous_term(e.inhomogeneous_term()); for (typename LE_Adapter::const_iterator i = e.begin(), - i_end = e.end(); i != i_end; ++i) + i_end = e.end(); i != i_end; ++i) { add_mul_assign(tmp, *i, i.variable()); + } using std::swap; swap(impl, tmp.impl); } template inline -Linear_Expression::Linear_Expression(const LE_Adapter& e, - Representation r, - typename Enable_If::value, void*>::type) +Linear_Expression +::Linear_Expression(const LE_Adapter& e, + Representation r, + typename Enable_If::value, + void*>::type) : impl(NULL) { Linear_Expression tmp(r); tmp.set_space_dimension(e.space_dimension()); tmp.set_inhomogeneous_term(e.inhomogeneous_term()); for (typename LE_Adapter::const_iterator i = e.begin(), - i_end = e.end(); i != i_end; ++i) + i_end = e.end(); i != i_end; ++i) { add_mul_assign(tmp, *i, i.variable()); + } using std::swap; swap(impl, tmp.impl); } template inline -Linear_Expression::Linear_Expression(const LE_Adapter& e, - dimension_type space_dim, - typename Enable_If::value, void*>::type) +Linear_Expression +::Linear_Expression(const LE_Adapter& e, + dimension_type space_dim, + typename Enable_If::value, + void*>::type) : impl(NULL) { Linear_Expression tmp(e.representation()); tmp.set_space_dimension(space_dim); tmp.set_inhomogeneous_term(e.inhomogeneous_term()); typedef typename LE_Adapter::const_iterator itr_t; itr_t i_end; - if (space_dim <= e.space_dimension()) + if (space_dim <= e.space_dimension()) { i_end = e.lower_bound(Variable(space_dim)); - else + } + else { i_end = e.end(); - for (itr_t i = e.begin(); i != i_end; ++i) + } + for (itr_t i = e.begin(); i != i_end; ++i) { add_mul_assign(tmp, *i, i.variable()); + } using std::swap; swap(impl, tmp.impl); } template inline -Linear_Expression::Linear_Expression(const LE_Adapter& e, - dimension_type space_dim, - Representation r, - typename Enable_If::value, void*>::type) +Linear_Expression +::Linear_Expression(const LE_Adapter& e, + dimension_type space_dim, + Representation r, + typename Enable_If::value, + void*>::type) : impl(NULL) { Linear_Expression tmp(r); tmp.set_space_dimension(space_dim); tmp.set_inhomogeneous_term(e.inhomogeneous_term()); typedef typename LE_Adapter::const_iterator itr_t; itr_t i_end; - if (space_dim <= e.space_dimension()) + if (space_dim <= e.space_dimension()) { i_end = e.lower_bound(Variable(space_dim)); - else + } + else { i_end = e.end(); - for (itr_t i = e.begin(); i != i_end; ++i) + } + for (itr_t i = e.begin(); i != i_end; ++i) { add_mul_assign(tmp, *i, i.variable()); + } using std::swap; swap(impl, tmp.impl); } diff -Nru ppl-1.1/src/Linear_Expression_Interface.cc ppl-1.2/src/Linear_Expression_Interface.cc --- ppl-1.1/src/Linear_Expression_Interface.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_Interface.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Interface class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Linear_Expression_Interface_defs.hh ppl-1.2/src/Linear_Expression_Interface_defs.hh --- ppl-1.1/src/Linear_Expression_Interface_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_Interface_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Expression_Interface class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -32,6 +32,7 @@ #include "Sparse_Row_types.hh" #include #include +#include #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS //! A linear expression. @@ -65,7 +66,7 @@ public: typedef std::bidirectional_iterator_tag iterator_category; typedef const Coefficient value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef Coefficient_traits::const_reference reference; @@ -473,17 +474,17 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const = 0; - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Sets `row' to a copy of the row that implements *this. - virtual void get_row(Dense_Row& row) const = 0; - - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Sets `row' to a copy of the row that implements *this. - virtual void get_row(Sparse_Row& row) const = 0; + // NOTE: This method is public, but it is not exposed in + // Linear_Expression, so that it can be used internally in the PPL, + // by friends of Linear_Expression. + //! Sets \p r to a copy of the row that implements \p *this. + virtual void get_row(Dense_Row& r) const = 0; + + // NOTE: This method is public, but it is not exposed in + // Linear_Expression, so that it can be used internally in the PPL, + // by friends of Linear_Expression. + //! Sets \p r to a copy of the row that implements \p *this. + virtual void get_row(Sparse_Row& r) const = 0; }; #endif // !defined(PPL_Linear_Expression_Interface_defs_hh) diff -Nru ppl-1.1/src/Linear_Expression_Interface_types.hh ppl-1.2/src/Linear_Expression_Interface_types.hh --- ppl-1.1/src/Linear_Expression_Interface_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_Interface_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Linear_Expression_types.hh ppl-1.2/src/Linear_Expression_types.hh --- ppl-1.1/src/Linear_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Linear_Form.cc ppl-1.2/src/Linear_Form.cc --- ppl-1.1/src/Linear_Form.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Form.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Form class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Linear_Form_defs.hh ppl-1.2/src/Linear_Form_defs.hh --- ppl-1.1/src/Linear_Form_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Form_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Form class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Linear_Form_inlines.hh ppl-1.2/src/Linear_Form_inlines.hh --- ppl-1.1/src/Linear_Form_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Form_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Form class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -91,8 +91,9 @@ template inline const C& Linear_Form::coefficient(Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { return zero; + } return vec[v.id()+1]; } @@ -212,13 +213,15 @@ Linear_Form::ascii_load(std::istream& s) { using namespace IO_Operators; dimension_type new_dim; - if (!(s >> new_dim)) + if (!(s >> new_dim)) { return false; + } vec.resize(new_dim + 1, zero); for (dimension_type i = 0; i <= new_dim; ++i) { - if (!(s >> vec[i])) + if (!(s >> vec[i])) { return false; + } } PPL_ASSERT(OK()); @@ -229,12 +232,13 @@ template inline bool Linear_Form::overflows() const { - if (!inhomogeneous_term().is_bounded()) + if (!inhomogeneous_term().is_bounded()) { return true; - + } for (dimension_type i = space_dimension(); i-- > 0; ) { - if (!coefficient(Variable(i)).is_bounded()) + if (!coefficient(Variable(i)).is_bounded()) { return true; + } } return false; diff -Nru ppl-1.1/src/Linear_Form_templates.hh ppl-1.2/src/Linear_Form_templates.hh --- ppl-1.1/src/Linear_Form_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Form_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_Form class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -37,11 +37,12 @@ Linear_Form::Linear_Form(const Variable v) : vec() { const dimension_type space_dim = v.space_dimension(); - if (space_dim > max_space_dimension()) + if (space_dim > max_space_dimension()) { throw std::length_error("Linear_Form::" "Linear_Form(v):\n" "v exceeds the maximum allowed " "space dimension."); + } vec.reserve(compute_capacity(space_dim+1, vec_type().max_size())); vec.resize(space_dim+1, zero); vec[v.space_dimension()] = C(typename C::boundary_type(1)); @@ -53,11 +54,12 @@ const dimension_type v_space_dim = v.space_dimension(); const dimension_type w_space_dim = w.space_dimension(); const dimension_type space_dim = std::max(v_space_dim, w_space_dim); - if (space_dim > max_space_dimension()) + if (space_dim > max_space_dimension()) { throw std::length_error("Linear_Form::" "Linear_Form(v, w):\n" "v or w exceed the maximum allowed " "space dimension."); + } vec.reserve(compute_capacity(space_dim+1, vec_type().max_size())); vec.resize(space_dim+1, zero); if (v_space_dim != w_space_dim) { @@ -70,11 +72,12 @@ Linear_Form::Linear_Form(const Linear_Expression& e) : vec() { const dimension_type space_dim = e.space_dimension(); - if (space_dim > max_space_dimension()) + if (space_dim > max_space_dimension()) { throw std::length_error("Linear_Form::" "Linear_Form(e):\n" "e exceeds the maximum allowed " "space dimension."); + } vec.reserve(compute_capacity(space_dim+1, vec_type().max_size())); vec.resize(space_dim+1); for (dimension_type i = space_dim; i-- > 0; ) @@ -121,14 +124,16 @@ Linear_Form operator+(const Variable v, const Linear_Form& f) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Form::max_space_dimension()) + if (v_space_dim > Linear_Form::max_space_dimension()) { throw std::length_error("Linear_Form " "operator+(v, f):\n" "v exceeds the maximum allowed " "space dimension."); + } Linear_Form r(f); - if (v_space_dim > f.space_dimension()) + if (v_space_dim > f.space_dimension()) { r.extend(v_space_dim+1); + } r[v_space_dim] += C(typename C::boundary_type(1)); return r; } @@ -147,8 +152,9 @@ Linear_Form operator-(const Linear_Form& f) { Linear_Form r(f); - for (dimension_type i = f.size(); i-- > 0; ) + for (dimension_type i = f.size(); i-- > 0; ) { r[i].neg_assign(r[i]); + } return r; } @@ -193,16 +199,19 @@ Linear_Form operator-(const Variable v, const Linear_Form& f) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Form::max_space_dimension()) + if (v_space_dim > Linear_Form::max_space_dimension()) { throw std::length_error("Linear_Form " "operator-(v, e):\n" "v exceeds the maximum allowed " "space dimension."); + } Linear_Form r(f); - if (v_space_dim > f.space_dimension()) + if (v_space_dim > f.space_dimension()) { r.extend(v_space_dim+1); - for (dimension_type i = f.size(); i-- > 0; ) + } + for (dimension_type i = f.size(); i-- > 0; ) { r[i].neg_assign(r[i]); + } r[v_space_dim] += C(typename C::boundary_type(1)); return r; } @@ -212,14 +221,16 @@ Linear_Form operator-(const Linear_Form& f, const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Form::max_space_dimension()) + if (v_space_dim > Linear_Form::max_space_dimension()) { throw std::length_error("Linear_Form " "operator-(e, v):\n" "v exceeds the maximum allowed " "space dimension."); + } Linear_Form r(f); - if (v_space_dim > f.space_dimension()) + if (v_space_dim > f.space_dimension()) { r.extend(v_space_dim+1); + } r[v_space_dim] -= C(typename C::boundary_type(1)); return r; } @@ -229,8 +240,9 @@ Linear_Form operator-(const C& n, const Linear_Form& f) { Linear_Form r(f); - for (dimension_type i = f.size(); i-- > 0; ) + for (dimension_type i = f.size(); i-- > 0; ) { r[i].neg_assign(r[i]); + } r[0] += n; return r; } @@ -240,8 +252,9 @@ Linear_Form operator*(const C& n, const Linear_Form& f) { Linear_Form r(f); - for (dimension_type i = f.size(); i-- > 0; ) + for (dimension_type i = f.size(); i-- > 0; ) { r[i] *= n; + } return r; } @@ -251,10 +264,12 @@ operator+=(Linear_Form& f1, const Linear_Form& f2) { dimension_type f1_size = f1.size(); dimension_type f2_size = f2.size(); - if (f1_size < f2_size) + if (f1_size < f2_size) { f1.extend(f2_size); - for (dimension_type i = f2_size; i-- > 0; ) + } + for (dimension_type i = f2_size; i-- > 0; ) { f1[i] += f2[i]; + } return f1; } @@ -263,12 +278,14 @@ Linear_Form& operator+=(Linear_Form& f, const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Form::max_space_dimension()) + if (v_space_dim > Linear_Form::max_space_dimension()) { throw std::length_error("Linear_Form& " "operator+=(e, v):\n" "v exceeds the maximum allowed space dimension."); - if (v_space_dim > f.space_dimension()) + } + if (v_space_dim > f.space_dimension()) { f.extend(v_space_dim+1); + } f[v_space_dim] += C(typename C::boundary_type(1)); return f; } @@ -279,10 +296,12 @@ operator-=(Linear_Form& f1, const Linear_Form& f2) { dimension_type f1_size = f1.size(); dimension_type f2_size = f2.size(); - if (f1_size < f2_size) + if (f1_size < f2_size) { f1.extend(f2_size); - for (dimension_type i = f2_size; i-- > 0; ) + } + for (dimension_type i = f2_size; i-- > 0; ) { f1[i] -= f2[i]; + } return f1; } @@ -291,12 +310,14 @@ Linear_Form& operator-=(Linear_Form& f, const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Form::max_space_dimension()) + if (v_space_dim > Linear_Form::max_space_dimension()) { throw std::length_error("Linear_Form& " "operator-=(e, v):\n" "v exceeds the maximum allowed space dimension."); - if (v_space_dim > f.space_dimension()) + } + if (v_space_dim > f.space_dimension()) { f.extend(v_space_dim+1); + } f[v_space_dim] -= C(typename C::boundary_type(1)); return f; } @@ -306,8 +327,9 @@ Linear_Form& operator*=(Linear_Form& f, const C& n) { dimension_type f_size = f.size(); - for (dimension_type i = f_size; i-- > 0; ) + for (dimension_type i = f_size; i-- > 0; ) { f[i] *= n; + } return f; } @@ -316,8 +338,9 @@ Linear_Form& operator/=(Linear_Form& f, const C& n) { dimension_type f_size = f.size(); - for (dimension_type i = f_size; i-- > 0; ) + for (dimension_type i = f_size; i-- > 0; ) { f[i] /= n; + } return f; } @@ -328,23 +351,28 @@ const dimension_type x_size = x.size(); const dimension_type y_size = y.size(); if (x_size >= y_size) { - for (dimension_type i = y_size; i-- > 0; ) - if (x[i] != y[i]) + for (dimension_type i = y_size; i-- > 0; ) { + if (x[i] != y[i]) { return false; - - for (dimension_type i = x_size; --i >= y_size; ) - if (x[i] != x.zero) + } + } + for (dimension_type i = x_size; --i >= y_size; ) { + if (x[i] != x.zero) { return false; - + } + } } else { - for (dimension_type i = x_size; i-- > 0; ) - if (x[i] != y[i]) + for (dimension_type i = x_size; i-- > 0; ) { + if (x[i] != y[i]) { return false; - - for (dimension_type i = y_size; --i >= x_size; ) - if (y[i] != x.zero) + } + } + for (dimension_type i = y_size; --i >= x_size; ) { + if (y[i] != x.zero) { return false; + } + } } @@ -354,8 +382,9 @@ template void Linear_Form::negate() { - for (dimension_type i = vec.size(); i-- > 0; ) + for (dimension_type i = vec.size(); i-- > 0; ) { vec[i].neg_assign(vec[i]); + } return; } @@ -363,8 +392,9 @@ inline memory_size_type Linear_Form::external_memory_in_bytes() const { memory_size_type n = 0; - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { n += vec[i].external_memory_in_bytes(); + } n += vec.capacity()*sizeof(C); return n; } @@ -372,9 +402,11 @@ template bool Linear_Form::OK() const { - for (dimension_type i = size(); i-- > 0; ) - if (!vec[i].OK()) + for (dimension_type i = size(); i-- > 0; ) { + if (!vec[i].OK()) { return false; + } + } return true; } @@ -464,8 +496,9 @@ for (dimension_type i = 0; i < dimension; ++i) { C current_addend = coefficient(Variable(i)); C curr_int; - if (!oracle.get_interval(i, curr_int)) + if (!oracle.get_interval(i, curr_int)) { return false; + } current_addend *= curr_int; result += current_addend; } @@ -483,19 +516,23 @@ const C& fv = f[v+1]; if (fv != typename C::boundary_type(0)) { if (first) { - if (fv == typename C::boundary_type(-1)) + if (fv == typename C::boundary_type(-1)) { s << "-"; - else if (fv != typename C::boundary_type(1)) + } + else if (fv != typename C::boundary_type(1)) { s << fv << "*"; + } first = false; } else { - if (fv == typename C::boundary_type(-1)) + if (fv == typename C::boundary_type(-1)) { s << " - "; + } else { s << " + "; - if (fv != typename C::boundary_type(1)) + if (fv != typename C::boundary_type(1)) { s << fv << "*"; + } } } s << Variable(v); @@ -504,16 +541,19 @@ // Inhomogeneous term. const C& it = f[0]; if (it != 0) { - if (!first) + if (!first) { s << " + "; - else + } + else { first = false; + } s << it; } - if (first) + if (first) { // The null linear form. s << Linear_Form::zero; + } return s; } diff -Nru ppl-1.1/src/Linear_Form_types.hh ppl-1.2/src/Linear_Form_types.hh --- ppl-1.1/src/Linear_Form_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_Form_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/linearize.hh ppl-1.2/src/linearize.hh --- ppl-1.1/src/linearize.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/linearize.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linearization function implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -109,17 +109,16 @@ static bool add_linearize(const Binary_Operator& bop_expr, const FP_Oracle& oracle, - const std::map >& lf_store, + const std::map >& + lf_store, Linear_Form& result) { PPL_ASSERT(bop_expr.binary_operator() == Binary_Operator::ADD); - typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; - if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) + if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) { return false; + } Floating_Point_Format analyzed_format = bop_expr.type().floating_point_format(); @@ -128,8 +127,9 @@ result += rel_error; FP_Linear_Form linearized_second_operand; if (!linearize(*(bop_expr.right_hand_side()), oracle, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } result += linearized_second_operand; linearized_second_operand.relative_error(analyzed_format, rel_error); @@ -227,13 +227,11 @@ Linear_Form& result) { PPL_ASSERT(bop_expr.binary_operator() == Binary_Operator::SUB); - typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; - if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) + if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) { return false; + } Floating_Point_Format analyzed_format = bop_expr.type().floating_point_format(); @@ -242,8 +240,9 @@ result += rel_error; FP_Linear_Form linearized_second_operand; if (!linearize(*(bop_expr.right_hand_side()), oracle, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } result -= linearized_second_operand; linearized_second_operand.relative_error(analyzed_format, rel_error); @@ -372,8 +371,6 @@ typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; /* FIXME: We currently adopt the "Interval-Size Local" strategy in order to @@ -391,19 +388,24 @@ bool intervalize_first; FP_Linear_Form linearized_first_operand; if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, - linearized_first_operand)) + linearized_first_operand)) { return false; + } FP_Interval_Type intervalized_first_operand; - if (!linearized_first_operand.intervalize(oracle, intervalized_first_operand)) + if (!linearized_first_operand.intervalize(oracle, + intervalized_first_operand)) { return false; + } FP_Linear_Form linearized_second_operand; if (!linearize(*(bop_expr.right_hand_side()), oracle, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } FP_Interval_Type intervalized_second_operand; if (!linearized_second_operand.intervalize(oracle, - intervalized_second_operand)) + intervalized_second_operand)) { return false; + } // FIXME: we are not sure that what we do here is policy-proof. if (intervalized_first_operand.is_bounded()) { @@ -414,19 +416,24 @@ analyzer_format second_interval_size = intervalized_second_operand.upper() - intervalized_second_operand.lower(); - if (first_interval_size <= second_interval_size) + if (first_interval_size <= second_interval_size) { intervalize_first = true; - else + } + else { intervalize_first = false; + } } - else + else { intervalize_first = true; + } } else { - if (intervalized_second_operand.is_bounded()) + if (intervalized_second_operand.is_bounded()) { intervalize_first = false; - else + } + else { return false; + } } // Here we do the actual computation. @@ -556,29 +563,28 @@ Linear_Form& result) { PPL_ASSERT(bop_expr.binary_operator() == Binary_Operator::DIV); - typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; FP_Linear_Form linearized_second_operand; if (!linearize(*(bop_expr.right_hand_side()), oracle, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } FP_Interval_Type intervalized_second_operand; if (!linearized_second_operand.intervalize(oracle, - intervalized_second_operand)) + intervalized_second_operand)) { return false; - + } // Check if we may divide by zero. - if ((intervalized_second_operand.lower_is_boundary_infinity() || - intervalized_second_operand.lower() <= 0) && - (intervalized_second_operand.upper_is_boundary_infinity() || - intervalized_second_operand.upper() >= 0)) + if ((intervalized_second_operand.lower_is_boundary_infinity() + || intervalized_second_operand.lower() <= 0) && + (intervalized_second_operand.upper_is_boundary_infinity() + || intervalized_second_operand.upper() >= 0)) { return false; - - if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) + } + if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) { return false; + } Floating_Point_Format analyzed_format = bop_expr.type().floating_point_format(); @@ -632,19 +638,18 @@ Linear_Form& result) { typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; Floating_Point_Format analyzed_format = cast_expr.type().floating_point_format(); const Concrete_Expression* cast_arg = cast_expr.argument(); if (cast_arg->type().is_floating_point()) { - if (!linearize(*cast_arg, oracle, lf_store, result)) + if (!linearize(*cast_arg, oracle, lf_store, result)) { return false; + } if (!is_less_precise_than(analyzed_format, - cast_arg->type().floating_point_format()) || - result == FP_Linear_Form(FP_Interval_Type(0)) || - result == FP_Linear_Form(FP_Interval_Type(1))) + cast_arg->type().floating_point_format()) + || result == FP_Linear_Form(FP_Interval_Type(0)) + || result == FP_Linear_Form(FP_Interval_Type(1))) { /* FIXME: find a general way to check if the casted constant is exactly representable in the less precise format. @@ -654,15 +659,16 @@ a definitely safe value: do not add errors. */ return true; + } } else { FP_Interval_Type expr_value; if (!oracle.get_integer_expr_value(*cast_arg, expr_value)) return false; result = FP_Linear_Form(expr_value); - if (is_less_precise_than(Float::Binary::floating_point_format, analyzed_format) || - result == FP_Linear_Form(FP_Interval_Type(0)) || - result == FP_Linear_Form(FP_Interval_Type(1))) + if (is_less_precise_than(Float::Binary::floating_point_format, analyzed_format) + || result == FP_Linear_Form(FP_Interval_Type(0)) + || result == FP_Linear_Form(FP_Interval_Type(1))) { /* FIXME: find a general way to check if the casted constant is exactly representable in the less precise format. @@ -672,6 +678,7 @@ a definitely safe value: do not add errors. */ return true; + } } FP_Linear_Form rel_error; @@ -725,8 +732,8 @@ Linear_Form& result) { typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; + typedef std::map + FP_Linear_Form_Abstract_Store; PPL_ASSERT(expr.type().is_floating_point()); // Check that analyzer_format is a floating point type. @@ -743,8 +750,9 @@ const Floating_Point_Constant* fpc_expr = expr.template as(); FP_Interval_Type constant_value; - if (!oracle.get_fp_constant_value(*fpc_expr, constant_value)) + if (!oracle.get_fp_constant_value(*fpc_expr, constant_value)) { return false; + } result = FP_Linear_Form(constant_value); return true; } @@ -756,8 +764,9 @@ case Unary_Operator::UPLUS: return linearize(*(uop_expr->argument()), oracle, lf_store, result); case Unary_Operator::UMINUS: - if (!linearize(*(uop_expr->argument()), oracle, lf_store, result)) + if (!linearize(*(uop_expr->argument()), oracle, lf_store, result)) { return false; + } result.negate(); return true; @@ -803,12 +812,13 @@ expr.template as(); std::set associated_dimensions; if (!oracle.get_associated_dimensions(*ref_expr, associated_dimensions) - || associated_dimensions.empty()) + || associated_dimensions.empty()) { /* We were unable to find any associated space dimension: linearization fails. */ return false; + } if (associated_dimensions.size() == 1) { /* If a linear form associated to the only referenced @@ -818,7 +828,7 @@ PPL_ASSERT(variable_index != not_a_dimension()); typename FP_Linear_Form_Abstract_Store::const_iterator - variable_value = lf_store.find(variable_index); + variable_value = lf_store.find(variable_index); if (variable_value == lf_store.end()) { result = FP_Linear_Form(Variable(variable_index)); return true; @@ -835,15 +845,17 @@ of all intervals associated to each space dimension. */ PPL_ASSERT(associated_dimensions.size() > 1); - std::set::const_iterator i = associated_dimensions.begin(); - std::set::const_iterator i_end = - associated_dimensions.end(); + std::set::const_iterator i + = associated_dimensions.begin(); + std::set::const_iterator i_end + = associated_dimensions.end(); FP_Interval_Type lub(EMPTY); for (; i != i_end; ++i) { FP_Interval_Type curr_int; PPL_ASSERT(*i != not_a_dimension()); - if (!oracle.get_interval(*i, curr_int)) + if (!oracle.get_interval(*i, curr_int)) { return false; + } lub.join_assign(curr_int); } diff -Nru ppl-1.1/src/Linear_System_defs.hh ppl-1.2/src/Linear_System_defs.hh --- ppl-1.1/src/Linear_System_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_System_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_System class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Linear_System_inlines.hh ppl-1.2/src/Linear_System_inlines.hh --- ppl-1.1/src/Linear_System_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_System_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_System class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -227,8 +227,9 @@ PPL_ASSERT(topology() == NOT_NECESSARILY_CLOSED); row_topology = NECESSARILY_CLOSED; ++space_dimension_; - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].mark_as_necessarily_closed(); + } } template @@ -238,17 +239,20 @@ PPL_ASSERT(space_dimension() > 0); row_topology = NOT_NECESSARILY_CLOSED; --space_dimension_; - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].mark_as_not_necessarily_closed(); + } } template inline void Linear_System::set_topology(Topology t) { - if (topology() == t) + if (topology() == t) { return; - for (dimension_type i = num_rows(); i-- > 0; ) + } + for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].set_topology(t); + } row_topology = t; PPL_ASSERT(OK()); } @@ -329,8 +333,9 @@ inline void Linear_System::set_representation(Representation r) { representation_ = r; - for (dimension_type i = 0; i < rows.size(); ++i) + for (dimension_type i = 0; i < rows.size(); ++i) { rows[i].set_representation(r); + } PPL_ASSERT(OK()); } @@ -349,8 +354,9 @@ template inline void Linear_System::set_space_dimension_no_ok(dimension_type space_dim) { - for (dimension_type i = rows.size(); i-- > 0; ) + for (dimension_type i = rows.size(); i-- > 0; ) { rows[i].set_space_dimension_no_ok(space_dim); + } space_dimension_ = space_dim; } @@ -369,17 +375,20 @@ const bool was_pending = (i >= index_first_pending); if (sorted && keep_sorted && !was_pending) { - for (dimension_type j = i + 1; j < rows.size(); ++j) + for (dimension_type j = i + 1; j < rows.size(); ++j) { swap(rows[j], rows[j-1]); + } rows.pop_back(); } else { - if (!was_pending) + if (!was_pending) { sorted = false; + } const bool last_row_is_pending = (num_rows() - 1 >= index_first_pending); - if (was_pending == last_row_is_pending) + if (was_pending == last_row_is_pending) { // Either both rows are pending or both rows are not pending. swap(rows[i], rows.back()); + } else { // Pending rows are stored after the non-pending ones. PPL_ASSERT(!was_pending); @@ -394,9 +403,10 @@ } rows.pop_back(); } - if (!was_pending) + if (!was_pending) { // A non-pending row has been removed. --index_first_pending; + } } template @@ -416,8 +426,9 @@ PPL_ASSERT(last <= num_rows()); const dimension_type n = last - first; - if (n == 0) + if (n == 0) { return; + } // All the rows that have to be removed must have the same (pending or // non-pending) status. @@ -428,8 +439,9 @@ // Move the rows in [first,last) at the end of the system. if (sorted && keep_sorted && !were_pending) { // Preserve the row ordering. - for (dimension_type i = last; i < rows.size(); ++i) + for (dimension_type i = last; i < rows.size(); ++i) { swap(rows[i], rows[i - n]); + } rows.resize(rows.size() - n); @@ -526,16 +538,19 @@ offset += k; } - if (first == last) + if (first == last) { // Nothing to do. return; + } - for (dimension_type i = first; i < last; ++i) + for (dimension_type i = first; i < last; ++i) { swap(rows[i], rows[i + offset]); + } - if (first < index_first_pending) + if (first < index_first_pending) { // The swaps involved not pending rows, so they may not be sorted anymore. set_sorted(false); + } PPL_ASSERT(OK()); } @@ -552,13 +567,15 @@ // Check that the last index (if any) is lower than num_rows(). // This guarantees that all indexes are in [0, num_rows()). - if (!indexes.empty()) + if (!indexes.empty()) { PPL_ASSERT(indexes.back() < num_rows()); + } } #endif - if (indexes.empty()) + if (indexes.empty()) { return; + } const dimension_type rows_size = rows.size(); typedef std::vector::const_iterator itr_t; @@ -630,8 +647,9 @@ Linear_System::remove_trailing_rows(const dimension_type n) { PPL_ASSERT(rows.size() >= n); rows.resize(rows.size() - n); - if (first_pending_row() > rows.size()) + if (first_pending_row() > rows.size()) { index_first_pending = rows.size(); + } PPL_ASSERT(OK()); } @@ -639,8 +657,9 @@ inline void Linear_System ::permute_space_dimensions(const std::vector& cycle) { - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].permute_space_dimensions(cycle); + } sorted = false; PPL_ASSERT(OK()); } @@ -651,8 +670,9 @@ ::swap_space_dimensions(Variable v1, Variable v2) { PPL_ASSERT(v1.space_dimension() <= space_dimension()); PPL_ASSERT(v2.space_dimension() <= space_dimension()); - for (dimension_type k = num_rows(); k-- > 0; ) + for (dimension_type k = num_rows(); k-- > 0; ) { rows[k].swap_space_dimensions(v1, v2); + } sorted = false; PPL_ASSERT(OK()); } diff -Nru ppl-1.1/src/Linear_System_templates.hh ppl-1.2/src/Linear_System_templates.hh --- ppl-1.1/src/Linear_System_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_System_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Linear_System class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,13 +28,12 @@ #include "Linear_Expression_defs.hh" #include "Scalar_Products_defs.hh" #include "Scalar_Products_inlines.hh" +#include "swapping_sort_templates.hh" #include #include #include #include -#include "swapping_sort_templates.hh" - namespace Parma_Polyhedra_Library { template @@ -43,9 +42,11 @@ PPL_ASSERT(num_pending_rows() == 0); const Linear_System& x = *this; dimension_type n = 0; - for (dimension_type i = num_rows(); i-- > 0; ) - if (x[i].is_line_or_equality()) + for (dimension_type i = num_rows(); i-- > 0; ) { + if (x[i].is_line_or_equality()) { ++n; + } + } return n; } @@ -77,9 +78,10 @@ tmp.resize(tmp.size() + 1); swap(tmp.back(), x.rows[xi++]); tmp.back().set_representation(representation()); - if (comp == 0) + if (comp == 0) { // A duplicate element. ++yi; + } } else { // (comp > 0) @@ -89,18 +91,20 @@ } } // Insert what is left. - if (xi < x_num_rows) + if (xi < x_num_rows) { while (xi < x_num_rows) { tmp.resize(tmp.size() + 1); swap(tmp.back(), x.rows[xi++]); tmp.back().set_representation(representation()); } - else + } + else { while (yi < y_num_rows) { tmp.resize(tmp.size() + 1); Row copy(y[yi++], space_dimension(), representation()); swap(tmp.back(), copy); } + } // We get the result matrix and let the old one be destroyed. swap(tmp, rows); @@ -127,8 +131,9 @@ << "\n" << "index_first_pending " << first_pending_row() << "\n"; - for (dimension_type i = 0; i < rows.size(); ++i) + for (dimension_type i = 0; i < rows.size(); ++i) { rows[i].ascii_dump(s); + } } PPL_OUTPUT_TEMPLATE_DEFINITIONS_ASCII_ONLY(Row, Linear_System) @@ -137,19 +142,23 @@ bool Linear_System::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "topology") + if (!(s >> str) || str != "topology") { return false; - if (!(s >> str)) + } + if (!(s >> str)) { return false; + } clear(); Topology t; - if (str == "NECESSARILY_CLOSED") + if (str == "NECESSARILY_CLOSED") { t = NECESSARILY_CLOSED; + } else { - if (str != "NOT_NECESSARILY_CLOSED") + if (str != "NOT_NECESSARILY_CLOSED") { return false; + } t = NOT_NECESSARILY_CLOSED; } @@ -157,31 +166,39 @@ dimension_type nrows; dimension_type space_dims; - if (!(s >> nrows)) + if (!(s >> nrows)) { return false; - if (!(s >> str) || str != "x") + } + if (!(s >> str) || str != "x") { return false; - if (!(s >> space_dims)) + } + if (!(s >> space_dims)) { return false; + } space_dimension_ = space_dims; - if (!Parma_Polyhedra_Library::ascii_load(s, representation_)) + if (!Parma_Polyhedra_Library::ascii_load(s, representation_)) { return false; + } - if (!(s >> str) || (str != "(sorted)" && str != "(not_sorted)")) + if (!(s >> str) || (str != "(sorted)" && str != "(not_sorted)")) { return false; + } const bool sortedness = (str == "(sorted)"); dimension_type index; - if (!(s >> str) || str != "index_first_pending") + if (!(s >> str) || str != "index_first_pending") { return false; - if (!(s >> index)) + } + if (!(s >> index)) { return false; + } Row row; for (dimension_type i = 0; i < nrows; ++i) { - if (!row.ascii_load(s)) + if (!row.ascii_load(s)) { return false; + } insert(row, Recycle_Input()); } index_first_pending = index; @@ -226,9 +243,10 @@ // If it is not the greatest one then the system is no longer sorted. sorted = (compare(rows[nrows-2], rows[nrows-1]) <= 0); } - else + else { // A system having only one row is sorted. sorted = true; + } } unset_pending_rows(); @@ -250,10 +268,12 @@ r.set_representation(representation()); - if (space_dimension() < r.space_dimension()) + if (space_dimension() < r.space_dimension()) { set_space_dimension_no_ok(r.space_dimension()); - else + } + else { r.set_space_dimension_no_ok(space_dimension()); + } rows.resize(rows.size() + 1); swap(rows.back(), r); @@ -289,8 +309,9 @@ // Steal the rows of `y'. // This loop must use an increasing index (instead of a decreasing one) to // preserve the row ordering. - for (dimension_type i = 0; i < y.num_rows(); ++i) + for (dimension_type i = 0; i < y.num_rows(); ++i) { x.insert_pending(y.rows[i], Recycle_Input()); + } y.clear(); @@ -310,18 +331,21 @@ PPL_ASSERT(num_pending_rows() == 0); // Adding no rows is a no-op. - if (y.has_no_rows()) + if (y.has_no_rows()) { return; + } // Check if sortedness is preserved. if (is_sorted()) { - if (!y.is_sorted() || y.num_pending_rows() > 0) + if (!y.is_sorted() || y.num_pending_rows() > 0) { sorted = false; + } else { // `y' is sorted and has no pending rows. const dimension_type n_rows = num_rows(); - if (n_rows > 0) + if (n_rows > 0) { sorted = (compare(rows[n_rows-1], y[0]) <= 0); + } } } @@ -345,8 +369,9 @@ // The removal of no dimensions from any system is a no-op. This // case also captures the only legal removal of dimensions from a // 0-dim system. - if (vars.empty()) + if (vars.empty()) { return; + } // NOTE: num_rows() is *not* constant, because it may be decreased by // remove_row_no_ok(). @@ -359,8 +384,9 @@ // the old one. remove_row_no_ok(i, false); } - else + else { ++i; + } } space_dimension_ -= vars.size(); @@ -374,8 +400,9 @@ // NOTE: v.id() may be equal to the space dimension of the system // (when no space dimension need to be shifted). PPL_ASSERT(v.id() <= space_dimension()); - for (dimension_type i = rows.size(); i-- > 0; ) + for (dimension_type i = rows.size(); i-- > 0; ) { rows[i].shift_space_dimensions(v, n); + } space_dimension_ += n; PPL_ASSERT(OK()); } @@ -402,8 +429,9 @@ const dimension_type old_num_pending = num_pending_rows(); const dimension_type num_elems = last_row - first_row; - if (num_elems < 2) + if (num_elems < 2) { return; + } // Build the function objects implementing indirect sort comparison, // indirect unique comparison and indirect swap operation. @@ -441,8 +469,9 @@ Linear_System::strong_normalize() { const dimension_type nrows = rows.size(); // We strongly normalize also the pending rows. - for (dimension_type i = nrows; i-- > 0; ) + for (dimension_type i = nrows; i-- > 0; ) { rows[i].strong_normalize(); + } sorted = (nrows <= 1); PPL_ASSERT(OK()); } @@ -452,8 +481,9 @@ Linear_System::sign_normalize() { const dimension_type nrows = rows.size(); // We sign-normalize also the pending rows. - for (dimension_type i = nrows; i-- > 0; ) + for (dimension_type i = nrows; i-- > 0; ) { rows[i].sign_normalize(); + } sorted = (nrows <= 1); PPL_ASSERT(OK()); } @@ -462,22 +492,27 @@ template bool operator==(const Linear_System& x, const Linear_System& y) { - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { return false; + } const dimension_type x_num_rows = x.num_rows(); const dimension_type y_num_rows = y.num_rows(); - if (x_num_rows != y_num_rows) + if (x_num_rows != y_num_rows) { return false; - if (x.first_pending_row() != y.first_pending_row()) + } + if (x.first_pending_row() != y.first_pending_row()) { return false; + } // TODO: Check if the following comment is up to date. // Notice that calling operator==(const Swapping_Vector&, // const Swapping_Vector&) // would be wrong here, as equality of the type fields would // not be checked. - for (dimension_type i = x_num_rows; i-- > 0; ) - if (x[i] != y[i]) + for (dimension_type i = x_num_rows; i-- > 0; ) { + if (x[i] != y[i]) { return false; + } + } return true; } @@ -510,8 +545,9 @@ if (num_pending_rows() > 0) { // In this case, we must put the duplicates after the pending rows. const dimension_type n_rows = num_rows() - 1; - for (dimension_type i = 0; i < num_duplicates; ++i) + for (dimension_type i = 0; i < num_duplicates; ++i) { swap(rows[new_first_pending_row + i], rows[n_rows - i]); + } } // Erasing the duplicated rows... @@ -535,8 +571,9 @@ PPL_ASSERT(num_pending_rows() == 0); PPL_ASSERT(n_lines_or_equalities == num_lines_or_equalities()); #ifndef NDEBUG - for (dimension_type i = n_lines_or_equalities; i-- > 0; ) + for (dimension_type i = n_lines_or_equalities; i-- > 0; ) { PPL_ASSERT((*this)[i].is_line_or_equality()); + } #endif dimension_type rank = 0; @@ -548,12 +585,13 @@ // TODO: Consider exploiting the row (possible) sparseness of rows in the // following loop, if needed. It would probably make it more cache-efficient // for dense rows, too. - for (dimension_type j = num_cols; j-- > 0; ) + for (dimension_type j = num_cols; j-- > 0; ) { for (dimension_type i = rank; i < n_lines_or_equalities; ++i) { // Search for the first row having a non-zero coefficient // (the pivot) in the j-th column. - if ((*this)[i].expr.get(j) == 0) + if ((*this)[i].expr.get(j) == 0) { continue; + } // Pivot found: if needed, swap rows so that this one becomes // the rank-th row in the linear system. if (i > rank) { @@ -575,8 +613,10 @@ // Consider another column index `j'. break; } - if (changed) + } + if (changed) { sorted = false; + } PPL_ASSERT(OK()); return rank; @@ -592,8 +632,9 @@ PPL_ASSERT(num_pending_rows() == 0); PPL_ASSERT(n_lines_or_equalities <= num_lines_or_equalities()); #ifndef NDEBUG - for (dimension_type i = n_lines_or_equalities; i-- > 0; ) + for (dimension_type i = n_lines_or_equalities; i-- > 0; ) { PPL_ASSERT((*this)[i].is_line_or_equality()); + } #endif const dimension_type nrows = num_rows(); @@ -602,8 +643,9 @@ // This deque of Booleans will be used to flag those rows that, // before exiting, need to be re-checked for sortedness. std::deque check_for_sortedness; - if (still_sorted) + if (still_sorted) { check_for_sortedness.insert(check_for_sortedness.end(), nrows, false); + } for (dimension_type k = n_lines_or_equalities; k-- > 0; ) { // For each line or equality, starting from the last one, @@ -624,8 +666,9 @@ if (still_sorted) { // Trying to keep sortedness: remember which rows // have to be re-checked for sortedness at the end. - if (i > 0) + if (i > 0) { check_for_sortedness[i-1] = true; + } check_for_sortedness[i] = true; } } @@ -637,8 +680,9 @@ // by a negative factor, the coefficient of the pivot must be // forced to be positive. const bool have_to_negate = (row_k.expr.get(Variable(j - 1)) < 0); - if (have_to_negate) + if (have_to_negate) { neg_assign(row_k.expr); + } // NOTE: Here row_k will *not* be ok if we have negated it. @@ -655,24 +699,28 @@ if (still_sorted) { // Trying to keep sortedness: remember which rows // have to be re-checked for sortedness at the end. - if (i > n_lines_or_equalities) + if (i > n_lines_or_equalities) { check_for_sortedness[i-1] = true; + } check_for_sortedness[i] = true; } } } - if (have_to_negate) + if (have_to_negate) { // Negate `row_k' to restore strong-normalization. neg_assign(row_k.expr); + } PPL_ASSERT(row_k.OK()); } // Trying to keep sortedness. - for (dimension_type i = 0; still_sorted && i+1 < nrows; ++i) - if (check_for_sortedness[i]) + for (dimension_type i = 0; still_sorted && i+1 < nrows; ++i) { + if (check_for_sortedness[i]) { // Have to check sortedness of `(*this)[i]' with respect to `(*this)[i+1]'. still_sorted = (compare((*this)[i], (*this)[i+1]) <= 0); + } + } // Set the sortedness flag. sorted = still_sorted; @@ -690,7 +738,7 @@ const dimension_type old_nrows = num_rows(); dimension_type nrows = old_nrows; dimension_type n_lines_or_equalities = 0; - for (dimension_type i = 0; i < nrows; ++i) + for (dimension_type i = 0; i < nrows; ++i) { if ((*this)[i].is_line_or_equality()) { if (n_lines_or_equalities < i) { swap(rows[i], rows[n_lines_or_equalities]); @@ -699,6 +747,7 @@ } ++n_lines_or_equalities; } + } // Apply Gaussian elimination to the subsystem of lines/equalities. const dimension_type rank = gauss(n_lines_or_equalities); // Eliminate any redundant line/equality that has been detected. @@ -708,11 +757,13 @@ const dimension_type num_swaps = std::min(n_lines_or_equalities - rank, n_rays_or_points_or_inequalities); - for (dimension_type i = num_swaps; i-- > 0; ) + for (dimension_type i = num_swaps; i-- > 0; ) { swap(rows[--nrows], rows[rank + i]); + } remove_trailing_rows(old_nrows - nrows); - if (n_rays_or_points_or_inequalities > num_swaps) + if (n_rays_or_points_or_inequalities > num_swaps) { set_sorted(false); + } unset_pending_rows(); n_lines_or_equalities = rank; } @@ -734,8 +785,9 @@ set_space_dimension(space_dimension() + n); rows.resize(rows.size() + n); // The old system is moved to the bottom. - for (dimension_type i = old_n_rows; i-- > 0; ) + for (dimension_type i = old_n_rows; i-- > 0; ) { swap(rows[i], rows[i + n]); + } for (dimension_type i = n, c = old_space_dim; i-- > 0; ) { // The top right-hand sub-system (i.e., the system made of new // rows and columns) is set to the specular image of the identity @@ -761,8 +813,9 @@ } // If the old system was empty, the last row added is either // a positivity constraint or a point. - if (was_sorted) + if (was_sorted) { sorted = (compare(rows[n-1], rows[n]) <= 0); + } // If the system is not necessarily closed, move the epsilon coefficients to // the last column. @@ -822,27 +875,32 @@ // By initial sortedness, we can increment index `k1'. ++k1; // Do not increment `k2'; instead, swap there the next pending row. - if (k2 < num_rows) + if (k2 < num_rows) { swap(rows[k2], rows[k2 + num_duplicates]); + } } - else if (cmp < 0) + else if (cmp < 0) { // By initial sortedness, we can increment `k1'. ++k1; + } else { // Here `cmp > 0'. // Increment `k2' and, if we already found any duplicate, // swap the next pending row in position `k2'. ++k2; - if (num_duplicates > 0 && k2 < num_rows) + if (num_duplicates > 0 && k2 < num_rows) { swap(rows[k2], rows[k2 + num_duplicates]); + } } } // If needed, swap any duplicates found past the pending rows // that has not been considered yet; then erase the duplicates. if (num_duplicates > 0) { - if (k2 < num_rows) - for (++k2; k2 < num_rows; ++k2) + if (k2 < num_rows) { + for (++k2; k2 < num_rows; ++k2) { swap(rows[k2], rows[k2 + num_duplicates]); + } + } rows.resize(num_rows); } sorted = true; @@ -852,9 +910,11 @@ template bool Linear_System::check_sorted() const { - for (dimension_type i = first_pending_row(); i-- > 1; ) - if (compare(rows[i], rows[i-1]) < 0) + for (dimension_type i = first_pending_row(); i-- > 1; ) { + if (compare(rows[i], rows[i-1]) < 0) { return false; + } + } return true; } @@ -883,7 +943,7 @@ } } - for (dimension_type i = rows.size(); i-- > 0; ) + for (dimension_type i = rows.size(); i-- > 0; ) { if (rows[i].topology() != topology()) { #ifndef NDEBUG cerr << "Linear_System has a row with the wrong topology!" @@ -892,6 +952,7 @@ return false; } + } // `index_first_pending' must be less than or equal to `num_rows()'. if (first_pending_row() > num_rows()) { #ifndef NDEBUG @@ -903,7 +964,7 @@ // Check for topology mismatches. const dimension_type n_rows = num_rows(); - for (dimension_type i = 0; i < n_rows; ++i) + for (dimension_type i = 0; i < n_rows; ++i) { if (topology() != rows[i].topology()) { #ifndef NDEBUG cerr << "Topology mismatch between the system " @@ -913,6 +974,7 @@ return false; } + } if (sorted && !check_sorted()) { #ifndef NDEBUG cerr << "The system declares itself to be sorted but it is not!" diff -Nru ppl-1.1/src/Linear_System_types.hh ppl-1.2/src/Linear_System_types.hh --- ppl-1.1/src/Linear_System_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Linear_System_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Makefile.am ppl-1.2/src/Makefile.am --- ppl-1.1/src/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -60,8 +60,9 @@ # 0.12.1 11:0:0 # 1.0 12:0:0 # 1.1 13:0:0 +# 1.2 14:0:0 -LIBPPL_LT_CURRENT = 13 +LIBPPL_LT_CURRENT = 14 LIBPPL_LT_REVISION = 0 LIBPPL_LT_AGE = 0 @@ -121,7 +122,7 @@ INCLUDE_FILES = \ namespaces.hh \ compiler.hh \ -assert.hh \ +assertions.hh \ meta_programming.hh \ Slow_Copy.hh \ Has_Assign_Or_Swap.hh \ @@ -477,12 +478,15 @@ Og_Status_idefs.hh libppl_la_SOURCES = \ -assert.cc \ +assertions.cc \ Box.cc \ checked.cc \ Checked_Number.cc \ Float.cc \ fpu-ia32.cc \ +BDS_Status.cc \ +Box_Status.cc \ +Og_Status.cc \ Concrete_Expression.cc \ Constraint.cc \ Constraint_System.cc \ @@ -492,6 +496,7 @@ Grid_Generator_System.cc \ Generator.cc \ Grid_Generator.cc \ +Handler.cc \ Init.cc \ Coefficient.cc \ Linear_Expression.cc \ @@ -532,6 +537,7 @@ Variables_Set.cc \ Grid_conversion.cc \ Grid_simplify.cc \ +set_GMP_memory_alloc_funcs.cc \ stdiobuf.cc \ c_streambuf.cc \ globals.cc \ @@ -594,9 +600,10 @@ $(top_builddir)/utils/text2cxxarray --name=BUGS_array --decl-only \ $(top_srcdir)/BUGS >>$@ @echo "#endif // !defined(PPL_BUGS_hh)" >>$@ -BUGS.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/BUGS +BUGS.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/BUGS BUGS.hh + @echo "#include \"BUGS.hh\"" >$@ $(top_builddir)/utils/text2cxxarray --name=BUGS_array \ - $(top_srcdir)/BUGS >$@ + $(top_srcdir)/BUGS >>$@ COPYING.hh: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/COPYING @echo "#ifndef PPL_COPYING_hh" >$@ @@ -604,19 +611,21 @@ $(top_builddir)/utils/text2cxxarray --name=COPYING_array --decl-only \ $(top_srcdir)/COPYING >>$@ @echo "#endif // !defined(PPL_COPYING_hh)" >>$@ - -COPYING.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/COPYING +COPYING.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/COPYING COPYING.hh + @echo "#include \"COPYING.hh\"" >$@ $(top_builddir)/utils/text2cxxarray --name=COPYING_array \ - $(top_srcdir)/COPYING >$@ + $(top_srcdir)/COPYING >>$@ + CREDITS.hh: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/CREDITS @echo "#ifndef PPL_CREDITS_hh" >$@ @echo "#define PPL_CREDITS_hh 1" >>$@ $(top_builddir)/utils/text2cxxarray --name=CREDITS_array --decl-only \ $(top_srcdir)/CREDITS >>$@ @echo "#endif // !defined(PPL_CREDITS_hh)" >>$@ -CREDITS.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/CREDITS +CREDITS.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/CREDITS CREDITS.hh + @echo "#include \"CREDITS.hh\"" >$@ $(top_builddir)/utils/text2cxxarray --name=CREDITS_array \ - $(top_srcdir)/CREDITS >$@ + $(top_srcdir)/CREDITS >>$@ else !HAVE_PERL diff -Nru ppl-1.1/src/Makefile.in ppl-1.2/src/Makefile.in --- ppl-1.1/src/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/src/Makefile.in 2016-02-11 12:31:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -76,6 +76,7 @@ # 0.12.1 11:0:0 # 1.0 12:0:0 # 1.1 13:0:0 +# 1.2 14:0:0 @@ -151,6 +152,7 @@ $(am__include_HEADERS_DIST) $(am__noinst_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -170,7 +172,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ @@ -212,12 +215,13 @@ "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libppl_la_DEPENDENCIES = -am__libppl_la_SOURCES_DIST = assert.cc Box.cc checked.cc \ - Checked_Number.cc Float.cc fpu-ia32.cc Concrete_Expression.cc \ +am__libppl_la_SOURCES_DIST = assertions.cc Box.cc checked.cc \ + Checked_Number.cc Float.cc fpu-ia32.cc BDS_Status.cc \ + Box_Status.cc Og_Status.cc Concrete_Expression.cc \ Constraint.cc Constraint_System.cc Congruence.cc \ Congruence_System.cc Generator_System.cc \ Grid_Generator_System.cc Generator.cc Grid_Generator.cc \ - Init.cc Coefficient.cc Linear_Expression.cc \ + Handler.cc Init.cc Coefficient.cc Linear_Expression.cc \ Linear_Expression_Impl.cc Linear_Expression_Interface.cc \ Linear_Form.cc Scalar_Products.cc MIP_Problem.cc PIP_Tree.cc \ PIP_Problem.cc Poly_Con_Relation.cc Poly_Gen_Relation.cc \ @@ -230,16 +234,17 @@ Pointset_Powerset.cc CO_Tree.cc Sparse_Row.cc Dense_Row.cc \ Bit_Matrix.cc Bit_Row.cc Ph_Status.cc Grid_Status.cc \ Variable.cc Variables_Set.cc Grid_conversion.cc \ - Grid_simplify.cc stdiobuf.cc c_streambuf.cc globals.cc \ - mp_std_bits.cc Weight_Profiler.cc version.cc namespaces.hh \ - compiler.hh assert.hh meta_programming.hh Slow_Copy.hh \ - Has_Assign_Or_Swap.hh assign_or_swap.hh mp_std_bits_defs.hh \ - mp_std_bits_inlines.hh Concrete_Expression_types.hh \ - Concrete_Expression_defs.hh Concrete_Expression_inlines.hh \ - Temp_defs.hh Temp_inlines.hh Temp_templates.hh \ - Coefficient_traits_template.hh Checked_Number_types.hh \ - termination_types.hh GMP_Integer_types.hh Coefficient_types.hh \ - stdiobuf_types.hh c_streambuf_types.hh globals_types.hh \ + Grid_simplify.cc set_GMP_memory_alloc_funcs.cc stdiobuf.cc \ + c_streambuf.cc globals.cc mp_std_bits.cc Weight_Profiler.cc \ + version.cc namespaces.hh compiler.hh assertions.hh \ + meta_programming.hh Slow_Copy.hh Has_Assign_Or_Swap.hh \ + assign_or_swap.hh mp_std_bits_defs.hh mp_std_bits_inlines.hh \ + Concrete_Expression_types.hh Concrete_Expression_defs.hh \ + Concrete_Expression_inlines.hh Temp_defs.hh Temp_inlines.hh \ + Temp_templates.hh Coefficient_traits_template.hh \ + Checked_Number_types.hh termination_types.hh \ + GMP_Integer_types.hh Coefficient_types.hh stdiobuf_types.hh \ + c_streambuf_types.hh globals_types.hh \ iterator_to_const_types.hh distances_types.hh \ Interval_Info_types.hh Interval_types.hh Box_types.hh \ Constraint_types.hh Generator_types.hh Grid_Generator_types.hh \ @@ -403,11 +408,13 @@ Time.cc Watchdog.cc Threshold_Watcher.cc am__objects_1 = am__objects_2 = $(am__objects_1) $(am__objects_1) -am_libppl_la_OBJECTS = assert.lo Box.lo checked.lo Checked_Number.lo \ - Float.lo fpu-ia32.lo Concrete_Expression.lo Constraint.lo \ - Constraint_System.lo Congruence.lo Congruence_System.lo \ - Generator_System.lo Grid_Generator_System.lo Generator.lo \ - Grid_Generator.lo Init.lo Coefficient.lo Linear_Expression.lo \ +am_libppl_la_OBJECTS = assertions.lo Box.lo checked.lo \ + Checked_Number.lo Float.lo fpu-ia32.lo BDS_Status.lo \ + Box_Status.lo Og_Status.lo Concrete_Expression.lo \ + Constraint.lo Constraint_System.lo Congruence.lo \ + Congruence_System.lo Generator_System.lo \ + Grid_Generator_System.lo Generator.lo Grid_Generator.lo \ + Handler.lo Init.lo Coefficient.lo Linear_Expression.lo \ Linear_Expression_Impl.lo Linear_Expression_Interface.lo \ Linear_Form.lo Scalar_Products.lo MIP_Problem.lo PIP_Tree.lo \ PIP_Problem.lo Poly_Con_Relation.lo Poly_Gen_Relation.lo \ @@ -420,10 +427,10 @@ Pointset_Powerset.lo CO_Tree.lo Sparse_Row.lo Dense_Row.lo \ Bit_Matrix.lo Bit_Row.lo Ph_Status.lo Grid_Status.lo \ Variable.lo Variables_Set.lo Grid_conversion.lo \ - Grid_simplify.lo stdiobuf.lo c_streambuf.lo globals.lo \ - mp_std_bits.lo Weight_Profiler.lo version.lo $(am__objects_2) \ - $(am__objects_1) termination.lo wrap_string.lo Time.lo \ - Watchdog.lo Threshold_Watcher.lo + Grid_simplify.lo set_GMP_memory_alloc_funcs.lo stdiobuf.lo \ + c_streambuf.lo globals.lo mp_std_bits.lo Weight_Profiler.lo \ + version.lo $(am__objects_2) $(am__objects_1) termination.lo \ + wrap_string.lo Time.lo Watchdog.lo Threshold_Watcher.lo libppl_la_OBJECTS = $(am_libppl_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -715,7 +722,7 @@ uudecode = @uudecode@ xsb_prolog = @xsb_prolog@ yap_prolog = @yap_prolog@ -LIBPPL_LT_CURRENT = 13 +LIBPPL_LT_CURRENT = 14 LIBPPL_LT_REVISION = 0 LIBPPL_LT_AGE = 0 AM_CPPFLAGS = \ @@ -756,7 +763,7 @@ INCLUDE_FILES = \ namespaces.hh \ compiler.hh \ -assert.hh \ +assertions.hh \ meta_programming.hh \ Slow_Copy.hh \ Has_Assign_Or_Swap.hh \ @@ -1112,12 +1119,15 @@ Og_Status_idefs.hh libppl_la_SOURCES = \ -assert.cc \ +assertions.cc \ Box.cc \ checked.cc \ Checked_Number.cc \ Float.cc \ fpu-ia32.cc \ +BDS_Status.cc \ +Box_Status.cc \ +Og_Status.cc \ Concrete_Expression.cc \ Constraint.cc \ Constraint_System.cc \ @@ -1127,6 +1137,7 @@ Grid_Generator_System.cc \ Generator.cc \ Grid_Generator.cc \ +Handler.cc \ Init.cc \ Coefficient.cc \ Linear_Expression.cc \ @@ -1167,6 +1178,7 @@ Variables_Set.cc \ Grid_conversion.cc \ Grid_simplify.cc \ +set_GMP_memory_alloc_funcs.cc \ stdiobuf.cc \ c_streambuf.cc \ globals.cc \ @@ -1345,12 +1357,14 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BDS_Status.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BD_Shape.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BHRZ03_Certificate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BUGS.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Bit_Matrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Bit_Row.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Box.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Box_Status.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/COPYING.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CO_Tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CREDITS.Po@am__quote@ @@ -1377,6 +1391,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_simplify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_widenings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H79_Certificate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Handler.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Linear_Expression.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Linear_Expression_Impl.Plo@am__quote@ @@ -1385,6 +1400,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MIP_Problem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NNC_Polyhedron.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Octagonal_Shape.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Og_Status.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PIP_Problem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PIP_Tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Partial_Function.Plo@am__quote@ @@ -1404,13 +1420,14 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Variables_Set.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Watchdog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Weight_Profiler.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assert.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assertions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_streambuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checked.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpu-ia32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp_std_bits.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppl-config.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_GMP_memory_alloc_funcs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdiobuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/termination.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Plo@am__quote@ @@ -1702,9 +1719,10 @@ @HAVE_PERL_TRUE@ $(top_builddir)/utils/text2cxxarray --name=BUGS_array --decl-only \ @HAVE_PERL_TRUE@ $(top_srcdir)/BUGS >>$@ @HAVE_PERL_TRUE@ @echo "#endif // !defined(PPL_BUGS_hh)" >>$@ -@HAVE_PERL_TRUE@BUGS.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/BUGS +@HAVE_PERL_TRUE@BUGS.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/BUGS BUGS.hh +@HAVE_PERL_TRUE@ @echo "#include \"BUGS.hh\"" >$@ @HAVE_PERL_TRUE@ $(top_builddir)/utils/text2cxxarray --name=BUGS_array \ -@HAVE_PERL_TRUE@ $(top_srcdir)/BUGS >$@ +@HAVE_PERL_TRUE@ $(top_srcdir)/BUGS >>$@ @HAVE_PERL_TRUE@COPYING.hh: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/COPYING @HAVE_PERL_TRUE@ @echo "#ifndef PPL_COPYING_hh" >$@ @@ -1712,19 +1730,21 @@ @HAVE_PERL_TRUE@ $(top_builddir)/utils/text2cxxarray --name=COPYING_array --decl-only \ @HAVE_PERL_TRUE@ $(top_srcdir)/COPYING >>$@ @HAVE_PERL_TRUE@ @echo "#endif // !defined(PPL_COPYING_hh)" >>$@ - -@HAVE_PERL_TRUE@COPYING.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/COPYING +@HAVE_PERL_TRUE@COPYING.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/COPYING COPYING.hh +@HAVE_PERL_TRUE@ @echo "#include \"COPYING.hh\"" >$@ @HAVE_PERL_TRUE@ $(top_builddir)/utils/text2cxxarray --name=COPYING_array \ -@HAVE_PERL_TRUE@ $(top_srcdir)/COPYING >$@ +@HAVE_PERL_TRUE@ $(top_srcdir)/COPYING >>$@ + @HAVE_PERL_TRUE@CREDITS.hh: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/CREDITS @HAVE_PERL_TRUE@ @echo "#ifndef PPL_CREDITS_hh" >$@ @HAVE_PERL_TRUE@ @echo "#define PPL_CREDITS_hh 1" >>$@ @HAVE_PERL_TRUE@ $(top_builddir)/utils/text2cxxarray --name=CREDITS_array --decl-only \ @HAVE_PERL_TRUE@ $(top_srcdir)/CREDITS >>$@ @HAVE_PERL_TRUE@ @echo "#endif // !defined(PPL_CREDITS_hh)" >>$@ -@HAVE_PERL_TRUE@CREDITS.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/CREDITS +@HAVE_PERL_TRUE@CREDITS.cc: $(top_builddir)/utils/text2cxxarray $(top_srcdir)/CREDITS CREDITS.hh +@HAVE_PERL_TRUE@ @echo "#include \"CREDITS.hh\"" >$@ @HAVE_PERL_TRUE@ $(top_builddir)/utils/text2cxxarray --name=CREDITS_array \ -@HAVE_PERL_TRUE@ $(top_srcdir)/CREDITS >$@ +@HAVE_PERL_TRUE@ $(top_srcdir)/CREDITS >>$@ @HAVE_PERL_FALSE@ppl.hh.sed: Makefile @HAVE_PERL_FALSE@ @echo "/^\/\* BEGIN ppl-config.h \*\/$$/ {" >$@ diff -Nru ppl-1.1/src/math_utilities_defs.hh ppl-1.2/src/math_utilities_defs.hh --- ppl-1.1/src/math_utilities_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/math_utilities_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Declarations of some math utility functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/math_utilities_inlines.hh ppl-1.2/src/math_utilities_inlines.hh --- ppl-1.1/src/math_utilities_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/math_utilities_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Implementation of some math utility functions: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,8 +25,8 @@ #define PPL_math_utilities_inlines_hh 1 #include "Coefficient_defs.hh" +#include "assertions.hh" #include -#include "assert.hh" namespace Parma_Polyhedra_Library { @@ -78,15 +78,17 @@ template inline void min_assign(N& x, const N& y) { - if (x > y) + if (x > y) { x = y; + } } template inline void max_assign(N& x, const N& y) { - if (x < y) + if (x < y) { x = y; + } } template @@ -107,8 +109,9 @@ inline bool is_canonical(const mpq_class& x) { - if (x.get_den() <= 0) + if (x.get_den() <= 0) { return false; + } PPL_DIRTY_TEMP(mpq_class, temp); temp = x; temp.canonicalize(); diff -Nru ppl-1.1/src/Matrix_defs.hh ppl-1.2/src/Matrix_defs.hh --- ppl-1.1/src/Matrix_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Matrix_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Matrix class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Matrix_inlines.hh ppl-1.2/src/Matrix_inlines.hh --- ppl-1.1/src/Matrix_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Matrix_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Matrix class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Matrix_templates.hh ppl-1.2/src/Matrix_templates.hh --- ppl-1.1/src/Matrix_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Matrix_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Matrix class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -29,16 +29,18 @@ template Matrix::Matrix(dimension_type n) : rows(n), num_columns_(n) { - for (dimension_type i = 0; i < rows.size(); ++i) + for (dimension_type i = 0; i < rows.size(); ++i) { rows[i].resize(num_columns_); + } PPL_ASSERT(OK()); } template Matrix::Matrix(dimension_type num_rows, dimension_type num_columns) : rows(num_rows), num_columns_(num_columns) { - for (dimension_type i = 0; i < rows.size(); ++i) + for (dimension_type i = 0; i < rows.size(); ++i) { rows[i].resize(num_columns_); + } PPL_ASSERT(OK()); } @@ -48,19 +50,22 @@ const dimension_type old_num_rows = rows.size(); rows.resize(num_rows); if (old_num_rows < num_rows) { - for (dimension_type i = old_num_rows; i < num_rows; ++i) + for (dimension_type i = old_num_rows; i < num_rows; ++i) { rows[i].resize(num_columns); + } if (num_columns_ != num_columns) { num_columns_ = num_columns; - for (dimension_type i = 0; i < old_num_rows; ++i) + for (dimension_type i = 0; i < old_num_rows; ++i) { rows[i].resize(num_columns); + } } } else if (num_columns_ != num_columns) { num_columns_ = num_columns; - for (dimension_type i = 0; i < num_rows; ++i) + for (dimension_type i = 0; i < num_rows; ++i) { rows[i].resize(num_columns); + } } PPL_ASSERT(OK()); } @@ -75,20 +80,24 @@ Row& rows_k = (*this)[k]; for (dimension_type i = 0, j = 0; i < n; i = ++j) { // Make `j' be the index of the next cycle terminator. - while (cycles[j] != 0) + while (cycles[j] != 0) { ++j; + } // Cycles of length less than 2 are not allowed. PPL_ASSERT(j - i >= 2); - if (j - i == 2) + if (j - i == 2) { // For cycles of length 2 no temporary is needed, just a swap. rows_k.swap_coefficients(cycles[i], cycles[i + 1]); + } else { // Longer cycles need a temporary. tmp = rows_k.get(cycles[j - 1]); - for (dimension_type l = (j - 1); l > i; --l) + for (dimension_type l = (j - 1); l > i; --l) { rows_k.swap_coefficients(cycles[l-1], cycles[l]); - if (tmp == 0) + } + if (tmp == 0) { rows_k.reset(cycles[i]); + } else { using std::swap; swap(tmp, rows_k[cycles[i]]); @@ -101,15 +110,17 @@ template void Matrix::swap_columns(dimension_type i, dimension_type j) { - for (dimension_type k = num_rows(); k-- > 0; ) + for (dimension_type k = num_rows(); k-- > 0; ) { (*this)[k].swap_coefficients(i, j); + } } template void Matrix::add_zero_columns(dimension_type n, dimension_type i) { - for (dimension_type j = rows.size(); j-- > 0; ) + for (dimension_type j = rows.size(); j-- > 0; ) { rows[j].add_zeroes_and_shift(n, i); + } num_columns_ += n; PPL_ASSERT(OK()); } @@ -117,8 +128,9 @@ template void Matrix::remove_column(dimension_type i) { - for (dimension_type j = rows.size(); j-- > 0; ) + for (dimension_type j = rows.size(); j-- > 0; ) { rows[j].delete_element_and_shift(i); + } --num_columns_; PPL_ASSERT(OK()); } @@ -128,8 +140,9 @@ Matrix::ascii_dump(std::ostream& s) const { s << num_rows() << " x "; s << num_columns() << "\n"; - for (const_iterator i = begin(), i_end = end(); i !=i_end; ++i) + for (const_iterator i = begin(), i_end = end(); i !=i_end; ++i) { i->ascii_dump(s); + } } PPL_OUTPUT_TEMPLATE_DEFINITIONS_ASCII_ONLY(Row, Matrix) @@ -140,21 +153,28 @@ std::string str; dimension_type new_num_rows; dimension_type new_num_cols; - if (!(s >> new_num_rows)) + if (!(s >> new_num_rows)) { return false; - if (!(s >> str) || str != "x") + } + if (!(s >> str) || str != "x") { return false; - if (!(s >> new_num_cols)) + } + if (!(s >> new_num_cols)) { return false; + } - for (iterator i = rows.begin(), i_end = rows.end(); i != i_end; ++i) + for (iterator i = rows.begin(), i_end = rows.end(); + i != i_end; ++i) { i->clear(); + } resize(new_num_rows, new_num_cols); - for (dimension_type row = 0; row < new_num_rows; ++row) - if (!rows[row].ascii_load(s)) + for (dimension_type row = 0; row < new_num_rows; ++row) { + if (!rows[row].ascii_load(s)) { return false; + } + } // Check invariants. PPL_ASSERT(OK()); @@ -170,9 +190,11 @@ template bool Matrix::OK() const { - for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) - if (i->size() != num_columns_) + for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) { + if (i->size() != num_columns_) { return false; + } + } return true; } @@ -180,13 +202,17 @@ template bool operator==(const Matrix& x, const Matrix& y) { - if (x.num_rows() != y.num_rows()) + if (x.num_rows() != y.num_rows()) { return false; - if (x.num_columns() != y.num_columns()) + } + if (x.num_columns() != y.num_columns()) { return false; - for (dimension_type i = x.num_rows(); i-- > 0; ) - if (x[i] != y[i]) + } + for (dimension_type i = x.num_rows(); i-- > 0; ) { + if (x[i] != y[i]) { return false; + } + } return true; } diff -Nru ppl-1.1/src/Matrix_types.hh ppl-1.2/src/Matrix_types.hh --- ppl-1.1/src/Matrix_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Matrix_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/max_space_dimension.hh ppl-1.2/src/max_space_dimension.hh --- ppl-1.1/src/max_space_dimension.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/max_space_dimension.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Definition of functions yielding maximal space dimensions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/meta_programming.hh ppl-1.2/src/meta_programming.hh --- ppl-1.1/src/meta_programming.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/meta_programming.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Metaprogramming utilities. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/MIP_Problem.cc ppl-1.2/src/MIP_Problem.cc --- ppl-1.1/src/MIP_Problem.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/MIP_Problem.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* MIP_Problem class implementation: non-inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -34,12 +34,6 @@ #include "Scalar_Products_inlines.hh" #include "math_utilities_defs.hh" -#include -#include -#include -#include -#include - // TODO: Remove this when the sparse working cost has been tested enough. #if PPL_USE_SPARSE_MATRIX @@ -58,6 +52,12 @@ #define PPL_SIMPLEX_USE_MIP_HEURISTIC 1 #endif +#include +#include +#include +#include +#include + #if PPL_NOISY_SIMPLEX #include #endif @@ -93,11 +93,12 @@ last_generator(point()), i_variables() { // Check for space dimension overflow. - if (dim > max_space_dimension()) + if (dim > max_space_dimension()) { throw std::length_error("PPL::MIP_Problem::MIP_Problem(dim, cs, obj, " "mode):\n" "dim exceeds the maximum allowed " "space dimension."); + } PPL_ASSERT(OK()); } @@ -122,11 +123,12 @@ last_generator(point()), i_variables() { // Check for space dimension overflow. - if (dim > max_space_dimension()) + if (dim > max_space_dimension()) { throw std::length_error("PPL::MIP_Problem::MIP_Problem(dim, cs, obj, " "mode):\n" "dim exceeds the maximum allowed" "space dimension."); + } // Check the objective function. if (obj.space_dimension() > dim) { std::ostringstream s; @@ -144,14 +146,16 @@ << " exceeds dim == " << dim << "."; throw std::invalid_argument(s.str()); } - if (cs.has_strict_inequalities()) + if (cs.has_strict_inequalities()) { throw std::invalid_argument("PPL::MIP_Problem::" "MIP_Problem(d, cs, obj, m):\n" "cs contains strict inequalities."); + } // Actually copy the constraints. for (Constraint_System::const_iterator - i = cs.begin(), i_end = cs.end(); i != i_end; ++i) + i = cs.begin(), i_end = cs.end(); i != i_end; ++i) { add_constraint_helper(*i); + } PPL_ASSERT(OK()); } @@ -165,12 +169,14 @@ "this->space_dimension == " << space_dimension() << "."; throw std::invalid_argument(s.str()); } - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { throw std::invalid_argument("PPL::MIP_Problem::add_constraint(c):\n" "c is a strict inequality."); + } add_constraint_helper(c); - if (status != UNSATISFIABLE) + if (status != UNSATISFIABLE) { status = PARTIALLY_SATISFIABLE; + } PPL_ASSERT(OK()); } @@ -184,14 +190,17 @@ << "."; throw std::invalid_argument(s.str()); } - if (cs.has_strict_inequalities()) + if (cs.has_strict_inequalities()) { throw std::invalid_argument("PPL::MIP_Problem::add_constraints(cs):\n" "cs contains strict inequalities."); + } for (Constraint_System::const_iterator - i = cs.begin(), i_end = cs.end(); i != i_end; ++i) + i = cs.begin(), i_end = cs.end(); i != i_end; ++i) { add_constraint_helper(*i); - if (status != UNSATISFIABLE) + } + if (status != UNSATISFIABLE) { status = PARTIALLY_SATISFIABLE; + } PPL_ASSERT(OK()); } @@ -206,27 +215,32 @@ throw std::invalid_argument(s.str()); } input_obj_function = obj; - if (status == UNBOUNDED || status == OPTIMIZED) + if (status == UNBOUNDED || status == OPTIMIZED) { status = SATISFIABLE; + } PPL_ASSERT(OK()); } const PPL::Generator& PPL::MIP_Problem::feasible_point() const { - if (is_satisfiable()) + if (is_satisfiable()) { return last_generator; - else + } + else { throw std::domain_error("PPL::MIP_Problem::feasible_point():\n" "*this is not satisfiable."); + } } const PPL::Generator& PPL::MIP_Problem::optimizing_point() const { - if (solve() == OPTIMIZED_MIP_PROBLEM) + if (solve() == OPTIMIZED_MIP_PROBLEM) { return last_generator; - else + } + else { throw std::domain_error("PPL::MIP_Problem::optimizing_point():\n" "*this does not have an optimizing point."); + } } bool @@ -247,9 +261,9 @@ { MIP_Problem& x = const_cast(*this); // LP case. - if (x.i_variables.empty()) + if (x.i_variables.empty()) { return x.is_lp_satisfiable(); - + } // MIP case. { // Temporarily relax the MIP into an LP problem. @@ -263,8 +277,9 @@ x.last_generator = p; x.status = SATISFIABLE; } - else + else { x.status = UNSATISFIABLE; + } } // `relaxed' destroyed here: relaxation automatically reset. return (x.status == SATISFIABLE); } @@ -295,8 +310,9 @@ // LP case. if (x.is_lp_satisfiable()) { x.second_phase(); - if (x.status == UNBOUNDED) + if (x.status == UNBOUNDED) { return UNBOUNDED_MIP_PROBLEM; + } else { PPL_ASSERT(x.status == OPTIMIZED); return OPTIMIZED_MIP_PROBLEM; @@ -311,8 +327,9 @@ { // Temporarily relax the MIP into an LP problem. RAII_Temporary_Real_Relaxation relaxed(x); - if (relaxed.lp.is_lp_satisfiable()) + if (relaxed.lp.is_lp_satisfiable()) { relaxed.lp.second_phase(); + } else { x.status = UNSATISFIABLE; // NOTE: `relaxed' destroyed: relaxation automatically reset. @@ -357,39 +374,45 @@ PPL::MIP_Problem::add_space_dimensions_and_embed(const dimension_type m) { // The space dimension of the resulting MIP problem should not // overflow the maximum allowed space dimension. - if (m > max_space_dimension() - space_dimension()) + if (m > max_space_dimension() - space_dimension()) { throw std::length_error("PPL::MIP_Problem::" "add_space_dimensions_and_embed(m):\n" "adding m new space dimensions exceeds " "the maximum allowed space dimension."); + } external_space_dim += m; - if (status != UNSATISFIABLE) + if (status != UNSATISFIABLE) { status = PARTIALLY_SATISFIABLE; + } PPL_ASSERT(OK()); } void PPL::MIP_Problem ::add_to_integer_space_dimensions(const Variables_Set& i_vars) { - if (i_vars.space_dimension() > external_space_dim) + if (i_vars.space_dimension() > external_space_dim) { throw std::invalid_argument("PPL::MIP_Problem::" "add_to_integer_space_dimension(i_vars):\n" "*this and i_vars are dimension" "incompatible."); + } const dimension_type original_size = i_variables.size(); i_variables.insert(i_vars.begin(), i_vars.end()); // If a new integral variable was inserted, set the internal status to // PARTIALLY_SATISFIABLE. - if (i_variables.size() != original_size && status != UNSATISFIABLE) + if (i_variables.size() != original_size && status != UNSATISFIABLE) { status = PARTIALLY_SATISFIABLE; + } } bool PPL::MIP_Problem::is_in_base(const dimension_type var_index, dimension_type& row_index) const { - for (row_index = base.size(); row_index-- > 0; ) - if (base[row_index] == var_index) + for (row_index = base.size(); row_index-- > 0; ) { + if (base[row_index] == var_index) { return true; + } + } return false; } @@ -423,15 +446,18 @@ // Adjust data structures, `shifting' the proper columns to the left by 1. const dimension_type base_size = base.size(); for (dimension_type i = base_size; i-- > 0; ) { - if (base[i] > removing_column) + if (base[i] > removing_column) { --base[i]; + } } const dimension_type mapping_size = mapping.size(); for (dimension_type i = mapping_size; i-- > 0; ) { - if (mapping[i].first > removing_column) + if (mapping[i].first > removing_column) { --mapping[i].first; - if (mapping[i].second > removing_column) + } + if (mapping[i].second > removing_column) { --mapping[i].second; + } } return unfeasible_tableau_row; @@ -513,9 +539,11 @@ if (mapping_size > 0) { // Note: mapping[0] is associated to the cost function. for (dimension_type i = std::min(mapping_size - 1, cs_space_dim); - i-- > 0; ) - if (mapping[i + 1].second == 0) + i-- > 0; ) { + if (mapping[i + 1].second == 0) { is_nonnegative_variable[i] = true; + } + } } // Process each pending constraint in `input_cs' and @@ -538,15 +566,17 @@ // If more than one coefficient is nonzero, // continue with next constraint. if (found_many_nonzero_coeffs) { - if (cs_i.is_inequality()) + if (cs_i.is_inequality()) { ++additional_slack_variables; // CHECKME: Is it true that in the first phase we can apply // `is_satisfied()' with the generator `point()'? If so, the following // code works even if we do not have a feasible point. // Check for satisfiability of the inequality. This can be done if we // have a feasible point of *this. - if (cs_i.is_inequality() && is_satisfied(cs_i, last_generator)) + } + if (cs_i.is_inequality() && is_satisfied(cs_i, last_generator)) { is_satisfied_inequality[i - first_pending_constraint] = true; + } continue; } @@ -554,15 +584,18 @@ // All coefficients are 0. // The constraint is either trivially true or trivially false. if (cs_i.is_inequality()) { - if (cs_i.inhomogeneous_term() < 0) + if (cs_i.inhomogeneous_term() < 0) { // A constraint such as -1 >= 0 is trivially false. return false; + } } - else + else { // The constraint is an equality. - if (cs_i.inhomogeneous_term() != 0) + if (cs_i.inhomogeneous_term() != 0) { // A constraint such as 1 == 0 is trivially false. return false; + } + } // Here the constraint is trivially true. is_tableau_constraint[i - first_pending_constraint] = false; --additional_tableau_rows; @@ -608,13 +641,15 @@ // Cases 1-3: apply method A. if (sgn_a == sgn_b) { - if (cs_i.is_inequality()) + if (cs_i.is_inequality()) { ++additional_slack_variables; + } } // Cases 4-5: apply method B. - else if (cs_i.is_equality()) + else if (cs_i.is_equality()) { is_nonnegative_variable[nonzero_var_index] = true; // Case 6: apply method B. + } else if (sgn_b < 0) { is_nonnegative_variable[nonzero_var_index] = true; ++additional_slack_variables; @@ -666,13 +701,15 @@ // and a negative part and is now known to be nonnegative. std::vector unfeasible_tableau_rows; for (dimension_type i = internal_space_dim; i-- > 0; ) { - if (!is_remergeable_variable[i]) + if (!is_remergeable_variable[i]) { continue; + } // TODO: merging all rows in a single shot may be more efficient // as it would require a single call to permute_columns(). const dimension_type unfeasible_row = merge_split_variable(i); - if (unfeasible_row != not_a_dimension()) + if (unfeasible_row != not_a_dimension()) { unfeasible_tableau_rows.push_back(unfeasible_row); + } } const dimension_type old_tableau_num_rows = tableau.num_rows(); @@ -704,8 +741,9 @@ } // Resize the tableau: first add additional rows ... - if (additional_tableau_rows > 0) + if (additional_tableau_rows > 0) { tableau.add_zero_rows(additional_tableau_rows); + } // ... then add additional columns. // We need columns for additional (split) problem variables, additional @@ -736,8 +774,9 @@ + additional_slack_vars + additional_artificial_vars; - if (additional_tableau_columns > 0) + if (additional_tableau_columns > 0) { tableau.add_zero_columns(additional_tableau_columns); + } // Dimensions of the tableau after resizing. const dimension_type tableau_num_rows = tableau.num_rows(); @@ -745,7 +784,7 @@ // The following vector will be useful know if a constraint is feasible // and does not require an additional artificial variable. - std::deque worked_out_row (tableau_num_rows, false); + std::deque worked_out_row(tableau_num_rows, false); // Sync the `base' vector size to the new tableau: fill with zeros // to encode that these rows are not OK and must be adjusted. @@ -769,8 +808,9 @@ // Proceed with the insertion of the constraints. for (dimension_type k = tableau_num_rows, i = input_cs.size() - first_pending_constraint; i-- > 0; ) { - if (!is_tableau_constraint[i]) + if (!is_tableau_constraint[i]) { continue; + } // Copy the original constraint in the tableau. Row& tableau_k = tableau[--k]; Row::iterator itr = tableau_k.end(); @@ -810,9 +850,11 @@ worked_out_row[k] = true; } } - for (dimension_type j = base_size; j-- > 0; ) - if (k != j && base[j] != 0 && tableau_k.get(base[j]) != 0) + for (dimension_type j = base_size; j-- > 0; ) { + if (k != j && base[j] != 0 && tableau_k.get(base[j]) != 0) { linear_combine(tableau_k, tableau[j], base[j]); + } + } } // Let all inhomogeneous terms in the tableau be nonpositive, @@ -822,8 +864,10 @@ Row& tableau_i = tableau[i]; if (tableau_i.get(0) > 0) { for (Row::iterator - j = tableau_i.begin(), j_end = tableau_i.end(); j != j_end; ++j) + j = tableau_i.begin(), j_end = tableau_i.end(); + j != j_end; ++j) { neg_assign(*j); + } } } @@ -851,8 +895,9 @@ // that are already satisfied by `last_generator' (this information // is encoded in `worked_out_row'). for (dimension_type i = old_tableau_num_rows; i < tableau_num_rows; ++i) { - if (worked_out_row[i]) + if (worked_out_row[i]) { continue; + } tableau[i].insert(artificial_index, Coefficient_one()); cost_itr = working_cost.insert(cost_itr, artificial_index); *cost_itr = -1; @@ -929,8 +974,9 @@ } // Prepare *this for a possible second phase. - if (begin_artificials != 0) + if (begin_artificials != 0) { erase_artificials(begin_artificials, end_artificials); + } compute_generator(); status = SATISFIABLE; } @@ -991,9 +1037,11 @@ // Note that find() is used instead of lower_bound(). working_cost_type::const_iterator i_end = working_cost.find(tableau_num_columns_minus_1); - for ( ; i != i_end; ++i) - if (sgn(*i) == cost_sign) + for ( ; i != i_end; ++i) { + if (sgn(*i) == cost_sign) { columns.push_back(std::make_pair(i.index(), 1.0)); + } + } } for (dimension_type i = tableau_num_rows; i-- > 0; ) { const Row& tableau_i = tableau[i]; @@ -1006,10 +1054,12 @@ = columns.end(); while (j != j_end && k != k_end) { const dimension_type column = j.index(); - while (k != k_end && column > k->first) + while (k != k_end && column > k->first) { ++k; - if (k == k_end) + } + if (k == k_end) { break; + } if (k->first > column) { j = tableau_i.lower_bound(j, k->first); } @@ -1094,11 +1144,13 @@ // Compute the lcm of all the coefficients of variables in base. PPL_DIRTY_TEMP_COEFFICIENT(lcm_basis); lcm_basis = 1; - for (dimension_type i = tableau_num_rows; i-- > 0; ) + for (dimension_type i = tableau_num_rows; i-- > 0; ) { lcm_assign(lcm_basis, lcm_basis, tableau[i].get(base[i])); + } // Compute normalization factors. - for (dimension_type i = tableau_num_rows; i-- > 0; ) + for (dimension_type i = tableau_num_rows; i-- > 0; ) { exact_div_assign(norm_factor[i], lcm_basis, tableau[i].get(base[i])); + } // Compute the square of `lcm_basis', exploiting the fact that // `lcm_basis' will no longer be needed. lcm_basis *= lcm_basis; @@ -1138,10 +1190,12 @@ // Note that find() is used instead of lower_bound. working_cost_type::const_iterator i_end = working_cost.find(tableau_num_columns_minus_1); - for ( ; i != i_end; ++i) - if (sgn(*i) == cost_sign) + for ( ; i != i_end; ++i) { + if (sgn(*i) == cost_sign) { columns.push_back(std::pair (i.index(), squared_lcm_basis)); + } + } } for (dimension_type i = tableau_num_rows; i-- > 0; ) { const Row& tableau_i = tableau[i]; @@ -1152,13 +1206,16 @@ std::vector >::iterator k_end = columns.end(); while (j != j_end) { - while (k != k_end && j.index() > k->first) + while (k != k_end && j.index() > k->first) { ++k; - if (k == k_end) + } + if (k == k_end) { break; + } PPL_ASSERT(j.index() <= k->first); - if (j.index() < k->first) + if (j.index() < k->first) { j = tableau_i.lower_bound(j, k->first); + } else { Coefficient_traits::const_reference tableau_ij = *j; WEIGHT_BEGIN(); @@ -1289,9 +1346,11 @@ // equivalent when searching the last element in the row. working_cost_type::const_iterator i_end = working_cost.find(cost_sign_index); - for ( ; i != i_end; ++i) - if (sgn(*i) == cost_sign) + for ( ; i != i_end; ++i) { + if (sgn(*i) == cost_sign) { return i.index(); + } + } // No variable has to enter the base: // the cost function was optimized. return 0; @@ -1369,16 +1428,19 @@ // different from zero, the final status is unbounded. // In the first part the variable is constrained to be greater or equal // than zero. - if (mapping[i.variable().space_dimension()].second != 0) + if (mapping[i.variable().space_dimension()].second != 0) { return true; + } if (optimization_mode == MAXIMIZATION) { - if (*i > 0) + if (*i > 0) { return true; + } } else { PPL_ASSERT(optimization_mode == MINIMIZATION); - if (*i < 0) + if (*i < 0) { return true; + } } } return false; @@ -1392,12 +1454,14 @@ // Linearly combine the constraints. for (dimension_type i = tableau.num_rows(); i-- > 0; ) { Row& tableau_i = tableau[i]; - if (i != exiting_base_index && tableau_i.get(entering_var_index) != 0) + if (i != exiting_base_index && tableau_i.get(entering_var_index) != 0) { linear_combine(tableau_i, tableau_out, entering_var_index); + } } // Linearly combine the cost function. - if (working_cost.get(entering_var_index) != 0) + if (working_cost.get(entering_var_index) != 0) { linear_combine(working_cost, tableau_out, entering_var_index); + } // Adjust the base. base[exiting_base_index] = entering_var_index; } @@ -1424,8 +1488,9 @@ } } // Check for unboundedness. - if (exiting_base_index == tableau_num_rows) + if (exiting_base_index == tableau_num_rows) { return tableau_num_rows; + } // Reaching this point means that a variable will definitely exit the base. PPL_DIRTY_TEMP_COEFFICIENT(lcm); @@ -1477,8 +1542,9 @@ cost_sgn_coeff = working_cost.get(working_cost.size() - 1); current_numer = working_cost.get(0); - if (cost_sgn_coeff < 0) + if (cost_sgn_coeff < 0) { neg_assign(current_numer); + } abs_assign(current_denom, cost_sgn_coeff); PPL_ASSERT(tableau.num_columns() == working_cost.size()); const dimension_type tableau_num_rows = tableau.num_rows(); @@ -1491,15 +1557,17 @@ : steepest_edge_float_entering_index(); // If no entering index was computed, the problem is solved. - if (entering_var_index == 0) + if (entering_var_index == 0) { return true; + } // Choose the index of the row exiting the base. const dimension_type exiting_base_index = get_exiting_base_index(entering_var_index); // If no exiting index was computed, the problem is unbounded. - if (exiting_base_index == tableau_num_rows) + if (exiting_base_index == tableau_num_rows) { return false; + } // Check if the client has requested abandoning all expensive // computations. If so, the exception specified by the client @@ -1517,16 +1585,18 @@ cost_sgn_coeff = working_cost.get(working_cost.size() - 1); challenger = working_cost.get(0); - if (cost_sgn_coeff < 0) + if (cost_sgn_coeff < 0) { neg_assign(challenger); + } challenger *= current_denom; abs_assign(current, cost_sgn_coeff); current *= current_numer; #if PPL_NOISY_SIMPLEX ++num_iterations; - if (num_iterations % 200 == 0) + if (num_iterations % 200 == 0) { std::cout << "Primal simplex: iteration " << num_iterations << "." << std::endl; + } #endif // PPL_NOISY_SIMPLEX // If the following condition fails, probably there's a bug. PPL_ASSERT(challenger >= current); @@ -1536,8 +1606,9 @@ ++non_increased_times; // In the following case we will proceed using the `textbook' // technique, until the objective function is not improved. - if (non_increased_times > allowed_non_increasing_loops) + if (non_increased_times > allowed_non_increasing_loops) { textbook_pricing = true; + } } // The objective function has an improvement: // reset `non_increased_times' and `textbook_pricing'. @@ -1546,8 +1617,9 @@ textbook_pricing = false; } current_numer = working_cost.get(0); - if (cost_sgn_coeff < 0) + if (cost_sgn_coeff < 0) { neg_assign(current_numer); + } abs_assign(current_denom, cost_sgn_coeff); WEIGHT_ADD(433); } @@ -1570,15 +1642,17 @@ ? textbook_entering_index() : steepest_edge_exact_entering_index(); // If no entering index was computed, the problem is solved. - if (entering_var_index == 0) + if (entering_var_index == 0) { return true; + } // Choose the index of the row exiting the base. const dimension_type exiting_base_index = get_exiting_base_index(entering_var_index); // If no exiting index was computed, the problem is unbounded. - if (exiting_base_index == tableau_num_rows) + if (exiting_base_index == tableau_num_rows) { return false; + } // Check if the client has requested abandoning all expensive // computations. If so, the exception specified by the client @@ -1591,9 +1665,10 @@ pivot(entering_var_index, exiting_base_index); #if PPL_NOISY_SIMPLEX ++num_iterations; - if (num_iterations % 200 == 0) + if (num_iterations % 200 == 0) { std::cout << "Primal simplex: iteration " << num_iterations << "." << std::endl; + } #endif // PPL_NOISY_SIMPLEX } } @@ -1608,7 +1683,7 @@ const dimension_type old_last_column = tableau.num_columns() - 1; dimension_type tableau_n_rows = tableau.num_rows(); // Step 1: try to remove from the base all the remaining slack variables. - for (dimension_type i = 0; i < tableau_n_rows; ++i) + for (dimension_type i = 0; i < tableau_n_rows; ++i) { if (begin_artificials <= base[i] && base[i] < end_artificials) { // Search for a non-zero element to enter the base. Row& tableau_i = tableau[i]; @@ -1616,14 +1691,16 @@ Row::const_iterator j = tableau_i.begin(); Row::const_iterator j_end = tableau_i.end(); // Skip the first element - if (j != j_end && j.index() == 0) + if (j != j_end && j.index() == 0) { ++j; - for ( ; (j != j_end) && (j.index() < begin_artificials); ++j) + } + for ( ; (j != j_end) && (j.index() < begin_artificials); ++j) { if (*j != 0) { pivot(j.index(), i); redundant = false; break; } + } if (redundant) { // No original variable entered the base: // the constraint is redundant and should be deleted. @@ -1639,7 +1716,7 @@ base.pop_back(); } } - + } // Step 2: Adjust data structures so as to enter phase 2 of the simplex. // Resize the tableau. @@ -1648,8 +1725,9 @@ // Zero the last column of the tableau. const dimension_type new_last_column = tableau.num_columns() - 1; - for (dimension_type i = tableau_n_rows; i-- > 0; ) + for (dimension_type i = tableau_n_rows; i-- > 0; ) { tableau[i].reset(new_last_column); + } // ... then properly set the element in the (new) last column, // encoding the kind of optimization; ... @@ -1663,10 +1741,12 @@ // but it avoids storing zeroes. Coefficient_traits::const_reference old_cost = working_cost.get(old_last_column); - if (old_cost == 0) + if (old_cost == 0) { working_cost.reset(new_last_column); - else + } + else { working_cost.insert(new_last_column, old_cost); + } } // ... and finally remove redundant columns. @@ -1745,10 +1825,12 @@ exact_div_assign(split_denom, lcm, split_denom); numer_i *= denom_i; sub_mul_assign(numer_i, split_numer, split_denom); - if (numer_i == 0) + if (numer_i == 0) { denom_i = 1; - else + } + else { denom_i = lcm; + } } // Note: if the negative component was not in base, then // it has value zero and there is nothing left to do. @@ -1758,8 +1840,9 @@ // Compute the lcm of all denominators. PPL_ASSERT(external_space_dim > 0); lcm = denom[0]; - for (dimension_type i = 1; i < external_space_dim; ++i) + for (dimension_type i = 1; i < external_space_dim; ++i) { lcm_assign(lcm, lcm, denom[i]); + } // Use the denominators to store the numerators' multipliers // and then compute the normalized numerators. for (dimension_type i = external_space_dim; i-- > 0; ) { @@ -1769,8 +1852,9 @@ // Finally, build the generator. Linear_Expression expr; - for (dimension_type i = external_space_dim; i-- > 0; ) + for (dimension_type i = external_space_dim; i-- > 0; ) { add_mul_assign(expr, numer[i], Variable(i)); + } MIP_Problem& x = const_cast(*this); x.last_generator = point(expr, lcm); @@ -1783,18 +1867,20 @@ || status == UNBOUNDED || status == OPTIMIZED); // In the following cases the problem is already solved. - if (status == UNBOUNDED || status == OPTIMIZED) + if (status == UNBOUNDED || status == OPTIMIZED) { return; - + } // Build the objective function for the second phase. Row new_cost; input_obj_function.get_row(new_cost); // Negate the cost function if we are minimizing. - if (opt_mode == MINIMIZATION) + if (opt_mode == MINIMIZATION) { for (Row::iterator i = new_cost.begin(), - i_end = new_cost.end(); i != i_end; ++i) + i_end = new_cost.end(); i != i_end; ++i) { neg_assign(*i); + } + } const dimension_type cost_zero_size = working_cost.size(); @@ -1857,15 +1943,16 @@ Coefficient& numer, Coefficient& denom) const { const dimension_type ep_space_dim = evaluating_point.space_dimension(); - if (space_dimension() < ep_space_dim) + if (space_dimension() < ep_space_dim) { throw std::invalid_argument("PPL::MIP_Problem::" "evaluate_objective_function(p, n, d):\n" "*this and p are dimension incompatible."); - if (!evaluating_point.is_point()) + } + if (!evaluating_point.is_point()) { throw std::invalid_argument("PPL::MIP_Problem::" "evaluate_objective_function(p, n, d):\n" "p is not a point."); - + } // Compute the smallest space dimension between `input_obj_function' // and `evaluating_point'. const dimension_type working_space_dim @@ -1937,17 +2024,18 @@ mip_status = (mip.status == OPTIMIZED) ? OPTIMIZED_MIP_PROBLEM : UNBOUNDED_MIP_PROBLEM; } - else + else { return UNFEASIBLE_MIP_PROBLEM; - + } PPL_DIRTY_TEMP(mpq_class, tmp_rational); Generator p = point(); PPL_DIRTY_TEMP_COEFFICIENT(tmp_coeff1); PPL_DIRTY_TEMP_COEFFICIENT(tmp_coeff2); - if (mip_status == UNBOUNDED_MIP_PROBLEM) + if (mip_status == UNBOUNDED_MIP_PROBLEM) { p = mip.last_generator; + } else { PPL_ASSERT(mip_status == OPTIMIZED_MIP_PROBLEM); // Do not call optimizing_point(). @@ -1960,9 +2048,10 @@ && ((mip.optimization_mode() == MAXIMIZATION && tmp_rational <= incumbent_solution_value) || (mip.optimization_mode() == MINIMIZATION - && tmp_rational >= incumbent_solution_value))) + && tmp_rational >= incumbent_solution_value))) { // Abandon this path. return mip_status; + } } bool found_satisfiable_generator = true; @@ -2065,22 +2154,26 @@ gcd_assign(gcd, last_generator.coefficient(Variable(*v_it)), last_generator_divisor); - if (gcd != last_generator_divisor) + if (gcd != last_generator_divisor) { candidate_variables.insert(*v_it); + } } // If this set is empty, we have finished. - if (candidate_variables.empty()) + if (candidate_variables.empty()) { return true; + } // Check how many `active constraints' we have and track them. const dimension_type input_cs_num_rows = input_cs.size(); - std::deque satisfiable_constraints (input_cs_num_rows, false); - for (dimension_type i = input_cs_num_rows; i-- > 0; ) + std::deque satisfiable_constraints(input_cs_num_rows, false); + for (dimension_type i = input_cs_num_rows; i-- > 0; ) { // An equality is an `active constraint' by definition. // If we have an inequality, check if it is an `active constraint'. if (input_cs[i]->is_equality() - || is_saturated(*(input_cs[i]), last_generator)) + || is_saturated(*(input_cs[i]), last_generator)) { satisfiable_constraints[i] = true; + } + } dimension_type winning_num_appearances = 0; @@ -2090,17 +2183,20 @@ // For every candidate variable, check how many times this appear in the // active constraints. for (dimension_type i = input_cs_num_rows; i-- > 0; ) { - if (!satisfiable_constraints[i]) + if (!satisfiable_constraints[i]) { continue; + } // TODO: This can be optimized more, exploiting the (possible) // sparseness of input_cs, if the size of candidate_variables is expected // to be greater than the number of nonzeroes of most rows. for (Variables_Set::const_iterator v_it = candidate_variables.begin(), v_end = candidate_variables.end(); v_it != v_end; ++v_it) { - if (*v_it >= input_cs[i]->space_dimension()) + if (*v_it >= input_cs[i]->space_dimension()) { break; - if (input_cs[i]->coefficient(Variable(*v_it)) != 0) + } + if (input_cs[i]->coefficient(Variable(*v_it)) != 0) { ++num_appearances[*v_it]; + } } } for (Variables_Set::const_iterator v_it = candidate_variables.begin(), @@ -2164,8 +2260,9 @@ } #endif - if (found_satisfiable_generator) + if (found_satisfiable_generator) { return true; + } PPL_ASSERT(non_int_dim < mip.space_dimension()); @@ -2243,11 +2340,12 @@ return false; } - if (!tableau.OK() || !last_generator.OK()) + if (!tableau.OK() || !last_generator.OK()) { return false; + } // Constraint system should contain no strict inequalities. - for (dimension_type i = input_cs_num_rows; i-- > 0; ) + for (dimension_type i = input_cs_num_rows; i-- > 0; ) { if (input_cs[i]->is_strict_inequality()) { #ifndef NDEBUG cerr << "The feasible region of the MIP_Problem is defined by " @@ -2258,6 +2356,8 @@ return false; } + } + if (external_space_dim < internal_space_dim) { #ifndef NDEBUG cerr << "The MIP_Problem claims to have an internal space dimension " @@ -2308,7 +2408,7 @@ return false; } - for (dimension_type i = 0; i < first_pending_constraint; ++i) + for (dimension_type i = 0; i < first_pending_constraint; ++i) { if (!is_satisfied(*(input_cs[i]), last_generator)) { #ifndef NDEBUG cerr << "The cached feasible point does not belong to " @@ -2318,6 +2418,7 @@ #endif return false; } + } // Check that every integer declared variable is really integer. // in the solution found. @@ -2331,8 +2432,9 @@ v_end = i_variables.end(); v_it != v_end; ++v_it) { gcd_assign(gcd, last_generator.coefficient(Variable(*v_it)), last_generator.divisor()); - if (gcd != last_generator.divisor()) + if (gcd != last_generator.divisor()) { return false; + } } } @@ -2377,13 +2479,15 @@ return false; } } + { // Needed to sort accesses to tableau_j, improving performance. typedef std::vector > pair_vector_t; pair_vector_t vars_in_base; - for (dimension_type i = base.size(); i-- > 0; ) + for (dimension_type i = base.size(); i-- > 0; ) { vars_in_base.push_back(std::make_pair(base[i], i)); + } std::sort(vars_in_base.begin(), vars_in_base.end()); @@ -2395,8 +2499,9 @@ Row::const_iterator itr_end = tableau_j.end(); for ( ; i != i_end && itr != itr_end; ++i) { // tableau[i][base[j]], with i different from j, must be zero. - if (itr.index() < i->first) + if (itr.index() < i->first) { itr = tableau_j.lower_bound(itr, itr.index()); + } if (i->second != j && itr.index() == i->first && *itr != 0) { #ifndef NDEBUG cerr << "tableau[i][base[j]], with i different from j, must be " @@ -2420,7 +2525,7 @@ } // The last column of the tableau must contain only zeroes. - for (dimension_type i = tableau_num_rows; i-- > 0; ) + for (dimension_type i = tableau_num_rows; i-- > 0; ) { if (tableau[i].get(tableau_num_columns - 1) != 0) { #ifndef NDEBUG cerr << "the last column of the tableau must contain only" @@ -2429,6 +2534,7 @@ #endif return false; } + } } // All checks passed. @@ -2444,8 +2550,9 @@ const dimension_type input_cs_size = input_cs.size(); s << "\ninput_cs( " << input_cs_size << " )\n"; - for (dimension_type i = 0; i < input_cs_size; ++i) + for (dimension_type i = 0; i < input_cs_size; ++i) { input_cs[i]->ascii_dump(s); + } s << "\ninherited_constraints: " << inherited_constraints << std::endl; @@ -2500,17 +2607,19 @@ const dimension_type base_size = base.size(); s << "\nbase( " << base_size << " )\n"; - for (dimension_type i = 0; i != base_size; ++i) + for (dimension_type i = 0; i != base_size; ++i) { s << base[i] << ' '; + } s << "\nlast_generator\n"; last_generator.ascii_dump(s); const dimension_type mapping_size = mapping.size(); s << "\nmapping( " << mapping_size << " )\n"; - for (dimension_type i = 1; i < mapping_size; ++i) + for (dimension_type i = 1; i < mapping_size; ++i) { s << "\n"<< i << " -> " << mapping[i].first << " -> " << mapping[i].second << ' '; + } s << "\n\ninteger_variables"; i_variables.ascii_dump(s); @@ -2521,201 +2630,254 @@ bool PPL::MIP_Problem::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "external_space_dim:") + if (!(s >> str) || str != "external_space_dim:") { return false; + } - if (!(s >> external_space_dim)) + if (!(s >> external_space_dim)) { return false; + } - if (!(s >> str) || str != "internal_space_dim:") + if (!(s >> str) || str != "internal_space_dim:") { return false; + } - if (!(s >> internal_space_dim)) + if (!(s >> internal_space_dim)) { return false; + } - if (!(s >> str) || str != "input_cs(") + if (!(s >> str) || str != "input_cs(") { return false; + } dimension_type input_cs_size; - if (!(s >> input_cs_size)) + if (!(s >> input_cs_size)) { return false; + } - if (!(s >> str) || str != ")") + if (!(s >> str) || str != ")") { return false; + } Constraint c(Constraint::zero_dim_positivity()); input_cs.reserve(input_cs_size); for (dimension_type i = 0; i < input_cs_size; ++i) { - if (!c.ascii_load(s)) + if (!c.ascii_load(s)) { return false; + } add_constraint_helper(c); } - if (!(s >> str) || str != "inherited_constraints:") + if (!(s >> str) || str != "inherited_constraints:") { return false; + } - if (!(s >> inherited_constraints)) + if (!(s >> inherited_constraints)) { return false; + } // NOTE: we loaded the number of inherited constraints, but we nonetheless // reset to zero the corresponding data member, since we do not support // constraint inheritance via ascii_load. inherited_constraints = 0; - if (!(s >> str) || str != "first_pending_constraint:") + if (!(s >> str) || str != "first_pending_constraint:") { return false; - - if (!(s >> first_pending_constraint)) + } + if (!(s >> first_pending_constraint)) { return false; - - if (!(s >> str) || str != "input_obj_function") + } + if (!(s >> str) || str != "input_obj_function") { return false; - - if (!input_obj_function.ascii_load(s)) + } + if (!input_obj_function.ascii_load(s)) { return false; - - if (!(s >> str) || str != "opt_mode") + } + if (!(s >> str) || str != "opt_mode") { return false; - - if (!(s >> str)) + } + if (!(s >> str)) { return false; - - if (str == "MAXIMIZATION") + } + if (str == "MAXIMIZATION") { set_optimization_mode(MAXIMIZATION); + } else { - if (str != "MINIMIZATION") + if (str != "MINIMIZATION") { return false; + } set_optimization_mode(MINIMIZATION); } - if (!(s >> str) || str != "initialized:") + if (!(s >> str) || str != "initialized:") { return false; - if (!(s >> str)) + } + if (!(s >> str)) { return false; - if (str == "YES") + } + if (str == "YES") { initialized = true; - else if (str == "NO") + } + else if (str == "NO") { initialized = false; - else + } + else { return false; + } - if (!(s >> str) || str != "pricing:") + if (!(s >> str) || str != "pricing:") { return false; - if (!(s >> str)) + } + if (!(s >> str)) { return false; - if (str == "PRICING_STEEPEST_EDGE_FLOAT") + } + if (str == "PRICING_STEEPEST_EDGE_FLOAT") { pricing = PRICING_STEEPEST_EDGE_FLOAT; - else if (str == "PRICING_STEEPEST_EDGE_EXACT") + } + else if (str == "PRICING_STEEPEST_EDGE_EXACT") { pricing = PRICING_STEEPEST_EDGE_EXACT; - else if (str == "PRICING_TEXTBOOK") + } + else if (str == "PRICING_TEXTBOOK") { pricing = PRICING_TEXTBOOK; - else + } + else { return false; + } - if (!(s >> str) || str != "status:") + if (!(s >> str) || str != "status:") { return false; + } - if (!(s >> str)) + if (!(s >> str)) { return false; + } - if (str == "UNSATISFIABLE") + if (str == "UNSATISFIABLE") { status = UNSATISFIABLE; - else if (str == "SATISFIABLE") + } + else if (str == "SATISFIABLE") { status = SATISFIABLE; - else if (str == "UNBOUNDED") + } + else if (str == "UNBOUNDED") { status = UNBOUNDED; - else if (str == "OPTIMIZED") + } + else if (str == "OPTIMIZED") { status = OPTIMIZED; - else if (str == "PARTIALLY_SATISFIABLE") + } + else if (str == "PARTIALLY_SATISFIABLE") { status = PARTIALLY_SATISFIABLE; - else + } + else { return false; + } - if (!(s >> str) || str != "tableau") + if (!(s >> str) || str != "tableau") { return false; + } - if (!tableau.ascii_load(s)) + if (!tableau.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "working_cost(") + if (!(s >> str) || str != "working_cost(") { return false; + } dimension_type working_cost_dim; - if (!(s >> working_cost_dim)) + if (!(s >> working_cost_dim)) { return false; + } - if (!(s >> str) || str != ")") + if (!(s >> str) || str != ")") { return false; + } - if (!working_cost.ascii_load(s)) + if (!working_cost.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "base(") + if (!(s >> str) || str != "base(") { return false; + } dimension_type base_size; - if (!(s >> base_size)) + if (!(s >> base_size)) { return false; + } - if (!(s >> str) || str != ")") + if (!(s >> str) || str != ")") { return false; + } for (dimension_type i = 0; i != base_size; ++i) { dimension_type base_value; - if (!(s >> base_value)) + if (!(s >> base_value)) { return false; + } base.push_back(base_value); } - if (!(s >> str) || str != "last_generator") + if (!(s >> str) || str != "last_generator") { return false; + } - if (!last_generator.ascii_load(s)) + if (!last_generator.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "mapping(") + if (!(s >> str) || str != "mapping(") { return false; + } dimension_type mapping_size; - if (!(s >> mapping_size)) + if (!(s >> mapping_size)) { return false; - - if (!(s >> str) || str != ")") + } + if (!(s >> str) || str != ")") { return false; + } // The first `mapping' index is never used, so we initialize // it pushing back a dummy value. - if (tableau.num_columns() != 0) + if (tableau.num_columns() != 0) { mapping.push_back(std::make_pair(0, 0)); + } for (dimension_type i = 1; i < mapping_size; ++i) { dimension_type index; - if (!(s >> index)) + if (!(s >> index)) { return false; + } - if (!(s >> str) || str != "->") + if (!(s >> str) || str != "->") { return false; + } dimension_type first_value; - if (!(s >> first_value)) + if (!(s >> first_value)) { return false; + } - if (!(s >> str) || str != "->") + if (!(s >> str) || str != "->") { return false; + } dimension_type second_value; - if (!(s >> second_value)) + if (!(s >> second_value)) { return false; + } mapping.push_back(std::make_pair(first_value, second_value)); } - if (!(s >> str) || str != "integer_variables") + if (!(s >> str) || str != "integer_variables") { return false; + } - if (!i_variables.ascii_load(s)) + if (!i_variables.ascii_load(s)) { return false; + } PPL_ASSERT(OK()); return true; @@ -2726,8 +2888,9 @@ PPL::IO_Operators::operator<<(std::ostream& s, const MIP_Problem& mip) { s << "Constraints:"; for (MIP_Problem::const_iterator i = mip.constraints_begin(), - i_end = mip.constraints_end(); i != i_end; ++i) + i_end = mip.constraints_end(); i != i_end; ++i) { s << "\n" << *i; + } s << "\nObjective function: " << mip.objective_function() << "\nOptimization mode: " diff -Nru ppl-1.1/src/MIP_Problem_defs.hh ppl-1.2/src/MIP_Problem_defs.hh --- ppl-1.1/src/MIP_Problem_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/MIP_Problem_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* MIP_Problem class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -242,6 +242,7 @@ private: typedef Constraint_Sequence::const_iterator Base; typedef std::iterator_traits Base_Traits; + public: typedef Base_Traits::iterator_category iterator_category; typedef Base_Traits::difference_type difference_type; @@ -298,7 +299,7 @@ private: //! Constructor from a Base iterator. - explicit const_iterator(Base base); + explicit const_iterator(Base b); //! The Base iterator on the Constraint_Sequence. Base itr; diff -Nru ppl-1.1/src/MIP_Problem_inlines.hh ppl-1.2/src/MIP_Problem_inlines.hh --- ppl-1.1/src/MIP_Problem_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/MIP_Problem_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* MIP_Problem class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -60,8 +60,9 @@ i_variables(y.i_variables) { input_cs.reserve(y.input_cs.size()); for (Constraint_Sequence::const_iterator i = y.input_cs.begin(), - i_end = y.input_cs.end(); i != i_end; ++i) + i_end = y.input_cs.end(); i != i_end; ++i) { add_constraint_helper(*(*i)); + } PPL_ASSERT(OK()); } @@ -93,9 +94,10 @@ const dimension_type size = input_cs.size(); if (size == input_cs.capacity()) { const dimension_type max_size = input_cs.max_size(); - if (size == max_size) + if (size == max_size) { throw std::length_error("MIP_Problem::add_constraint(): " "too many constraints"); + } // Use an exponential grow policy to avoid too many reallocations. input_cs.reserve(compute_capacity(size + 1, max_size)); } @@ -111,8 +113,9 @@ // (and will eventually be deleted) by ancestors. for (Constraint_Sequence::const_iterator i = nth_iter(input_cs, inherited_constraints), - i_end = input_cs.end(); i != i_end; ++i) + i_end = input_cs.end(); i != i_end; ++i) { delete *i; + } } @@ -120,8 +123,9 @@ MIP_Problem::set_optimization_mode(const Optimization_Mode mode) { if (opt_mode != mode) { opt_mode = mode; - if (status == UNBOUNDED || status == OPTIMIZED) + if (status == UNBOUNDED || status == OPTIMIZED) { status = SATISFIABLE; + } PPL_ASSERT(OK()); } } @@ -217,8 +221,9 @@ n += input_cs.capacity() * sizeof(Constraint*); for (Constraint_Sequence::const_iterator i = nth_iter(input_cs, inherited_constraints), - i_end = input_cs.end(); i != i_end; ++i) + i_end = input_cs.end(); i != i_end; ++i) { n += ((*i)->total_memory_in_bytes()); + } // Adding the external memory for `base'. n += base.capacity() * sizeof(dimension_type); @@ -233,8 +238,8 @@ } inline -MIP_Problem::const_iterator::const_iterator(Base base) - : itr(base) { +MIP_Problem::const_iterator::const_iterator(Base b) + : itr(b) { } inline MIP_Problem::const_iterator::difference_type diff -Nru ppl-1.1/src/MIP_Problem_templates.hh ppl-1.2/src/MIP_Problem_templates.hh --- ppl-1.1/src/MIP_Problem_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/MIP_Problem_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* MIP_Problem class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -63,11 +63,12 @@ } // Check for space dimension overflow. - if (dim > max_space_dimension()) + if (dim > max_space_dimension()) { throw std::length_error("PPL::MIP_Problem:: MIP_Problem(dim, first, " "last, int_vars, obj, mode):\n" "dim exceeds the maximum allowed" "space dimension."); + } // Check the objective function. if (obj.space_dimension() > dim) { std::ostringstream s; @@ -80,11 +81,12 @@ // Check the constraints. try { for (In i = first; i != last; ++i) { - if (i->is_strict_inequality()) + if (i->is_strict_inequality()) { throw std::invalid_argument("PPL::MIP_Problem::" "MIP_Problem(dim, first, last, int_vars," "obj, mode):\nrange [first, last) contains" "a strict inequality constraint."); + } if (i->space_dimension() > dim) { std::ostringstream s; s << "PPL::MIP_Problem::" @@ -100,8 +102,10 @@ // Delete the allocated constraints, to avoid memory leaks. for (Constraint_Sequence::const_iterator - i = input_cs.begin(), i_end = input_cs.end(); i != i_end; ++i) + i = input_cs.begin(), i_end = input_cs.end(); + i != i_end; ++i) { delete *i; + } throw; } @@ -130,11 +134,12 @@ last_generator(point()), i_variables() { // Check for space dimension overflow. - if (dim > max_space_dimension()) + if (dim > max_space_dimension()) { throw std::length_error("PPL::MIP_Problem::" "MIP_Problem(dim, first, last, obj, mode):\n" "dim exceeds the maximum allowed space " "dimension."); + } // Check the objective function. if (obj.space_dimension() > dim) { std::ostringstream s; @@ -147,12 +152,13 @@ // Check the constraints. try { for (In i = first; i != last; ++i) { - if (i->is_strict_inequality()) + if (i->is_strict_inequality()) { throw std::invalid_argument("PPL::MIP_Problem::" "MIP_Problem(dim, first, last, obj, mode):" "\n" "range [first, last) contains a strict " "inequality constraint."); + } if (i->space_dimension() > dim) { std::ostringstream s; s << "PPL::MIP_Problem::" @@ -168,8 +174,10 @@ // Delete the allocated constraints, to avoid memory leaks. for (Constraint_Sequence::const_iterator - i = input_cs.begin(), i_end = input_cs.end(); i != i_end; ++i) + i = input_cs.begin(), i_end = input_cs.end(); + i != i_end; ++i) { delete *i; + } throw; } diff -Nru ppl-1.1/src/MIP_Problem_types.hh ppl-1.2/src/MIP_Problem_types.hh --- ppl-1.1/src/MIP_Problem_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/MIP_Problem_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/mp_std_bits.cc ppl-1.2/src/mp_std_bits.cc --- ppl-1.1/src/mp_std_bits.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/mp_std_bits.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Definitions of specializations of std::numeric_limits objects for multi-precision types. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/mp_std_bits_defs.hh ppl-1.2/src/mp_std_bits_defs.hh --- ppl-1.1/src/mp_std_bits_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/mp_std_bits_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declarations of specializations of std:: objects for multi-precision types. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/mp_std_bits_inlines.hh ppl-1.2/src/mp_std_bits_inlines.hh --- ppl-1.1/src/mp_std_bits_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/mp_std_bits_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Definitions of specializations of std:: functions and methods for multi-precision types. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Multiplication_Floating_Point_Expression_defs.hh ppl-1.2/src/Multiplication_Floating_Point_Expression_defs.hh --- ppl-1.1/src/Multiplication_Floating_Point_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Multiplication_Floating_Point_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declarations for the Multiplication_Floating_Point_Expression class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Multiplication_Floating_Point_Expression_inlines.hh ppl-1.2/src/Multiplication_Floating_Point_Expression_inlines.hh --- ppl-1.1/src/Multiplication_Floating_Point_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Multiplication_Floating_Point_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Multiplication_Floating_Point_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Multiplication_Floating_Point_Expression_templates.hh ppl-1.2/src/Multiplication_Floating_Point_Expression_templates.hh --- ppl-1.1/src/Multiplication_Floating_Point_Expression_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Multiplication_Floating_Point_Expression_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Multiplication_Floating_Point_Expression class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -48,15 +48,17 @@ bool intervalize_first; FP_Linear_Form linearized_first_operand; if (!first_operand->linearize(int_store, lf_store, - linearized_first_operand)) + linearized_first_operand)) { return false; + } FP_Interval_Type intervalized_first_operand; this->intervalize(linearized_first_operand, int_store, intervalized_first_operand); FP_Linear_Form linearized_second_operand; if (!second_operand->linearize(int_store, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } FP_Interval_Type intervalized_second_operand; this->intervalize(linearized_second_operand, int_store, intervalized_second_operand); @@ -70,19 +72,24 @@ boundary_type second_interval_size = intervalized_second_operand.upper() - intervalized_second_operand.lower(); - if (first_interval_size <= second_interval_size) + if (first_interval_size <= second_interval_size) { intervalize_first = true; - else + } + else { intervalize_first = false; + } } - else + else { intervalize_first = true; + } } else { - if (intervalized_second_operand.is_bounded()) + if (intervalized_second_operand.is_bounded()) { intervalize_first = false; - else + } + else { return false; + } } // Here we do the actual computation. diff -Nru ppl-1.1/src/Multiplication_Floating_Point_Expression_types.hh ppl-1.2/src/Multiplication_Floating_Point_Expression_types.hh --- ppl-1.1/src/Multiplication_Floating_Point_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Multiplication_Floating_Point_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/namespaces.hh ppl-1.2/src/namespaces.hh --- ppl-1.1/src/namespaces.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/namespaces.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Documentation for used namespaces. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/NNC_Polyhedron.cc ppl-1.2/src/NNC_Polyhedron.cc --- ppl-1.1/src/NNC_Polyhedron.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/NNC_Polyhedron.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* NNC_Polyhedron class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -78,8 +78,9 @@ #define USE_BHZ09 1 #if USE_BHZ09 // [BagnaraHZ09] // Dimension-compatibility check. - if (space_dimension() != y.space_dimension()) + if (space_dimension() != y.space_dimension()) { throw_dimension_incompatible("poly_hull_assign_if_exact(y)", "y", y); + } return BHZ09_poly_hull_assign_if_exact(y); #else // Old implementation. return PPL::poly_hull_assign_if_exact(*this, y); diff -Nru ppl-1.1/src/NNC_Polyhedron_defs.hh ppl-1.2/src/NNC_Polyhedron_defs.hh --- ppl-1.1/src/NNC_Polyhedron_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/NNC_Polyhedron_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* NNC_Polyhedron class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,8 +24,8 @@ #ifndef PPL_NNC_Polyhedron_defs_hh #define PPL_NNC_Polyhedron_defs_hh 1 -#include "C_Polyhedron_types.hh" #include "NNC_Polyhedron_types.hh" +#include "C_Polyhedron_types.hh" #include "Polyhedron_defs.hh" #include "Grid_types.hh" diff -Nru ppl-1.1/src/NNC_Polyhedron_inlines.hh ppl-1.2/src/NNC_Polyhedron_inlines.hh --- ppl-1.1/src/NNC_Polyhedron_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/NNC_Polyhedron_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* NNC_Polyhedron class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/NNC_Polyhedron_types.hh ppl-1.2/src/NNC_Polyhedron_types.hh --- ppl-1.1/src/NNC_Polyhedron_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/NNC_Polyhedron_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Numeric_Format_defs.hh ppl-1.2/src/Numeric_Format_defs.hh --- ppl-1.1/src/Numeric_Format_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Numeric_Format_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Numeric format. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Octagonal_Shape.cc ppl-1.2/src/Octagonal_Shape.cc --- ppl-1.1/src/Octagonal_Shape.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Octagonal_Shape.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Octagonal_Shape class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -63,8 +63,9 @@ c_second_var = c_first_var; ++c_first_var; } - else + else { c_second_var = c_first_var + 1; + } c_coeff = c0; return true; } @@ -72,8 +73,9 @@ ++c_num_vars; --c_second_var; - if (!c.expression().all_zeroes(c_second_var + 2, c_space_dim + 1)) + if (!c.expression().all_zeroes(c_second_var + 2, c_space_dim + 1)) { return false; + } using std::swap; @@ -87,18 +89,19 @@ c_term = c.inhomogeneous_term(); const Coefficient& c0 = c.coefficient(Variable(c_first_var)); const Coefficient& c1 = c.coefficient(Variable(c_second_var)); - if (c0 != c1 && c0 != -c1) + if (c0 != c1 && c0 != -c1) { // Constraint `c' is not an octagonal difference. return false; - + } c_first_var *= 2; c_second_var *= 2; - if (sgn(c0) < 0) + if (sgn(c0) < 0) { ++c_first_var; - if (sgn(c1) > 0) + } + if (sgn(c1) > 0) { ++c_second_var; + } c_coeff = c0; - + return true; } - diff -Nru ppl-1.1/src/Octagonal_Shape_defs.hh ppl-1.2/src/Octagonal_Shape_defs.hh --- ppl-1.1/src/Octagonal_Shape_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Octagonal_Shape_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Octagonal_Shape class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -1887,20 +1887,26 @@ operator==(const Octagonal_Shape& x, const Octagonal_Shape& y); template - friend bool Parma_Polyhedra_Library::rectilinear_distance_assign - (Checked_Number& r, - const Octagonal_Shape& x, const Octagonal_Shape& y, - const Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::rectilinear_distance_assign(Checked_Number& r, + const Octagonal_Shape& x, + const Octagonal_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); template - friend bool Parma_Polyhedra_Library::euclidean_distance_assign - (Checked_Number& r, - const Octagonal_Shape& x, const Octagonal_Shape& y, - const Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::euclidean_distance_assign(Checked_Number& r, + const Octagonal_Shape& x, + const Octagonal_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); template - friend bool Parma_Polyhedra_Library::l_infinity_distance_assign - (Checked_Number& r, - const Octagonal_Shape& x, const Octagonal_Shape& y, - const Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::l_infinity_distance_assign(Checked_Number& r, + const Octagonal_Shape& x, + const Octagonal_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); private: template friend class Parma_Polyhedra_Library::Octagonal_Shape; diff -Nru ppl-1.1/src/Octagonal_Shape_inlines.hh ppl-1.2/src/Octagonal_Shape_inlines.hh --- ppl-1.1/src/Octagonal_Shape_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Octagonal_Shape_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Octagonal_Shape class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -32,7 +32,7 @@ #include "Poly_Con_Relation_defs.hh" #include "Poly_Gen_Relation_defs.hh" #include "wrap_assign.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace Parma_Polyhedra_Library { @@ -107,11 +107,13 @@ Octagonal_Shape::Octagonal_Shape(const dimension_type num_dimensions, const Degenerate_Element kind) : matrix(num_dimensions), space_dim(num_dimensions), status() { - if (kind == EMPTY) + if (kind == EMPTY) { set_empty(); - else if (num_dimensions > 0) + } + else if (num_dimensions > 0) { // A (non zero-dim) universe octagon is strongly closed. set_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -132,10 +134,12 @@ space_dim(y.space_dim), status() { // TODO: handle flags properly, possibly taking special cases into account. - if (y.marked_empty()) + if (y.marked_empty()) { set_empty(); - else if (y.marked_zero_dim_univ()) + } + else if (y.marked_zero_dim_univ()) { set_zero_dim_univ(); + } } template @@ -144,9 +148,10 @@ : matrix(cs.space_dimension()), space_dim(cs.space_dimension()), status() { - if (cs.space_dimension() > 0) + if (cs.space_dimension() > 0) { // A (non zero-dim) universe octagon is strongly closed. set_strongly_closed(); + } add_constraints(cs); } @@ -156,9 +161,10 @@ : matrix(cgs.space_dimension()), space_dim(cgs.space_dimension()), status() { - if (cgs.space_dimension() > 0) + if (cgs.space_dimension() > 0) { // A (non zero-dim) universe octagon is strongly closed. set_strongly_closed(); + } add_congruences(cgs); } @@ -171,8 +177,9 @@ space_dim(box.space_dimension()), status() { // Check for emptiness for maximum precision. - if (box.is_empty()) + if (box.is_empty()) { set_empty(); + } else if (box.space_dimension() > 0) { // A (non zero-dim) universe OS is strongly closed. set_strongly_closed(); @@ -187,9 +194,10 @@ : matrix(grid.space_dimension()), space_dim(grid.space_dimension()), status() { - if (grid.space_dimension() > 0) + if (grid.space_dimension() > 0) { // A (non zero-dim) universe OS is strongly closed. set_strongly_closed(); + } // Taking minimized congruences ensures maximum precision. refine_with_congruences(grid.minimized_congruences()); } @@ -203,8 +211,9 @@ space_dim(bd.space_dimension()), status() { // Check for emptiness for maximum precision. - if (bd.is_empty()) + if (bd.is_empty()) { set_empty(); + } else if (bd.space_dimension() > 0) { // A (non zero-dim) universe OS is strongly closed. set_strongly_closed(); @@ -321,26 +330,30 @@ template inline bool operator==(const Octagonal_Shape& x, const Octagonal_Shape& y) { - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { // Dimension-incompatible OSs are different. return false; - + } // Zero-dim OSs are equal if and only if they are both empty or universe. if (x.space_dim == 0) { - if (x.marked_empty()) + if (x.marked_empty()) { return y.marked_empty(); - else + } + else { return !y.marked_empty(); + } } x.strong_closure_assign(); y.strong_closure_assign(); // If one of two octagons is empty, then they are equal if and only if // the other octagon is empty too. - if (x.marked_empty()) + if (x.marked_empty()) { return y.marked_empty(); - if (y.marked_empty()) + } + if (y.marked_empty()) { return false; + } // Strong closure is a canonical form. return x.matrix == y.matrix; } @@ -395,8 +408,9 @@ N& r_i_j = matrix[i][j]; if (r_i_j > k) { r_i_j = k; - if (marked_strongly_closed()) + if (marked_strongly_closed()) { reset_strongly_closed(); + } } } @@ -423,8 +437,9 @@ inline void Octagonal_Shape::add_constraints(const Constraint_System& cs) { for (Constraint_System::const_iterator i = cs.begin(), - i_end = cs.end(); i != i_end; ++i) + i_end = cs.end(); i != i_end; ++i) { add_constraint(*i); + } } template @@ -443,32 +458,37 @@ inline void Octagonal_Shape::add_congruences(const Congruence_System& cgs) { for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); i != cgs_end; ++i) + cgs_end = cgs.end(); i != cgs_end; ++i) { add_congruence(*i); + } } template inline void Octagonal_Shape::refine_with_constraint(const Constraint& c) { // Dimension-compatibility check. - if (c.space_dimension() > space_dimension()) + if (c.space_dimension() > space_dimension()) { throw_dimension_incompatible("refine_with_constraint(c)", c); + } - if (!marked_empty()) + if (!marked_empty()) { refine_no_check(c); + } } template inline void Octagonal_Shape::refine_with_constraints(const Constraint_System& cs) { // Dimension-compatibility check. - if (cs.space_dimension() > space_dimension()) + if (cs.space_dimension() > space_dimension()) { throw_invalid_argument("refine_with_constraints(cs)", "cs and *this are space-dimension incompatible"); + } for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) + cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) { refine_no_check(*i); + } } template @@ -476,24 +496,27 @@ Octagonal_Shape::refine_with_congruence(const Congruence& cg) { const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dimension()) + if (cg_space_dim > space_dimension()) { throw_dimension_incompatible("refine_with_congruence(cg)", cg); - - if (!marked_empty()) + } + if (!marked_empty()) { refine_no_check(cg); + } } template void Octagonal_Shape::refine_with_congruences(const Congruence_System& cgs) { // Dimension-compatibility check. - if (cgs.space_dimension() > space_dimension()) + if (cgs.space_dimension() > space_dimension()) { throw_invalid_argument("refine_with_congruences(cgs)", "cgs and *this are space-dimension incompatible"); + } for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) + cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) { refine_no_check(*i); + } } template @@ -503,8 +526,9 @@ PPL_ASSERT(cg.space_dimension() <= space_dimension()); if (cg.is_proper_congruence()) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { set_empty(); + } // Other proper congruences are just ignored. return; } @@ -531,9 +555,10 @@ Octagonal_Shape ::remove_higher_space_dimensions(const dimension_type new_dimension) { // Dimension-compatibility check. - if (new_dimension > space_dim) + if (new_dimension > space_dim) { throw_dimension_incompatible("remove_higher_space_dimension(nd)", new_dimension); + } // The removal of no dimensions from any octagon is a no-op. // Note that this case also captures the only legal removal of // dimensions from an octagon in a 0-dim space. @@ -546,8 +571,9 @@ matrix.shrink(new_dimension); // When we remove all dimensions from a non-empty octagon, // we obtain the zero-dimensional universe octagon. - if (new_dimension == 0 && !marked_empty()) + if (new_dimension == 0 && !marked_empty()) { set_zero_dim_univ(); + } space_dim = new_dimension; PPL_ASSERT(OK()); } @@ -595,8 +621,9 @@ inline void Octagonal_Shape::time_elapse_assign(const Octagonal_Shape& y) { // Dimension-compatibility check. - if (space_dimension() != y.space_dimension()) + if (space_dimension() != y.space_dimension()) { throw_dimension_incompatible("time_elapse_assign(y)", y); + } // Compute time-elapse on polyhedra. // TODO: provide a direct implementation. C_Polyhedron ph_x(constraints()); @@ -671,15 +698,17 @@ Temp& tmp1, Temp& tmp2) { // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { return false; - + } // Zero-dim OSs are equal if and only if they are both empty or universe. if (x.space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -690,10 +719,12 @@ // If one of two OSs is empty, then they are equal if and only if // the other OS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -736,15 +767,18 @@ Temp& tmp1, Temp& tmp2) { // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { return false; + } // Zero-dim OSs are equal if and only if they are both empty or universe. if (x.space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -755,10 +789,12 @@ // If one of two OSs is empty, then they are equal if and only if // the other OS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -801,15 +837,17 @@ Temp& tmp1, Temp& tmp2) { // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { return false; - + } // Zero-dim OSs are equal if and only if they are both empty or universe. if (x.space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -820,10 +858,12 @@ // If one of two OSs is empty, then they are equal if and only if // the other OS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } diff -Nru ppl-1.1/src/Octagonal_Shape_templates.hh ppl-1.2/src/Octagonal_Shape_templates.hh --- ppl-1.1/src/Octagonal_Shape_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Octagonal_Shape_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Octagonal_Shape class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -31,7 +31,7 @@ #include "Interval_defs.hh" #include "Linear_Form_defs.hh" #include "meta_programming.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -82,11 +82,12 @@ // See if there is at least one inconsistent constraint in `ph.con_sys'. for (Constraint_System::const_iterator i = ph.con_sys.begin(), - cs_end = ph.con_sys.end(); i != cs_end; ++i) + cs_end = ph.con_sys.end(); i != cs_end; ++i) { if (i->is_inconsistent()) { *this = Octagonal_Shape(num_dimensions, EMPTY); return; } + } // If `complexity' allows it, use simplex to derive the exact (modulo // the fact that our OSs are topologically closed) variable bounds. @@ -95,9 +96,10 @@ lp.set_optimization_mode(MAXIMIZATION); const Constraint_System& ph_cs = ph.constraints(); - if (!ph_cs.has_strict_inequalities()) + if (!ph_cs.has_strict_inequalities()) { lp.add_constraints(ph_cs); - else + } + else { // Adding to `lp' a topologically closed version of `ph_cs'. for (Constraint_System::const_iterator i = ph_cs.begin(), ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) { @@ -106,9 +108,11 @@ Linear_Expression expr(c.expression()); lp.add_constraint(expr >= 0); } - else + else { lp.add_constraint(c); + } } + } // Check for unsatisfiability. if (!lp.is_satisfiable()) { @@ -144,8 +148,9 @@ } // Evaluate optimal upper bound for `x - y <= ub'. for (dimension_type j = 0; j < num_dimensions; ++j) { - if (i == j) + if (i == j) { continue; + } Variable y(j); lp.set_objective_function(x - y); if (lp.solve() == OPTIMIZED_MIP_PROBLEM) { @@ -159,8 +164,9 @@ } // Evaluate optimal upper bound for `y - x <= ub'. for (dimension_type j = 0; j < num_dimensions; ++j) { - if (i == j) + if (i == j) { continue; + } Variable y(j); lp.set_objective_function(x - y); if (lp.solve() == OPTIMIZED_MIP_PROBLEM) { @@ -302,11 +308,12 @@ } } - if (!point_seen) + if (!point_seen) { // The generator system is not empty, but contains no points. throw_invalid_argument("Octagonal_Shape(gs)", "the non-empty generator system gs " "contains no points."); + } // Going through all the lines and rays. for (Generator_System::const_iterator k = gs_begin; k != gs_end; ++k) { @@ -357,26 +364,32 @@ const dimension_type dj = 2*j; // Set for any ray the right limit in the case // of the binary constraints. - if (g_i < g_j) + if (g_i < g_j) { // Hyperplane: X_i - X_j >= +Inf. assign_r(x_i[dj], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i > g_j) + } + if (g_i > g_j) { // Hyperplane: X_i - X_j <= +Inf. assign_r(x_ii[dj + 1], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i < -g_j) + } + if (g_i < -g_j) { // Hyperplane: X_i + X_j >= +Inf. assign_r(x_i[dj + 1], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i > -g_j) + } + if (g_i > -g_j) { // Hyperplane: X_i + X_j <= +Inf. assign_r(x_ii[dj], PLUS_INFINITY, ROUND_NOT_NEEDED); + } } // Case: unary constraints. - if (g_i < 0) + if (g_i < 0) { // Hyperplane: X_i = +Inf. assign_r(x_i[di + 1], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i > 0) + } + if (g_i > 0) { // Hyperplane: X_i = +Inf. assign_r(x_ii[di], PLUS_INFINITY, ROUND_NOT_NEEDED); + } } break; default: @@ -393,17 +406,18 @@ Octagonal_Shape::add_constraint(const Constraint& c) { const dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dim) + if (c_space_dim > space_dim) { throw_dimension_incompatible("add_constraint(c)", c); - + } // Get rid of strict inequalities. if (c.is_strict_inequality()) { if (c.is_inconsistent()) { set_empty(); return; } - if (c.is_tautological()) + if (c.is_tautological()) { return; + } // Nontrivial strict inequalities are not allowed. throw_invalid_argument("add_constraint(c)", "strict inequalities are not allowed"); @@ -417,15 +431,17 @@ // Constraints that are not octagonal differences are not allowed. if (!Octagonal_Shape_Helper ::extract_octagonal_difference(c, c_space_dim, num_vars, - i, j, coeff, term)) + i, j, coeff, term)) { throw_invalid_argument("add_constraint(c)", "c is not an octagonal constraint"); + } if (num_vars == 0) { // Dealing with a trivial constraint (not a strict inequality). if (c.inhomogeneous_term() < 0 - || (c.is_equality() && c.inhomogeneous_term() != 0)) + || (c.is_equality() && c.inhomogeneous_term() != 0)) { set_empty(); + } return; } @@ -434,8 +450,9 @@ typename OR_Matrix::row_reference_type m_i = *i_iter; N& m_i_j = m_i[j]; // Set `coeff' to the absolute value of itself. - if (coeff < 0) + if (coeff < 0) { neg_assign(coeff); + } bool is_oct_changed = false; // Compute the bound for `m_i_j', rounding towards plus infinity. @@ -448,10 +465,12 @@ if (c.is_equality()) { // Select the cell to be modified for the ">=" part of constraint. - if (i % 2 == 0) + if (i % 2 == 0) { ++i_iter; - else + } + else { --i_iter; + } typename OR_Matrix::row_reference_type m_ci = *i_iter; using namespace Implementation::Octagonal_Shapes; @@ -467,8 +486,9 @@ } // This method does not preserve closure. - if (is_oct_changed && marked_strongly_closed()) + if (is_oct_changed && marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -478,13 +498,15 @@ const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check: // the dimension of `cg' can not be greater than space_dim. - if (space_dimension() < cg_space_dim) + if (space_dimension() < cg_space_dim) { throw_dimension_incompatible("add_congruence(cg)", cg); + } // Handle the case of proper congruences first. if (cg.is_proper_congruence()) { - if (cg.is_tautological()) + if (cg.is_tautological()) { return; + } if (cg.is_inconsistent()) { set_empty(); return; @@ -518,15 +540,16 @@ // The dimensions of `left' and `right' should not be greater than the // dimension of `*this'. const dimension_type left_space_dim = left.space_dimension(); - if (space_dim < left_space_dim) + if (space_dim < left_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(left, right)", "left", left); + } const dimension_type right_space_dim = right.space_dimension(); - if (space_dim < right_space_dim) + if (space_dim < right_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(left, right)", "right", right); - + } // Number of non-zero coefficients in `left': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type left_t = 0; @@ -539,27 +562,31 @@ dimension_type right_w_id = 0; // Get information about the number of non-zero coefficients in `left'. - for (dimension_type i = left_space_dim; i-- > 0; ) + for (dimension_type i = left_space_dim; i-- > 0; ) { if (left.coefficient(Variable(i)) != 0) { - if (left_t++ == 1) + if (left_t++ == 1) { break; - else + } + else { left_w_id = i; + } } + } // Get information about the number of non-zero coefficients in `right'. - for (dimension_type i = right_space_dim; i-- > 0; ) + for (dimension_type i = right_space_dim; i-- > 0; ) { if (right.coefficient(Variable(i)) != 0) { - if (right_t++ == 1) + if (right_t++ == 1) { break; - else + } + else { right_w_id = i; + } } + } typedef typename OR_Matrix::row_iterator row_iterator; typedef typename OR_Matrix::row_reference_type row_reference; - typedef typename OR_Matrix::const_row_iterator Row_iterator; - typedef typename OR_Matrix::const_row_reference_type Row_reference; typedef Interval FP_Interval_Type; // FIXME: there is plenty of duplicate code in the following lines. We could @@ -697,11 +724,13 @@ const FP_Interval_Type& right_c = right.inhomogeneous_term(); sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(), ROUND_UP); - if (left_w_id < right_w_id) + if (left_w_id < right_w_id) { add_octagonal_constraint(n_right, n_left, c_plus_minus_a_minus); - else + } + else { add_octagonal_constraint(n_left + 1, n_right + 1, c_plus_minus_a_minus); + } PPL_ASSERT(OK()); return; } @@ -713,10 +742,12 @@ const FP_Interval_Type& right_c = right.inhomogeneous_term(); sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(), ROUND_UP); - if (left_w_id < right_w_id) + if (left_w_id < right_w_id) { add_octagonal_constraint(n_right + 1, n_left, c_plus_minus_a_minus); - else + } + else { add_octagonal_constraint(n_left + 1, n_right, c_plus_minus_a_minus); + } PPL_ASSERT(OK()); return; } @@ -728,10 +759,12 @@ const FP_Interval_Type& right_c = right.inhomogeneous_term(); sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(), ROUND_UP); - if (left_w_id < right_w_id) + if (left_w_id < right_w_id) { add_octagonal_constraint(n_right, n_left + 1, c_plus_minus_a_minus); - else + } + else { add_octagonal_constraint(n_left, n_right + 1, c_plus_minus_a_minus); + } PPL_ASSERT(OK()); return; } @@ -743,11 +776,13 @@ const FP_Interval_Type& right_c = right.inhomogeneous_term(); sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(), ROUND_UP); - if (left_w_id < right_w_id) + if (left_w_id < right_w_id) { add_octagonal_constraint(n_right + 1, n_left + 1, c_plus_minus_a_minus); - else + } + else { add_octagonal_constraint(n_left, n_right, c_plus_minus_a_minus); + } PPL_ASSERT(OK()); return; } @@ -787,13 +822,15 @@ if (low_coeff != 0 || high_coeff != 0) { assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } } else { @@ -802,13 +839,15 @@ if (low_coeff != 0 || high_coeff != 0) { assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } } } @@ -846,13 +885,15 @@ bool do_update = false; assign_r(low_coeff, lv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } if (do_update) { @@ -908,16 +949,18 @@ // Constraints that are not octagonal differences are ignored. if (!Octagonal_Shape_Helper ::extract_octagonal_difference(c, c_space_dim, num_vars, - i, j, coeff, term)) + i, j, coeff, term)) { return; + } if (num_vars == 0) { const Coefficient& c_inhomo = c.inhomogeneous_term(); // Dealing with a trivial constraint (maybe a strict inequality). if (c_inhomo < 0 || (c_inhomo != 0 && c.is_equality()) - || (c_inhomo == 0 && c.is_strict_inequality())) + || (c_inhomo == 0 && c.is_strict_inequality())) { set_empty(); + } return; } @@ -926,8 +969,9 @@ typename OR_Matrix::row_reference_type m_i = *i_iter; N& m_i_j = m_i[j]; // Set `coeff' to the absolute value of itself. - if (coeff < 0) + if (coeff < 0) { neg_assign(coeff); + } bool is_oct_changed = false; // Compute the bound for `m_i_j', rounding towards plus infinity. @@ -940,10 +984,12 @@ if (c.is_equality()) { // Select the cell to be modified for the ">=" part of constraint. - if (i % 2 == 0) + if (i % 2 == 0) { ++i_iter; - else + } + else { --i_iter; + } typename OR_Matrix::row_reference_type m_ci = *i_iter; using namespace Implementation::Octagonal_Shapes; @@ -959,8 +1005,9 @@ } // This method does not preserve closure. - if (is_oct_changed && marked_strongly_closed()) + if (is_oct_changed && marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -969,14 +1016,16 @@ Octagonal_Shape::affine_dimension() const { const dimension_type n_rows = matrix.num_rows(); // A zero-space-dim shape always has affine dimension zero. - if (n_rows == 0) + if (n_rows == 0) { return 0; + } // Strong closure is necessary to detect emptiness // and all (possibly implicit) equalities. strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return 0; + } // The vector `leaders' is used to represent non-singular // equivalence classes: @@ -988,10 +1037,12 @@ // Due to the splitting of variables, the affine dimension is the // number of non-singular positive zero-equivalence classes. dimension_type affine_dim = 0; - for (dimension_type i = 0; i < n_rows; i += 2) + for (dimension_type i = 0; i < n_rows; i += 2) { // Note: disregard the singular equivalence class. - if (leaders[i] == i && leaders[i + 1] == i + 1) + if (leaders[i] == i && leaders[i + 1] == i + 1) { ++affine_dim; + } + } return affine_dim; } @@ -1002,12 +1053,12 @@ // Strong closure is necessary to detect emptiness // and all (possibly implicit) equalities. strong_closure_assign(); - const dimension_type space_dim = space_dimension(); Congruence_System cgs(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cgs = Congruence_System::zero_dim_empty(); + } return cgs; } @@ -1027,21 +1078,25 @@ for (dimension_type i = 0, i_end = 2*space_dim; i != i_end; i += 2) { const dimension_type lead_i = leaders[i]; if (i == lead_i) { - if (leaders[i + 1] == i) + if (leaders[i + 1] == i) { // `i' is the leader of the singular equivalence class. goto singular; - else + } + else { // `i' is the leader of a non-singular equivalence class. continue; + } } else { // `i' is not a leader. - if (leaders[i + 1] == lead_i) + if (leaders[i + 1] == lead_i) { // `i' belongs to the singular equivalence class. goto singular; - else + } + else { // `i' does not belong to the singular equivalence class. goto non_singular; + } } singular: @@ -1073,10 +1128,12 @@ const Variable x(lead_i/2); const Variable y(i/2); numer_denom(c_i_li, numer, denom); - if (lead_i % 2 == 0) + if (lead_i % 2 == 0) { cgs.insert(denom*x - denom*y == numer); - else + } + else { cgs.insert(denom*x + denom*y + numer == 0); + } } continue; } @@ -1089,8 +1146,9 @@ // If `y' is an empty 0-dim space octagon, let `*this' become empty. // If `y' is an universal 0-dim space octagon, we simply return. if (y.space_dim == 0) { - if (y.marked_empty()) + if (y.marked_empty()) { set_empty(); + } return; } @@ -1118,13 +1176,15 @@ matrix_row_end = matrix.row_end(); i != matrix_row_end; ++i) { typename OR_Matrix::row_reference_type r = *i; dimension_type rs_i = i.row_size(); - for (dimension_type j = old_num_rows; j < rs_i; ++j, ++y_it) + for (dimension_type j = old_num_rows; j < rs_i; ++j, ++y_it) { r[j] = *y_it; + } } // The concatenation does not preserve the closure. - if (marked_strongly_closed()) + if (marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -1132,8 +1192,9 @@ bool Octagonal_Shape::contains(const Octagonal_Shape& y) const { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("contains(y)", y); + } if (space_dim == 0) { // The zero-dimensional empty octagon only contains another @@ -1146,21 +1207,25 @@ // `y' needs to be transitively closed. y.strong_closure_assign(); // An empty octagon is in any other dimension-compatible octagons. - if (y.marked_empty()) + if (y.marked_empty()) { return true; + } // If `*this' is empty it can not contain `y' (which is not empty). - if (is_empty()) + if (is_empty()) { return false; + } // `*this' contains `y' if and only if every element of `*this' // is greater than or equal to the correspondent one of `y'. for (typename OR_Matrix::const_element_iterator i = matrix.element_begin(), j = y.matrix.element_begin(), matrix_element_end = matrix.element_end(); - i != matrix_element_end; ++i, ++j) - if (*i < *j) + i != matrix_element_end; ++i, ++j) { + if (*i < *j) { return false; + } + } return true; } @@ -1168,16 +1233,19 @@ bool Octagonal_Shape::is_disjoint_from(const Octagonal_Shape& y) const { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("is_disjoint_from(y)", y); + } // If one Octagonal_Shape is empty, the Octagonal_Shapes are disjoint. strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return true; + } y.strong_closure_assign(); - if (y.marked_empty()) + if (y.marked_empty()) { return true; + } // Two Octagonal_Shapes are disjoint if and only if their // intersection is empty, i.e., if and only if there exists a @@ -1211,8 +1279,9 @@ row_reference y_j = *(y_begin + j); const N& y_ci_cj = (j < rs_i) ? y_ci[cj] : y_j[i]; neg_assign_r(neg_y_ci_cj, y_ci_cj, ROUND_UP); - if (m_i_j < neg_y_ci_cj) + if (m_i_j < neg_y_ci_cj) { return true; + } } } return false; @@ -1222,21 +1291,25 @@ bool Octagonal_Shape::is_universe() const { // An empty octagon is not universe. - if (marked_empty()) + if (marked_empty()) { return false; + } // If the octagon is non-empty and zero-dimensional, // then it is necessarily the universe octagon. - if (space_dim == 0) + if (space_dim == 0) { return true; + } // An universe octagon can only contains trivial constraints. for (typename OR_Matrix::const_element_iterator i = matrix.element_begin(), matrix_element_end = matrix.element_end(); i != matrix_element_end; - ++i) - if (!is_plus_infinity(*i)) + ++i) { + if (!is_plus_infinity(*i)) { return false; + } + } return true; } @@ -1246,18 +1319,22 @@ Octagonal_Shape::is_bounded() const { strong_closure_assign(); // A zero-dimensional or empty octagon is bounded. - if (marked_empty() || space_dim == 0) + if (marked_empty() || space_dim == 0) { return true; + } // A bounded octagon never can contains trivial constraints. for (typename OR_Matrix::const_row_iterator i = matrix.row_begin(), matrix_row_end = matrix.row_end(); i != matrix_row_end; ++i) { typename OR_Matrix::const_row_reference_type x_i = *i; const dimension_type i_index = i.index(); - for (dimension_type j = i.row_size(); j-- > 0; ) - if (i_index != j) - if (is_plus_infinity(x_i[j])) + for (dimension_type j = i.row_size(); j-- > 0; ) { + if (i_index != j) { + if (is_plus_infinity(x_i[j])) { return false; + } + } + } } return true; @@ -1267,16 +1344,17 @@ bool Octagonal_Shape::contains_integer_point() const { // Force strong closure. - if (is_empty()) + if (is_empty()) { return false; - const dimension_type space_dim = space_dimension(); - if (space_dim == 0) + } + if (space_dim == 0) { return true; - + } // A strongly closed and consistent Octagonal_Shape defined by // integer constraints can only be empty due to tight coherence. - if (std::numeric_limits::is_integer) + if (std::numeric_limits::is_integer) { return !tight_coherence_would_make_empty(); + } // Build an integer Octagonal_Shape oct_z with bounds at least as // tight as those in *this and then recheck for emptiness, also @@ -1291,24 +1369,28 @@ z_i = oct_z.matrix.element_begin(), z_end = oct_z.matrix.element_end(); z_i != z_end; ++z_i, ++x_i) { const N& d = *x_i; - if (is_plus_infinity(d)) + if (is_plus_infinity(d)) { continue; - if (is_integer(d)) + } + if (is_integer(d)) { assign_r(*z_i, d, ROUND_NOT_NEEDED); + } else { all_integers = false; assign_r(*z_i, d, ROUND_DOWN); } } // Restore strong closure. - if (all_integers) + if (all_integers) { // oct_z unchanged, so it is still strongly closed. oct_z.set_strongly_closed(); + } else { // oct_z changed: recompute strong closure. oct_z.strong_closure_assign(); - if (oct_z.marked_empty()) + if (oct_z.marked_empty()) { return false; + } } return !oct_z.tight_coherence_would_make_empty(); } @@ -1318,10 +1400,10 @@ Octagonal_Shape::frequency(const Linear_Expression& expr, Coefficient& freq_n, Coefficient& freq_d, Coefficient& val_n, Coefficient& val_d) const { - dimension_type space_dim = space_dimension(); // The dimension of `expr' must be at most the dimension of *this. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("frequency(e, ...)", "e", expr); + } // Check if `expr' has a constant value. // If it is constant, set the frequency `freq_n' to 0 @@ -1331,8 +1413,9 @@ // Space dimension is 0: if empty, then return false; // otherwise the frequency is 0 and the value is the inhomogeneous term. if (space_dim == 0) { - if (is_empty()) + if (is_empty()) { return false; + } freq_n = 0; freq_d = 1; val_n = expr.inhomogeneous_term(); @@ -1342,8 +1425,9 @@ strong_closure_assign(); // For an empty Octagonal shape, we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; + } // The Octagonal shape has at least 1 dimension and is not empty. PPL_DIRTY_TEMP_COEFFICIENT(coeff); @@ -1401,9 +1485,10 @@ dimension_type j = j_iter.index(); const Variable vj(j/2); coeff_j = le.coefficient(vj); - if (coeff_j == 0) + if (coeff_j == 0) { // The coefficient in `le' is 0, so do nothing. continue; + } const dimension_type cj = coherent_index(j); const dimension_type cjj = coherent_index(j + 1); @@ -1445,14 +1530,16 @@ break; } } - if (!constant_v) + if (!constant_v) { // The expression `expr' is not constant. return false; + } } } - if (!constant_v) + if (!constant_v) { // The expression `expr' is not constant. return false; + } // The expression 'expr' is constant. freq_n = 0; @@ -1468,13 +1555,15 @@ Octagonal_Shape::constrains(const Variable var) const { // `var' should be one of the dimensions of the octagonal shape. const dimension_type var_space_dim = var.space_dimension(); - if (space_dimension() < var_space_dim) + if (space_dimension() < var_space_dim) { throw_dimension_incompatible("constrains(v)", "v", var); + } // An octagon known to be empty constrains all variables. // (Note: do not force emptiness check _yet_) - if (marked_empty()) + if (marked_empty()) { return true; + } // Check whether `var' is syntactically constrained. const dimension_type n_v = 2*(var_space_dim - 1); @@ -1482,15 +1571,17 @@ typename OR_Matrix::const_row_reference_type r_v = *m_iter; typename OR_Matrix::const_row_reference_type r_cv = *(++m_iter); for (dimension_type h = m_iter.row_size(); h-- > 0; ) { - if (!is_plus_infinity(r_v[h]) || !is_plus_infinity(r_cv[h])) + if (!is_plus_infinity(r_v[h]) || !is_plus_infinity(r_cv[h])) { return true; + } } ++m_iter; for (typename OR_Matrix::const_row_iterator m_end = matrix.row_end(); m_iter != m_end; ++m_iter) { typename OR_Matrix::const_row_reference_type r = *m_iter; - if (!is_plus_infinity(r[n_v]) || !is_plus_infinity(r[n_v + 1])) + if (!is_plus_infinity(r[n_v]) || !is_plus_infinity(r[n_v + 1])) { return true; + } } // `var' is not syntactically constrained: @@ -1517,7 +1608,7 @@ typename OR_Matrix::const_row_reference_type m_i = *iter; using namespace Implementation::Octagonal_Shapes; const N& m_i_ci = m_i[coherent_index(i)]; - for (dimension_type j = matrix.row_size(i); j-- > 0; ) + for (dimension_type j = matrix.row_size(i); j-- > 0; ) { // Note: on the main diagonal only PLUS_INFINITY can occur. if (i != j) { const N& m_cj_j = matrix[coherent_index(j)][j]; @@ -1527,10 +1618,12 @@ // rounding the result towards plus infinity. add_assign_r(semi_sum, m_i_ci, m_cj_j, ROUND_UP); div_2exp_assign_r(semi_sum, semi_sum, 1, ROUND_UP); - if (m_i[j] > semi_sum) + if (m_i[j] > semi_sum) { return false; + } } } + } } return true; } @@ -1541,8 +1634,9 @@ // This method is only used in assertions: efficiency is not a must. // An empty octagon is already transitively reduced. - if (marked_empty()) + if (marked_empty()) { return true; + } Octagonal_Shape x = *this; // The matrix representing an OS is strongly reduced if, by removing @@ -1555,8 +1649,9 @@ if (!is_plus_infinity(m_i[j])) { Octagonal_Shape x_copy = *this; assign_r(x_copy.matrix[i][j], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (x == x_copy) + if (x == x_copy) { return false; + } } } } @@ -1571,15 +1666,17 @@ // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((from_above ? "bounds_from_above(e)" : "bounds_from_below(e)"), "e", expr); + } strong_closure_assign(); // A zero-dimensional or empty octagon bounds everything. - if (space_dim == 0 || marked_empty()) + if (space_dim == 0 || marked_empty()) { return true; + } // The constraint `c' is used to check if `expr' is an octagonal difference // and, in this case, to select the cell. @@ -1592,8 +1689,9 @@ if (Octagonal_Shape_Helper ::extract_octagonal_difference(c, c.space_dimension(), num_vars, i, j, coeff, term)) { - if (num_vars == 0) + if (num_vars == 0) { return true; + } // Select the cell to be checked. typename OR_Matrix::const_row_iterator i_iter = matrix.row_begin() + i; typename OR_Matrix::const_row_reference_type m_i = *i_iter; @@ -1617,14 +1715,16 @@ // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } // Deal with zero-dim octagons first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -1635,8 +1735,9 @@ strong_closure_assign(); // For an empty OS we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; + } // The constraint `c' is used to check if `expr' is an octagonal difference // and, in this case, to select the cell. @@ -1657,9 +1758,10 @@ included = true; return true; } - else + else { // Here`expr' is unbounded in `*this'. return false; + } } else { // `c' is an octagonal constraint. @@ -1685,8 +1787,9 @@ PPL_DIRTY_TEMP(N, coeff_expr); const Coefficient& coeff_i = expr.coefficient(Variable(i/2)); const int sign_i = sgn(coeff_i); - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_expr, coeff_i, ROUND_UP); + } else { PPL_DIRTY_TEMP_COEFFICIENT(minus_coeff_i); neg_assign(minus_coeff_i, coeff_i); @@ -1698,11 +1801,13 @@ div_2exp_assign_r(m_i_j, m_i[j], 1, ROUND_UP); add_mul_assign_r(d, coeff_expr, m_i_j, ROUND_UP); } - else + else { add_mul_assign_r(d, coeff_expr, m_i[j], ROUND_UP); + } numer_denom(d, ext_n, ext_d); - if (!maximize) + if (!maximize) { neg_assign(ext_n); + } included = true; return true; } @@ -1721,14 +1826,16 @@ // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } // Deal with zero-dim octagons first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -1740,8 +1847,9 @@ strong_closure_assign(); // For an empty OS we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; + } if (!is_universe()) { // We use MIP_Problems to handle constraints that are not // octagonal difference. @@ -1764,8 +1872,9 @@ dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dim) + if (cg_space_dim > space_dim) { throw_dimension_incompatible("relation_with(cg)", cg); + } // If the congruence is an equality, // find the relation with the equivalent equality constraint. @@ -1776,17 +1885,20 @@ strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } } // Find the lower bound for a hyperplane with direction @@ -1799,8 +1911,9 @@ // If there is no lower bound, then some of the hyperplanes defined by // the congruence will strictly intersect the shape. - if (!bounded_below) + if (!bounded_below) { return Poly_Con_Relation::strictly_intersects(); + } // TODO: Consider adding a max_and_min() method, performing both // maximization and minimization so as to possibly exploit @@ -1815,8 +1928,9 @@ // If there is no upper bound, then some of the hyperplanes defined by // the congruence will strictly intersect the shape. - if (!bounded_above) + if (!bounded_above) { return Poly_Con_Relation::strictly_intersects(); + } PPL_DIRTY_TEMP_COEFFICIENT(signed_distance); @@ -1827,8 +1941,9 @@ const Coefficient& modulus = cg.modulus(); signed_distance = min_value % modulus; min_value -= signed_distance; - if (min_value * min_denom < min_numer) + if (min_value * min_denom < min_numer) { min_value += modulus; + } // Find the position value for the hyperplane that satisfies the congruence // and is below the upper bound for the shape. @@ -1836,16 +1951,19 @@ max_value = max_numer / max_denom; signed_distance = max_value % modulus; max_value += signed_distance; - if (max_value * max_denom > max_numer) + if (max_value * max_denom > max_numer) { max_value -= modulus; + } // If the upper bound value is less than the lower bound value, // then there is an empty intersection with the congruence; // otherwise it will strictly intersect. - if (max_value < min_value) + if (max_value < min_value) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } } template @@ -1854,37 +1972,43 @@ dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dim) + if (c_space_dim > space_dim) { throw_dimension_incompatible("relation_with(c)", c); + } // The closure needs to make explicit the implicit constraints. strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { // Trivially false zero-dimensional constraint. if ((c.is_equality() && c.inhomogeneous_term() != 0) - || (c.is_inequality() && c.inhomogeneous_term() < 0)) + || (c.is_inequality() && c.inhomogeneous_term() < 0)) { return Poly_Con_Relation::is_disjoint(); - else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) + } + else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) { // The constraint 0 > 0 implicitly defines the hyperplane 0 = 0; // thus, the zero-dimensional point also saturates it. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); + } // Trivially true zero-dimensional constraint. - else if (c.is_equality() || c.inhomogeneous_term() == 0) + else if (c.is_equality() || c.inhomogeneous_term() == 0) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); - else + } + else { // The zero-dimensional point saturates // neither the positivity constraint 1 >= 0, // nor the strict positivity constraint 1 > 0. return Poly_Con_Relation::is_included(); + } } dimension_type num_vars = 0; @@ -1906,26 +2030,29 @@ le.linear_combine(c.expr, Coefficient_one(), Coefficient_one(), 1, c_space_dim + 1); - PPL_DIRTY_TEMP(Coefficient, max_numer); - PPL_DIRTY_TEMP(Coefficient, max_denom); + PPL_DIRTY_TEMP_COEFFICIENT(max_numer); + PPL_DIRTY_TEMP_COEFFICIENT(max_denom); bool max_included; - PPL_DIRTY_TEMP(Coefficient, min_numer); - PPL_DIRTY_TEMP(Coefficient, min_denom); + PPL_DIRTY_TEMP_COEFFICIENT(min_numer); + PPL_DIRTY_TEMP_COEFFICIENT(min_denom); bool min_included; bool bounded_above = maximize(le, max_numer, max_denom, max_included); bool bounded_below = minimize(le, min_numer, min_denom, min_included); if (!bounded_above) { - if (!bounded_below) + if (!bounded_below) { return Poly_Con_Relation::strictly_intersects(); + } min_numer += c.inhomogeneous_term() * min_denom; switch (sgn(min_numer)) { case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::is_included(); case 0: - if (c.is_strict_inequality() || c.is_equality()) + if (c.is_strict_inequality() || c.is_equality()) { return Poly_Con_Relation::strictly_intersects(); + } return Poly_Con_Relation::is_included(); case -1: return Poly_Con_Relation::strictly_intersects(); @@ -1937,8 +2064,9 @@ case 1: return Poly_Con_Relation::strictly_intersects(); case 0: - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::strictly_intersects(); case -1: return Poly_Con_Relation::is_disjoint(); @@ -1951,14 +2079,17 @@ case 1: switch (sgn(min_numer)) { case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::is_included(); case 0: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::strictly_intersects(); - if (c.is_strict_inequality()) + } + if (c.is_strict_inequality()) { return Poly_Con_Relation::strictly_intersects(); + } return Poly_Con_Relation::is_included(); case -1: return Poly_Con_Relation::strictly_intersects(); @@ -1967,14 +2098,16 @@ break; case 0: if (min_numer == 0) { - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint() && Poly_Con_Relation::saturates(); + } return Poly_Con_Relation::is_included() && Poly_Con_Relation::saturates(); } - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::strictly_intersects(); case -1: return Poly_Con_Relation::is_disjoint(); @@ -1988,17 +2121,21 @@ case -1: return Poly_Con_Relation::is_disjoint(); case 0: - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::is_included(); + } } } @@ -2007,15 +2144,18 @@ typename OR_Matrix::const_row_reference_type m_i = *i_iter; const N& m_i_j = m_i[j]; // Set `coeff' to the absolute value of itself. - if (coeff < 0) + if (coeff < 0) { neg_assign(coeff); + } // Select the cell to be checked for the ">=" part of constraint. // Select the right row of the cell. - if (i % 2 == 0) + if (i % 2 == 0) { ++i_iter; - else + } + else { --i_iter; + } typename OR_Matrix::const_row_reference_type m_ci = *i_iter; using namespace Implementation::Octagonal_Shapes; const N& m_ci_cj = m_ci[coherent_index(j)]; @@ -2047,10 +2187,12 @@ assign_r(q_denom, denom, ROUND_NOT_NEEDED); assign_r(q_y, numer, ROUND_NOT_NEEDED); div_assign_r(q_y, q_y, q_denom, ROUND_NOT_NEEDED); - if (q_y < d1) + if (q_y < d1) { return Poly_Con_Relation::is_disjoint(); - if (q_y == d1 && c.is_strict_inequality()) + } + if (q_y == d1 && c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } } // In all other cases `*this' intersects `c'. @@ -2069,34 +2211,40 @@ assign_r(q_y, numer, ROUND_NOT_NEEDED); div_assign_r(q_y, q_y, q_denom, ROUND_NOT_NEEDED); if (q_x == d && q_y == d1) { - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } } // `*this' is disjoint from `c' when // `m_ci_cj < d1' (`m_ci_cj <= d1' if `c' is a strict inequality). - if (q_y < d1) + if (q_y < d1) { return Poly_Con_Relation::is_disjoint(); - if (q_y == d1 && c.is_strict_inequality()) + } + if (q_y == d1 && c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } } // Here `m_ci_cj' can be also plus-infinity. // If `c' is an equality, `*this' is disjoint from `c' if // `m_i_j < d'. if (d > q_x) { - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::is_included(); + } } - if (d == q_x && c.is_nonstrict_inequality()) + if (d == q_x && c.is_nonstrict_inequality()) { return Poly_Con_Relation::is_included(); - + } // In all other cases `*this' intersects `c'. return Poly_Con_Relation::strictly_intersects(); } @@ -2107,21 +2255,24 @@ const dimension_type g_space_dim = g.space_dimension(); // Dimension-compatibility check. - if (space_dim < g_space_dim) + if (space_dim < g_space_dim) { throw_dimension_incompatible("relation_with(g)", g); + } // The closure needs to make explicit the implicit constraints and if the // octagon is empty. strong_closure_assign(); // The empty octagon cannot subsume a generator. - if (marked_empty()) + if (marked_empty()) { return Poly_Gen_Relation::nothing(); + } // A universe octagon in a zero-dimensional space subsumes // all the generators of a zero-dimensional space. - if (space_dim == 0) + if (space_dim == 0) { return Poly_Gen_Relation::subsumes(); + } const bool is_line = g.is_line(); const bool is_line_or_ray = g.is_line_or_ray(); @@ -2169,8 +2320,9 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (product != 0) + if (product != 0) { return Poly_Gen_Relation::nothing(); + } } // We have 0, 1 or 2 inequality constraints. else { @@ -2187,15 +2339,17 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); + } else // If the generator is not a line it's necessary to check // that the scalar product sign is not positive and the scalar // product has the form // '-denom * g.coeff_x - numer * g.divisor()'. - if (product > 0) + if (product > 0) { return Poly_Gen_Relation::nothing(); + } } if (!is_plus_infinity(m_ii_i)) { // The constraint has form ax <= b. @@ -2208,15 +2362,18 @@ neg_assign(numer); add_mul_assign(product, numer , g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); - else + } + else { // If the generator is not a line it's necessary to check // that the scalar product sign is not positive and the scalar // product has the form // 'denom * g_coeff_x - numer * g.divisor()'. - if (product > 0) + if (product > 0) { return Poly_Gen_Relation::nothing(); + } + } } } } @@ -2259,8 +2416,9 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (product != 0) + if (product != 0) { return Poly_Gen_Relation::nothing(); + } } else { if (!is_plus_infinity(m_i_j)) { @@ -2279,10 +2437,12 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); - else if (product > 0) + } + else if (product > 0) { return Poly_Gen_Relation::nothing(); + } } if (!is_plus_infinity(m_ii_jj)) { // The constraint has form -a*x + a*y <= b. @@ -2300,10 +2460,12 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); - else if (product > 0) + } + else if (product > 0) { return Poly_Gen_Relation::nothing(); + } } } @@ -2323,8 +2485,9 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (product != 0) + if (product != 0) { return Poly_Gen_Relation::nothing(); + } } else { if (!is_plus_infinity(m_i_jj)) { @@ -2343,10 +2506,12 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); - else if (product > 0) + } + else if (product > 0) { return Poly_Gen_Relation::nothing(); + } } if (!is_plus_infinity(m_ii_j)) { // The constraint has form a*x + a*y <= b. @@ -2363,10 +2528,12 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); - else if (product > 0) + } + else if (product > 0) { return Poly_Gen_Relation::nothing(); + } } } } @@ -2380,9 +2547,9 @@ void Octagonal_Shape::strong_closure_assign() const { // Do something only if necessary (zero-dim implies strong closure). - if (marked_empty() || marked_strongly_closed() || space_dim == 0) + if (marked_empty() || marked_strongly_closed() || space_dim == 0) { return; - + } // Even though the octagon will not change, its internal representation // is going to be modified by the closure algorithm. Octagonal_Shape& x = const_cast&>(*this); @@ -2536,8 +2703,9 @@ using namespace Implementation::Octagonal_Shapes; const N& x_i_ci = x_i[coherent_index(i)]; // Avoid to do unnecessary sums. - if (!is_plus_infinity(x_i_ci)) - for (dimension_type j = 0, rs_i = i_iter.row_size(); j < rs_i; ++j) + if (!is_plus_infinity(x_i_ci)) { + for (dimension_type j = 0, rs_i = i_iter.row_size(); + j < rs_i; ++j) { if (i != j) { const N& x_cj_j = matrix[coherent_index(j)][j]; if (!is_plus_infinity(x_cj_j)) { @@ -2546,6 +2714,8 @@ min_assign(x_i[j], semi_sum); } } + } + } } } @@ -2554,7 +2724,6 @@ Octagonal_Shape::tight_coherence_would_make_empty() const { PPL_ASSERT(std::numeric_limits::is_integer); PPL_ASSERT(marked_strongly_closed()); - const dimension_type space_dim = space_dimension(); for (dimension_type i = 0; i < 2*space_dim; i += 2) { const dimension_type ci = i + 1; const N& mat_i_ci = matrix[i][ci]; @@ -2562,8 +2731,9 @@ // Check for oddness of `mat_i_ci'. && !is_even(mat_i_ci) // Check for zero-equivalence of `i' and `ci'. - && is_additive_inverse(mat_i_ci, matrix[ci][i])) + && is_additive_inverse(mat_i_ci, matrix[ci][i])) { return true; + } } return false; } @@ -2577,23 +2747,26 @@ // FIXME: this is just an executable specification. // (The following call could be replaced by shortest-path closure.) strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - if (tight_coherence_would_make_empty()) + } + if (tight_coherence_would_make_empty()) { set_empty(); + } else { // Tighten the unary constraints. PPL_DIRTY_TEMP(N, temp_one); assign_r(temp_one, 1, ROUND_NOT_NEEDED); - const dimension_type space_dim = space_dimension(); for (dimension_type i = 0; i < 2*space_dim; i += 2) { const dimension_type ci = i + 1; N& mat_i_ci = matrix[i][ci]; - if (!is_plus_infinity(mat_i_ci) && !is_even(mat_i_ci)) + if (!is_plus_infinity(mat_i_ci) && !is_even(mat_i_ci)) { sub_assign_r(mat_i_ci, mat_i_ci, temp_one, ROUND_UP); + } N& mat_ci_i = matrix[ci][i]; - if (!is_plus_infinity(mat_ci_i) && !is_even(mat_ci_i)) + if (!is_plus_infinity(mat_ci_i) && !is_even(mat_ci_i)) { sub_assign_r(mat_ci_i, mat_ci_i, temp_one, ROUND_UP); + } } // Propagate tightened unary constraints. strong_coherence_assign(); @@ -2606,13 +2779,15 @@ Octagonal_Shape ::incremental_strong_closure_assign(const Variable var) const { // `var' should be one of the dimensions of the octagon. - if (var.id() >= space_dim) + if (var.id() >= space_dim) { throw_dimension_incompatible("incremental_strong_closure_assign(v)", var.id()); + } // Do something only if necessary. - if (marked_empty() || marked_strongly_closed()) + if (marked_empty() || marked_strongly_closed()) { return; + } Octagonal_Shape& x = const_cast&>(*this); @@ -2754,8 +2929,9 @@ const dimension_type successor_size = matrix.num_rows(); // Initially, each variable is successor of its own zero-equivalence class. successor.reserve(successor_size); - for (dimension_type i = 0; i < successor_size; ++i) + for (dimension_type i = 0; i < successor_size; ++i) { successor.push_back(i); + } // Now compute actual successors. for (dimension_type i = successor_size; i-- > 0; ) { typename OR_Matrix::const_row_iterator i_iter = matrix.row_begin() + i; @@ -2767,9 +2943,10 @@ //for (dimension_type j = i; j-- > 0; ) { using namespace Implementation::Octagonal_Shapes; dimension_type cj = coherent_index(j); - if (is_additive_inverse(m_ci[cj], m_i[j])) + if (is_additive_inverse(m_ci[cj], m_i[j])) { // Choose as successor the variable having the greatest index. successor[j] = i; + } } } } @@ -2786,8 +2963,9 @@ const dimension_type leader_size = matrix.num_rows(); // Initially, each variable is leader of its own zero-equivalence class. leaders.reserve(leader_size); - for (dimension_type i = 0; i < leader_size; ++i) + for (dimension_type i = 0; i < leader_size; ++i) { leaders.push_back(i); + } // Now compute actual leaders. for (typename OR_Matrix::const_row_iterator i_iter = matrix.row_begin(), matrix_row_end = matrix.row_end(); @@ -2799,9 +2977,10 @@ for (dimension_type j = 0; j < i; ++j) { using namespace Implementation::Octagonal_Shapes; dimension_type cj = coherent_index(j); - if (is_additive_inverse(m_ci[cj], m_i[j])) + if (is_additive_inverse(m_ci[cj], m_i[j])) { // Choose as leader the variable having the smaller index. leaders[i] = leaders[j]; + } } } } @@ -2827,8 +3006,9 @@ exist_sing_class = true; sing_leader = i; } - else + else { no_sing_leaders.push_back(i); + } } // The following index is not a leader. dealt_with[next_i] = true; @@ -2839,13 +3019,14 @@ void Octagonal_Shape::strong_reduction_assign() const { // Zero-dimensional octagonal shapes are necessarily reduced. - if (space_dim == 0) + if (space_dim == 0) { return; + } strong_closure_assign(); // If `*this' is empty, then there is nothing to reduce. - if (marked_empty()) + if (marked_empty()) { return; - + } // Detect non-redundant constraints. std::vector non_red; non_redundant_matrix_entries(non_red); @@ -2860,8 +3041,9 @@ const Bit_Row& non_red_i = non_red[i]; for (dimension_type j = 0, j_end = OR_Matrix::row_size(i); j < j_end; ++j, ++x_i) { - if (!non_red_i[j]) + if (!non_red_i[j]) { assign_r(*x_i, PLUS_INFINITY, ROUND_NOT_NEEDED); + } } } x.reset_strongly_closed(); @@ -2940,9 +3122,10 @@ if (j != ci) { add_assign_r(tmp, m_i_ci, matrix[cj][j], ROUND_UP); div_2exp_assign_r(tmp, tmp, 1, ROUND_UP); - if (m_i_j >= tmp) + if (m_i_j >= tmp) { // The constraint is redundant. continue; + } } // Control if the constraint is redundant by strong closure, that is // if there is a path from i to j (i = i_0, ... , i_n = j), such that @@ -2958,16 +3141,18 @@ const dimension_type k = no_sing_leaders[lk]; if (k != i && k != j) { dimension_type ck = coherent_index(k); - if (k < j) + if (k < j) { // Case 1. add_assign_r(tmp, m_i[k], matrix[cj][ck], ROUND_UP); - else if (k < i) + } + else if (k < i) { // Case 2. add_assign_r(tmp, m_i[k], matrix[k][j], ROUND_UP); - else + } + else { // Case 3. add_assign_r(tmp, matrix[ck][ci], matrix[k][j], ROUND_UP); - + } // Checks if the constraint is redundant. if (m_i_j >= tmp) { to_add = false; @@ -2976,9 +3161,10 @@ } } - if (to_add) + if (to_add) { // The constraint is not redundant. non_redundant[i].set(j); + } } } @@ -2998,8 +3184,9 @@ } non_redundant[j + 1].set(j); } - else + else { non_redundant[sing_leader + 1].set(sing_leader); + } } } @@ -3007,13 +3194,15 @@ void Octagonal_Shape::upper_bound_assign(const Octagonal_Shape& y) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("upper_bound_assign(y)", y); + } // The hull of an octagon `x' with an empty octagon is `x'. y.strong_closure_assign(); - if (y.marked_empty()) + if (y.marked_empty()) { return; + } strong_closure_assign(); if (marked_empty()) { *this = y; @@ -3024,8 +3213,9 @@ typename OR_Matrix::const_element_iterator j = y.matrix.element_begin(); for (typename OR_Matrix::element_iterator i = matrix.element_begin(), matrix_element_end = matrix.element_end(); - i != matrix_element_end; ++i, ++j) + i != matrix_element_end; ++i, ++j) { max_assign(*i, *j); + } // The result is still closed. PPL_ASSERT(OK()); @@ -3035,8 +3225,9 @@ void Octagonal_Shape::difference_assign(const Octagonal_Shape& y) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("difference_assign(y)", y); + } Octagonal_Shape& x = *this; @@ -3044,12 +3235,13 @@ // We close. x.strong_closure_assign(); // The difference of an empty octagon and of an octagon `p' is empty. - if (x.marked_empty()) + if (x.marked_empty()) { return; + } // The difference of a octagon `p' and an empty octagon is `p'. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } // If both octagons are zero-dimensional, // then at this point they are necessarily universe octagons, // so that their difference is empty. @@ -3077,18 +3269,21 @@ // then `c' _must_ be skipped, as adding its complement to `x' // would result in the empty octagon, and as we would obtain // a result that is less precise than the difference. - if (x.relation_with(c).implies(Poly_Con_Relation::is_included())) + if (x.relation_with(c).implies(Poly_Con_Relation::is_included())) { continue; + } Octagonal_Shape z = x; const Linear_Expression e(c.expression()); z.add_constraint(e <= 0); - if (!z.is_empty()) + if (!z.is_empty()) { new_oct.upper_bound_assign(z); + } if (c.is_equality()) { z = x; z.add_constraint(e >= 0); - if (!z.is_empty()) + if (!z.is_empty()) { new_oct.upper_bound_assign(z); + } } } *this = new_oct; @@ -3101,8 +3296,9 @@ Octagonal_Shape& x = *this; const dimension_type dim = x.space_dimension(); // Dimension-compatibility check. - if (dim != y.space_dimension()) + if (dim != y.space_dimension()) { throw_dimension_incompatible("simplify_using_context_assign(y)", y); + } // Filter away the zero-dimensional case. if (dim == 0) { @@ -3110,8 +3306,9 @@ x.set_zero_dim_univ(); return false; } - else + else { return !x.marked_empty(); + } } // Filter away the case where `x' contains `y' @@ -3122,11 +3319,6 @@ return false; } - typedef typename OR_Matrix::row_iterator Row_Iter; - typedef typename OR_Matrix::const_row_iterator Row_CIter; - typedef typename OR_Matrix::element_iterator Elem_Iter; - typedef typename OR_Matrix::const_element_iterator Elem_CIter; - // Filter away the case where `x' is empty. x.strong_closure_assign(); if (x.marked_empty()) { @@ -3152,12 +3344,14 @@ } // Then search binary constraints. // TODO: use better iteration scheme. - for (i = 2; i < 2*dim; ++i) + for (i = 2; i < 2*dim; ++i) { for (j = 0; j < i; ++j) { // Use something like !is_maximal()? - if (!is_plus_infinity(y.matrix_at(i, j))) + if (!is_plus_infinity(y.matrix_at(i, j))) { goto found; + } } + } // Not found: we were not able to build a constraint contradicting // one of the constraints in `y': `x' cannot be enlarged. @@ -3191,8 +3385,9 @@ x.non_redundant_matrix_entries(x_non_redundant); // ... count the non-redundant constraints. dimension_type x_num_non_redundant = 0; - for (size_t i = x_non_redundant.size(); i-- > 0 ; ) + for (size_t i = x_non_redundant.size(); i-- > 0 ; ) { x_num_non_redundant += x_non_redundant[i].count_ones(); + } PPL_ASSERT(x_num_non_redundant > 0); // Let `yy' be a copy of `y': we will keep adding to `yy' @@ -3216,16 +3411,18 @@ if (sing_leader == x_leaders[sing_leader]) { const N& x_s_ss = x.matrix_at(sing_leader, sing_leader + 1); const N& x_ss_s = x.matrix_at(sing_leader + 1, sing_leader); - if (is_additive_inverse(x_s_ss, x_ss_s)) + if (is_additive_inverse(x_s_ss, x_ss_s)) { // Singular leader found. break; + } } } // Unary equalities have `sing_leader' as a leader. for (dimension_type i = sing_leader; i < 2*dim; i += 2) { - if (x_leaders[i] != sing_leader) + if (x_leaders[i] != sing_leader) { continue; + } // Found a unary equality constraint: // see if any of the two inequalities have to be added. const N& x_i_ii = x.matrix_at(i, i + 1); @@ -3266,8 +3463,9 @@ // Go through the binary equality constraints. for (dimension_type i = 0; i < 2*dim; ++i) { const dimension_type j = x_leaders[i]; - if (j == i || j == sing_leader) + if (j == i || j == sing_leader) { continue; + } const N& x_i_j = x.matrix_at(i, j); PPL_ASSERT(!is_plus_infinity(x_i_j)); N& yy_i_j = yy.matrix_at(i, j); @@ -3307,18 +3505,22 @@ // both indices i and j should be leaders. // FIXME: improve iteration scheme (are we doing twice the work?) for (dimension_type i = 0; i < 2*dim; ++i) { - if (i != x_leaders[i]) + if (i != x_leaders[i]) { continue; + } const Bit_Row& x_non_redundant_i = x_non_redundant[i]; for (dimension_type j = 0; j < 2*dim; ++j) { - if (j != x_leaders[j]) + if (j != x_leaders[j]) { continue; + } if (i >= j) { - if (!x_non_redundant_i[j]) + if (!x_non_redundant_i[j]) { continue; + } } - else if (!x_non_redundant[j][i]) + else if (!x_non_redundant[j][i]) { continue; + } N& yy_i_j = yy.matrix_at(i, j); const N& x_i_j = x.matrix_at(i, j); if (x_i_j < yy_i_j) { @@ -3349,8 +3551,9 @@ void Octagonal_Shape::add_space_dimensions_and_embed(dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; + } const dimension_type new_dim = space_dim + m; const bool was_zero_dim_univ = !marked_empty() && space_dim == 0; @@ -3361,8 +3564,9 @@ space_dim = new_dim; // If `*this' was the zero-dim space universe octagon, // then we can set the strongly closure flag. - if (was_zero_dim_univ) + if (was_zero_dim_univ) { set_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -3371,8 +3575,9 @@ void Octagonal_Shape::add_space_dimensions_and_project(dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; + } const dimension_type n = matrix.num_rows(); @@ -3390,8 +3595,9 @@ assign_r(x_ci[ind], 0, ROUND_NOT_NEEDED); } - if (marked_strongly_closed()) + if (marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -3408,8 +3614,9 @@ // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dim < min_space_dim) + if (space_dim < min_space_dim) { throw_dimension_incompatible("remove_space_dimensions(vs)", min_space_dim); + } const dimension_type new_space_dim = space_dim - vars.size(); @@ -3418,9 +3625,10 @@ // we obtain the zero-dimensional octagon. if (new_space_dim == 0) { matrix.shrink(0); - if (!marked_empty()) + if (!marked_empty()) { // We set the zero_dim_univ flag. set_zero_dim_univ(); + } space_dim = 0; PPL_ASSERT(OK()); return; @@ -3445,16 +3653,18 @@ // row of variable(j), then we shift the cells corresponding to the // second row. We recall that every variable is represented // in the `matrix' by two rows and two columns. - for (dimension_type j = 0; j <= i; ++j) + for (dimension_type j = 0; j <= i; ++j) { if (vars.count(j) == 0) { assign_or_swap(*(iter++), row_ref[2*j]); assign_or_swap(*(iter++), row_ref[2*j + 1]); } - for (dimension_type j = 0; j <= i; ++j) + } + for (dimension_type j = 0; j <= i; ++j) { if (vars.count(j) == 0) { assign_or_swap(*(iter++), row_ref1[2*j]); assign_or_swap(*(iter++), row_ref1[2*j + 1]); } + } } } // Update the space dimension. @@ -3467,8 +3677,9 @@ template void Octagonal_Shape::map_space_dimensions(const Partial_Function& pfunc) { - if (space_dim == 0) + if (space_dim == 0) { return; + } if (pfunc.has_empty_codomain()) { // All dimensions vanish: the octagon becomes zero_dimensional. @@ -3479,9 +3690,9 @@ const dimension_type new_space_dim = pfunc.max_in_codomain() + 1; // If we are going to actually reduce the space dimension, // then shortest-path closure is required to keep precision. - if (new_space_dim < space_dim) + if (new_space_dim < space_dim) { strong_closure_assign(); - + } // If the octagon is empty, then it is sufficient to adjust // the space dimension of the octagon. if (marked_empty()) { @@ -3552,12 +3763,14 @@ void Octagonal_Shape::intersection_assign(const Octagonal_Shape& y) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("intersection_assign(y)", y); + } // If one of the two octagons is empty, the intersection is empty. - if (marked_empty()) + if (marked_empty()) { return; + } if (y.marked_empty()) { set_empty(); return; @@ -3565,9 +3778,9 @@ // If both octagons are zero-dimensional,then at this point // they are necessarily non-empty, // so that their intersection is non-empty too. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // To intersect two octagons we compare the constraints // and we choose the less values. bool changed = false; @@ -3586,8 +3799,9 @@ } // This method not preserve the closure. - if (changed && marked_strongly_closed()) + if (changed && marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -3598,33 +3812,38 @@ Iterator first, Iterator last, unsigned* tp) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("CC76_extrapolation_assign(y)", y); + } // Assume `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If both octagons are zero-dimensional, // since `*this' contains `y', we simply return `*this'. - if (space_dim == 0) + if (space_dim == 0) { return; + } strong_closure_assign(); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } y.strong_closure_assign(); // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } // If there are tokens available, work on a temporary copy. if (tp != 0 && *tp > 0) { Octagonal_Shape x_tmp(*this); x_tmp.CC76_extrapolation_assign(y, first, last, 0); // If the widening was not precise, use one of the available tokens. - if (!contains(x_tmp)) + if (!contains(x_tmp)) { --(*tp); + } return; } @@ -3646,11 +3865,13 @@ if (y_elem < elem) { Iterator k = std::lower_bound(first, last, elem); if (k != last) { - if (elem < *k) + if (elem < *k) { assign_r(elem, *k, ROUND_UP); + } } - else + else { assign_r(elem, PLUS_INFINITY, ROUND_NOT_NEEDED); + } } } @@ -3684,8 +3905,9 @@ // Constraints that are not octagonal differences are ignored. if (!Octagonal_Shape_Helper ::extract_octagonal_difference(c, cs_space_dim, num_vars, i, j, - coeff, term)) + coeff, term)) { continue; + } typedef typename OR_Matrix::const_row_iterator Row_iterator; typedef typename OR_Matrix::const_row_reference_type Row_reference; @@ -3699,11 +3921,12 @@ row_iterator lo_iter = lo_mat.row_begin() + i; row_reference lo_m_i = *lo_iter; N& lo_m_i_j = lo_m_i[j]; - if (coeff < 0) + if (coeff < 0) { neg_assign(coeff); + } // Compute the bound for `m_i_j', rounding towards plus infinity. div_round_up(d, term, coeff); - if (m_i[j] <= d) + if (m_i[j] <= d) { if (c.is_inequality()) { if (lo_m_i_j > d) { lo_m_i_j = d; @@ -3733,11 +3956,13 @@ } } } + } } // In general, adding a constraint does not preserve the strongly // closure of the octagon. - if (is_oct_changed && limiting_octagon.marked_strongly_closed()) + if (is_oct_changed && limiting_octagon.marked_strongly_closed()) { limiting_octagon.reset_strongly_closed(); + } } template @@ -3748,33 +3973,40 @@ unsigned* tp) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("limited_CC76_extrapolation_assign(y, cs)", y); + } // `cs' must be dimension-compatible with the two octagons. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_constraint_incompatible("limited_CC76_extrapolation_assign(y, cs)"); + } // Strict inequalities not allowed. - if (cs.has_strict_inequalities()) + if (cs.has_strict_inequalities()) { throw_constraint_incompatible("limited_CC76_extrapolation_assign(y, cs)"); + } // The limited CC76-extrapolation between two octagons in a // zero-dimensional space is a octagon in a zero-dimensional // space, too. - if (space_dim == 0) + if (space_dim == 0) { return; + } // Assume `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } + // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } Octagonal_Shape limiting_octagon(space_dim, UNIVERSE); get_limiting_octagon(cs, limiting_octagon); @@ -3787,8 +4019,9 @@ Octagonal_Shape::BHMZ05_widening_assign(const Octagonal_Shape& y, unsigned* tp) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("BHMZ05_widening_assign(y)", y); + } // Assume `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); @@ -3798,23 +4031,25 @@ // If the affine dimension of `y' is zero, then either `y' is // zero-dimensional, or it is empty, or it is a singleton. // In all cases, due to the inclusion hypothesis, the result is `*this'. - if (y_affine_dim == 0) + if (y_affine_dim == 0) { return; + } // If the affine dimension has changed, due to the inclusion hypothesis, // the result is `*this'. const dimension_type x_affine_dim = affine_dimension(); PPL_ASSERT(x_affine_dim >= y_affine_dim); - if (x_affine_dim != y_affine_dim) + if (x_affine_dim != y_affine_dim) { return; - + } // If there are tokens available, work on a temporary copy. if (tp != 0 && *tp > 0) { Octagonal_Shape x_tmp(*this); x_tmp.BHMZ05_widening_assign(y, 0); // If the widening was not precise, use one of the available tokens. - if (!contains(x_tmp)) + if (!contains(x_tmp)) { --(*tp); + } return; } @@ -3833,8 +4068,9 @@ // Note: in the following line the use of `!=' (as opposed to // the use of `<' that would seem -but is not- equivalent) is // intentional. - if (*j != elem) + if (*j != elem) { assign_r(elem, PLUS_INFINITY, ROUND_NOT_NEEDED); + } } reset_strongly_closed(); PPL_ASSERT(OK()); @@ -3848,33 +4084,40 @@ unsigned* tp) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("limited_BHMZ05_extrapolation_assign(y, cs)", y); + } + // `cs' must be dimension-compatible with the two octagons. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_constraint_incompatible("limited_CH78_extrapolation_assign(y, cs)"); + } // Strict inequalities not allowed. - if (cs.has_strict_inequalities()) + if (cs.has_strict_inequalities()) { throw_constraint_incompatible("limited_CH78_extrapolation_assign(y, cs)"); + } // The limited BHMZ05-extrapolation between two octagons in a // zero-dimensional space is a octagon in a zero-dimensional // space, too. - if (space_dim == 0) + if (space_dim == 0) { return; + } // Assume `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } Octagonal_Shape limiting_octagon(space_dim, UNIVERSE); get_limiting_octagon(cs, limiting_octagon); @@ -3886,25 +4129,30 @@ void Octagonal_Shape::CC76_narrowing_assign(const Octagonal_Shape& y) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("CC76_narrowing_assign(y)", y); + } // Assume `*this' is contained in or equal to `y'. PPL_EXPECT_HEAVY(copy_contains(y, *this)); // If both octagons are zero-dimensional, since `*this' contains `y', // we simply return '*this'. - if (space_dim == 0) + if (space_dim == 0) { return; + } y.strong_closure_assign(); // If `y' is empty, since `y' contains `*this', `*this' is empty too. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } + strong_closure_assign(); // If `*this' is empty, we return. - if (marked_empty()) + if (marked_empty()) { return; + } // We consider a constraint of `*this', if its value is `plus_infinity', // we take the value of the corresponding constraint of `y'. @@ -3922,8 +4170,9 @@ } } - if (is_oct_changed && marked_strongly_closed()) + if (is_oct_changed && marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -3960,8 +4209,9 @@ u_end = sc_expr.lower_bound(Variable(last_id + 1)); u != u_end; ++u) { const dimension_type u_id = u.variable().id(); // Skip the case when `u_id == v_id'. - if (u_id == v_id) + if (u_id == v_id) { continue; + } const Coefficient& expr_u = *u; const dimension_type n_u = u_id*2; @@ -4076,8 +4326,9 @@ u_end = sc_expr.lower_bound(Variable(last_id + 1)); u != u_end; ++u) { const dimension_type u_id = u.variable().id(); // Skip the case when `u_id == v_id'. - if (u_id == v_id) + if (u_id == v_id) { continue; + } const Coefficient& expr_u = *u; const dimension_type n_u = u_id*2; @@ -4212,15 +4463,17 @@ Octagonal_Shape::unconstrain(const Variable var) { // Dimension-compatibility check. const dimension_type var_id = var.id(); - if (space_dimension() < var_id + 1) + if (space_dimension() < var_id + 1) { throw_dimension_incompatible("unconstrain(var)", var_id + 1); + } // Enforce strong closure for precision. strong_closure_assign(); // If the shape is empty, this is a no-op. - if (marked_empty()) + if (marked_empty()) { return; + } forget_all_octagonal_constraints(var_id); // Strong closure is preserved. @@ -4232,24 +4485,28 @@ Octagonal_Shape::unconstrain(const Variables_Set& vars) { // The cylindrification with respect to no dimensions is a no-op. // This case captures the only legal cylindrification in a 0-dim space. - if (vars.empty()) + if (vars.empty()) { return; + } // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("unconstrain(vs)", min_space_dim); + } // Enforce strong closure for precision. strong_closure_assign(); // If the shape is empty, this is a no-op. - if (marked_empty()) + if (marked_empty()) { return; + } for (Variables_Set::const_iterator vsi = vars.begin(), - vsi_end = vars.end(); vsi != vsi_end; ++vsi) + vsi_end = vars.end(); vsi != vsi_end; ++vsi) { forget_all_octagonal_constraints(*vsi); + } // Strong closure is preserved. PPL_ASSERT(OK()); } @@ -4277,8 +4534,9 @@ if (w_id != 0) { ++t; - if (!expr.all_zeroes(1, w_id)) + if (!expr.all_zeroes(1, w_id)) { ++t; + } --w_id; } @@ -4302,9 +4560,9 @@ // If this is not the case, we fall back to the general case // so as to over-approximate the constraint. if (t == 1 && expr.coefficient(Variable(w_id)) != denominator - && expr.coefficient(Variable(w_id)) != minus_denom) + && expr.coefficient(Variable(w_id)) != minus_denom) { t = 2; - + } if (t == 0) { // Case 1: expr == b. PPL_DIRTY_TEMP_COEFFICIENT(two_b); @@ -4336,7 +4594,7 @@ const dimension_type n_w = 2*w_id; switch (relsym) { case EQUAL: - if (w_coeff == denominator) + if (w_coeff == denominator) { // Add the new constraint `var - w = b/denominator'. if (var_id < w_id) { add_octagonal_constraint(n_w, n_var, b, denominator); @@ -4346,7 +4604,8 @@ add_octagonal_constraint(n_var + 1, n_w + 1, b, denominator); add_octagonal_constraint(n_var, n_w, b, minus_denom); } - else + } + else { // Add the new constraint `var + w = b/denominator'. if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var, b, denominator); @@ -4356,6 +4615,7 @@ add_octagonal_constraint(n_var + 1, n_w, b, denominator); add_octagonal_constraint(n_var, n_w + 1, b, minus_denom); } + } break; case LESS_OR_EQUAL: { @@ -4365,17 +4625,21 @@ // w_coeff * w + b, with `w_id != v'. if (w_coeff == denominator) { // Add the new constraints `v - w <= b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w, n_var, d); - else + } + else { add_octagonal_constraint(n_var + 1, n_w + 1, d); + } } else if (w_coeff == minus_denom) { // Add the new constraints `v + w <= b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var, d); - else + } + else { add_octagonal_constraint(n_var + 1, n_w, d); + } } break; } @@ -4389,18 +4653,22 @@ if (w_coeff == denominator) { // Add the new constraint `v - w >= b/denominator', // i.e., `-v + w <= -b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var + 1, d); - else + } + else { add_octagonal_constraint(n_var, n_w, d); + } } else if (w_coeff == minus_denom) { // Add the new constraints `v + w >= b/denominator', // i.e., `-v - w <= -b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w, n_var + 1, d); - else + } + else { add_octagonal_constraint(n_var, n_w + 1, d); + } } break; } @@ -4425,8 +4693,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, sum); @@ -4558,26 +4827,33 @@ // Deduce constraints of the form `v +/- u', where `u != v'. deduce_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, sum); } - else + else { // Here `pinf_count == 1'. if (pinf_index != var_id) { const Coefficient& ppi = sc_expr.coefficient(Variable(pinf_index)); - if (ppi == sc_denom) + if (ppi == sc_denom) { // Add the constraint `v - pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { matrix[2*pinf_index][n_var] = sum; - else + } + else { matrix[n_var + 1][2*pinf_index + 1] = sum; - else + } + } + else { if (ppi == minus_sc_denom) { // Add the constraint `v + pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { matrix[2*pinf_index + 1][n_var] = sum; - else + } + else { matrix[n_var + 1][2*pinf_index] = sum; + } } + } } + } } // Exploit the lower approximation, if possible. @@ -4604,28 +4880,35 @@ deduce_minus_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, neg_sum); } - else + else { // Here `neg_pinf_count == 1'. if (neg_pinf_index != var_id) { const Coefficient& npi = sc_expr.coefficient(Variable(neg_pinf_index)); - if (npi == sc_denom) + if (npi == sc_denom) { // Add the constraint `v - neg_pinf_index >= -neg_sum', // i.e., `neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index] = neg_sum; - else + } + else { matrix[2*neg_pinf_index + 1][n_var + 1] = neg_sum; - else + } + } + else { if (npi == minus_sc_denom) { // Add the constraint `v + neg_pinf_index >= -neg_sum', // i.e., `-neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index + 1] = neg_sum; - else + } + else { matrix[2*neg_pinf_index][n_var + 1] = neg_sum; + } } + } } + } } break; } @@ -4655,18 +4938,21 @@ ++m_iter; const Coefficient& sc_i = sc_expr.coefficient(Variable(id)); const int sign_i = sgn(sc_i); - if (sign_i == 0) + if (sign_i == 0) { continue; + } // Choose carefully: we are approximating `sc_expr'. const N& double_approx_i = (sign_i > 0) ? m_ci[n_i] : m_i[n_i + 1]; if (is_plus_infinity(double_approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = id; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -4698,18 +4984,22 @@ dimension_type pinf_ind = 2*pinf_index; if (expr.coefficient(Variable(pinf_index)) == denominator ) { // Add the constraint `v - pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { add_octagonal_constraint(pinf_ind, n_var, sum); - else + } + else { add_octagonal_constraint(n_var + 1, pinf_ind + 1, sum); + } } else { if (expr.coefficient(Variable(pinf_index)) == minus_denom) { // Add the constraint `v + pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { add_octagonal_constraint(pinf_ind + 1, n_var, sum); - else + } + else { add_octagonal_constraint(n_var + 1, pinf_ind, sum); + } } } } @@ -4740,18 +5030,21 @@ ++m_iter; const Coefficient& sc_i = sc_expr.coefficient(Variable(id)); const int sign_i = sgn(sc_i); - if (sign_i == 0) + if (sign_i == 0) { continue; + } // Choose carefully: we are approximating `-sc_expr'. const N& double_approx_i = (sign_i > 0) ? m_i[n_i + 1] : m_ci[n_i]; if (is_plus_infinity(double_approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = id; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -4787,19 +5080,23 @@ if (expr.coefficient(Variable(pinf_index)) == denominator) { // Add the constraint `v - pinf_index >= -sum', // i.e., `pinf_index - v <= sum'. - if (pinf_index < var_id) + if (pinf_index < var_id) { add_octagonal_constraint(n_var, pinf_ind, sum); - else + } + else { add_octagonal_constraint(pinf_ind + 1, n_var, sum); + } } else { if (expr.coefficient(Variable(pinf_index)) == minus_denom) { // Add the constraint `v + pinf_index >= -sum', // i.e., `-pinf_index - v <= sum'. - if (pinf_index < var_id) + if (pinf_index < var_id) { add_octagonal_constraint(n_var, pinf_ind + 1, sum); - else + } + else { add_octagonal_constraint(pinf_ind, n_var + 1, sum); + } } } } @@ -4821,25 +5118,29 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_image(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "e", expr); + } // `var' should be one of the dimensions of the octagon. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("affine_image(v, e, d)", var_id + 1); + } strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // Number of non-zero coefficients in `expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -4849,8 +5150,9 @@ if (w_id != 0) { ++t; - if (!expr.all_zeroes(1, w_id)) + if (!expr.all_zeroes(1, w_id)) { ++t; + } --w_id; } @@ -4895,17 +5197,19 @@ if (w_id == var_id) { // Here `expr' is of the form: +/- denominator * v + b. const bool sign_symmetry = (w_coeff != denominator); - if (!sign_symmetry && b == 0) + if (!sign_symmetry && b == 0) { // The transformation is the identity function. return; + } // Translate all the constraints on `var' adding or // subtracting the value `b/denominator'. PPL_DIRTY_TEMP(N, d); div_round_up(d, b, denominator); PPL_DIRTY_TEMP(N, minus_d); div_round_up(minus_d, b, minus_denom); - if (sign_symmetry) + if (sign_symmetry) { swap(d, minus_d); + } const row_iterator m_begin = matrix.row_begin(); const row_iterator m_end = matrix.row_end(); row_iterator m_iter = m_begin + n_var; @@ -4919,8 +5223,9 @@ add_assign_r(m_v_j, m_v_j, minus_d, ROUND_UP); N& m_cv_j = m_cv[j]; add_assign_r(m_cv_j, m_cv_j, d, ROUND_UP); - if (sign_symmetry) + if (sign_symmetry) { swap(m_v_j, m_cv_j); + } } for ( ; m_iter != m_end; ++m_iter) { row_reference m_i = *m_iter; @@ -4928,8 +5233,9 @@ add_assign_r(m_i_v, m_i_v, d, ROUND_UP); N& m_i_cv = m_i[n_var + 1]; add_assign_r(m_i_cv, m_i_cv, minus_d, ROUND_UP); - if (sign_symmetry) + if (sign_symmetry) { swap(m_i_v, m_i_cv); + } } // Now update unary constraints on var. mul_2exp_assign_r(d, d, 1, ROUND_UP); @@ -4938,8 +5244,9 @@ mul_2exp_assign_r(minus_d, minus_d, 1, ROUND_UP); N& m_v_cv = m_v[n_var + 1]; add_assign_r(m_v_cv, m_v_cv, minus_d, ROUND_UP); - if (sign_symmetry) + if (sign_symmetry) { swap(m_cv_v, m_v_cv); + } // Note: strong closure is preserved. } else { @@ -5001,8 +5308,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, pos_sum); @@ -5130,25 +5438,32 @@ // Deduce constraints of the form `v +/- u', where `u != v'. deduce_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, pos_sum); } - else + else { // Here `pos_pinf_count == 1'. if (pos_pinf_index != var_id) { const Coefficient& ppi = sc_expr.coefficient(Variable(pos_pinf_index)); - if (ppi == sc_denom) + if (ppi == sc_denom) { // Add the constraint `v - pos_pinf_index <= pos_sum'. - if (var_id < pos_pinf_index) + if (var_id < pos_pinf_index) { matrix[2*pos_pinf_index][n_var] = pos_sum; - else + } + else { matrix[n_var + 1][2*pos_pinf_index + 1] = pos_sum; - else + } + } + else { if (ppi == minus_sc_denom) { // Add the constraint `v + pos_pinf_index <= pos_sum'. - if (var_id < pos_pinf_index) + if (var_id < pos_pinf_index) { matrix[2*pos_pinf_index + 1][n_var] = pos_sum; - else + } + else { matrix[n_var + 1][2*pos_pinf_index] = pos_sum; + } } + } } + } } // Exploit the lower approximation, if possible. @@ -5173,27 +5488,34 @@ // Deduce constraints of the form `-v +/- u', where `u != v'. deduce_minus_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, neg_sum); } - else + else { // Here `neg_pinf_count == 1'. if (neg_pinf_index != var_id) { const Coefficient& npi = sc_expr.coefficient(Variable(neg_pinf_index)); - if (npi == sc_denom) + if (npi == sc_denom) { // Add the constraint `v - neg_pinf_index >= -neg_sum', // i.e., `neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index] = neg_sum; - else + } + else { matrix[2*neg_pinf_index + 1][n_var + 1] = neg_sum; - else + } + } + else { if (npi == minus_sc_denom) { // Add the constraint `v + neg_pinf_index >= -neg_sum', // i.e., `-neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index + 1] = neg_sum; - else + } + else { matrix[2*neg_pinf_index][n_var + 1] = neg_sum; + } } + } } + } } incremental_strong_closure_assign(var); @@ -5214,18 +5536,21 @@ // The dimension of `lf' should not be greater than the dimension // of `*this'. const dimension_type lf_space_dim = lf.space_dimension(); - if (space_dim < lf_space_dim) + if (space_dim < lf_space_dim) { throw_dimension_incompatible("affine_form_image(v, l)", "l", lf); + } // `var' should be one of the dimensions of the octagon. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("affine_form_image(v, l)", var.id() + 1); + } strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // Number of non-zero coefficients in `lf': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -5234,18 +5559,19 @@ dimension_type w_id = 0; // Get information about the number of non-zero coefficients in `lf'. - for (dimension_type i = lf_space_dim; i-- > 0; ) + for (dimension_type i = lf_space_dim; i-- > 0; ) { if (lf.coefficient(Variable(i)) != 0) { - if (t++ == 1) + if (t++ == 1) { break; - else + } + else { w_id = i; + } } + } typedef typename OR_Matrix::row_iterator row_iterator; typedef typename OR_Matrix::row_reference_type row_reference; - typedef typename OR_Matrix::const_row_iterator Row_iterator; - typedef typename OR_Matrix::const_row_reference_type Row_reference; typedef Interval FP_Interval_Type; using std::swap; @@ -5290,13 +5616,15 @@ // Case 2: lf = w_coeff*w + b, with w_coeff = [+/-1, +/-1]. if (w_id == var_id) { // Here lf = w_coeff*v + b, with w_coeff = [+/-1, +/-1]. - if (is_w_coeff_one && is_b_zero) + if (is_w_coeff_one && is_b_zero) { // The transformation is the identity function. return; + } // Translate all the constraints on `var' by adding the value // `b_ub' or subtracting the value `b_lb'. - if (is_w_coeff_minus_one) + if (is_w_coeff_minus_one) { swap(b_ub, b_mlb); + } const row_iterator m_begin = matrix.row_begin(); const row_iterator m_end = matrix.row_end(); row_iterator m_iter = m_begin + n_var; @@ -5310,8 +5638,9 @@ add_assign_r(m_v_j, m_v_j, b_mlb, ROUND_UP); N& m_cv_j = m_cv[j]; add_assign_r(m_cv_j, m_cv_j, b_ub, ROUND_UP); - if (is_w_coeff_minus_one) + if (is_w_coeff_minus_one) { swap(m_v_j, m_cv_j); + } } for ( ; m_iter != m_end; ++m_iter) { row_reference m_i = *m_iter; @@ -5319,8 +5648,9 @@ add_assign_r(m_i_v, m_i_v, b_ub, ROUND_UP); N& m_i_cv = m_i[n_var + 1]; add_assign_r(m_i_cv, m_i_cv, b_mlb, ROUND_UP); - if (is_w_coeff_minus_one) + if (is_w_coeff_minus_one) { swap(m_i_v, m_i_cv); + } } // Now update unary constraints on var. mul_2exp_assign_r(b_ub, b_ub, 1, ROUND_UP); @@ -5329,8 +5659,9 @@ mul_2exp_assign_r(b_mlb, b_mlb, 1, ROUND_UP); N& m_v_cv = m_v[n_var + 1]; add_assign_r(m_v_cv, m_v_cv, b_mlb, ROUND_UP); - if (is_w_coeff_minus_one) + if (is_w_coeff_minus_one) { swap(m_cv_v, m_v_cv); + } // Note: strong closure is preserved. } else { @@ -5339,7 +5670,7 @@ // Remove all constraints on `var'. forget_all_octagonal_constraints(var_id); const dimension_type n_w = 2*w_id; - if (is_w_coeff_one) + if (is_w_coeff_one) { // Add the new constraints `var - w >= b_lb' // `and var - w <= b_ub'. if (var_id < w_id) { @@ -5350,7 +5681,8 @@ add_octagonal_constraint(n_var + 1, n_w + 1, b_ub); add_octagonal_constraint(n_var, n_w, b_mlb); } - else + } + else { // Add the new constraints `var + w >= b_lb' // `and var + w <= b_ub'. if (var_id < w_id) { @@ -5361,6 +5693,7 @@ add_octagonal_constraint(n_var + 1, n_w, b_ub); add_octagonal_constraint(n_var, n_w + 1, b_mlb); } + } incremental_strong_closure_assign(var); } PPL_ASSERT(OK()); @@ -5556,25 +5889,29 @@ denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_preimage(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr); + } // `var' should be one of the dimensions of the octagon. dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("affine_preimage(v, e, d)", var_id + 1); + } strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } const Coefficient& b = expr.inhomogeneous_term(); @@ -5587,8 +5924,9 @@ if (w_id != 0) { ++t; - if (!expr.all_zeroes(1, w_id)) + if (!expr.all_zeroes(1, w_id)) { ++t; + } --w_id; } @@ -5662,31 +6000,36 @@ const Linear_Expression& expr , Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "e", expr); + } // `var' should be one of the dimensions of the octagon. dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", var_id + 1); + } // The relation symbol cannot be a strict relation symbol. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is the disequality relation symbol"); + } if (relsym == EQUAL) { // The relation symbol is "=": @@ -5697,8 +6040,9 @@ strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // Number of non-zero coefficients in `expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -5708,8 +6052,9 @@ if (w_id != 0) { ++t; - if (!expr.all_zeroes(1, w_id)) + if (!expr.all_zeroes(1, w_id)) { ++t; + } --w_id; } @@ -5819,17 +6164,21 @@ const dimension_type n_w = 2*w_id; if (w_coeff == denominator) { // Add the new constraint `v - w <= b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w, n_var, b, denominator); - else + } + else { add_octagonal_constraint(n_var + 1, n_w + 1, b, denominator); + } } else { // Add the new constraint `v + w <= b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var, b, denominator); - else + } + else { add_octagonal_constraint(n_var + 1, n_w, b, denominator); + } } } break; @@ -5891,18 +6240,22 @@ if (w_coeff == denominator) { // Add the new constraint `var - w >= b/denominator', // i.e., `w - var <= -b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var + 1, b, minus_denom); - else + } + else { add_octagonal_constraint(n_var, n_w, b, minus_denom); + } } else { // Add the new constraint `var + w >= b/denominator', // i.e., `-w - var <= -b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w, n_var + 1, b, minus_denom); - else + } + else { add_octagonal_constraint(n_var, n_w + 1, b, minus_denom); + } } } break; @@ -5936,8 +6289,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, sum); @@ -5969,18 +6323,21 @@ ++m_iter; const Coefficient& sc_i = sc_expr.coefficient(Variable(id)); const int sign_i = sgn(sc_i); - if (sign_i == 0) + if (sign_i == 0) { continue; + } // Choose carefully: we are approximating `sc_expr'. const N& double_approx_i = (sign_i > 0) ? m_ci[n_i] : m_i[n_i + 1]; if (is_plus_infinity(double_approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = id; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -6018,26 +6375,31 @@ // Deduce constraints of the form `v +/- u', where `u != v'. deduce_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) + else if (pinf_count == 1) { if (pinf_index != var_id) { const Coefficient& pi = expr.coefficient(Variable(pinf_index)); if (pi == denominator ) { // Add the constraint `v - pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { matrix[2*pinf_index][n_var] = sum; - else + } + else { matrix[n_var + 1][2*pinf_index + 1] = sum; + } } else { if (pi == minus_denom) { // Add the constraint `v + pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { matrix[2*pinf_index + 1][n_var] = sum; - else + } + else { matrix[n_var + 1][2*pinf_index] = sum; + } } } } + } break; } @@ -6063,18 +6425,21 @@ ++m_iter; const Coefficient& sc_i = sc_expr.coefficient(Variable(id)); const int sign_i = sgn(sc_i); - if (sign_i == 0) + if (sign_i == 0) { continue; + } // Choose carefully: we are approximating `-sc_expr'. const N& double_approx_i = (sign_i > 0) ? m_i[n_i + 1] : m_ci[n_i]; if (is_plus_infinity(double_approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = id; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -6113,28 +6478,33 @@ // Deduce constraints of the form `-v +/- u', where `u != v'. deduce_minus_v_pm_u_bounds(var_id, pinf_index, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) + else if (pinf_count == 1) { if (pinf_index != var_id) { const Coefficient& pi = expr.coefficient(Variable(pinf_index)); if (pi == denominator) { // Add the constraint `v - pinf_index >= -sum', // i.e., `pinf_index - v <= sum'. - if (pinf_index < var_id) + if (pinf_index < var_id) { matrix[n_var][2*pinf_index] = sum; - else + } + else { matrix[2*pinf_index + 1][n_var + 1] = sum; + } } else { if (pi == minus_denom) { // Add the constraint `v + pinf_index >= -sum', // i.e., `-pinf_index - v <= sum'. - if (pinf_index < var_id) + if (pinf_index < var_id) { matrix[n_var][2*pinf_index + 1] = sum; - else + } + else { matrix[2*pinf_index][n_var + 1] = sum; + } } } } + } break; } @@ -6156,30 +6526,34 @@ // The dimension of `lhs' should not be greater than the dimension // of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e1", lhs); - + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e2", rhs); + } // Strict relation symbols are not admitted for octagons. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is the disequality relation symbol"); + } strong_closure_assign(); // The image of an empty octagon is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // Number of non-zero coefficients in `lhs': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -6189,8 +6563,9 @@ if (j_lhs != 0) { ++t_lhs; - if (!lhs.all_zeroes(1, j_lhs)) + if (!lhs.all_zeroes(1, j_lhs)) { ++t_lhs; + } --j_lhs; } @@ -6231,10 +6606,12 @@ const Coefficient& denom = lhs.coefficient(v); Relation_Symbol new_relsym = relsym; if (denom < 0) { - if (relsym == LESS_OR_EQUAL) + if (relsym == LESS_OR_EQUAL) { new_relsym = GREATER_OR_EQUAL; - else if (relsym == GREATER_OR_EQUAL) + } + else if (relsym == GREATER_OR_EQUAL) { new_relsym = LESS_OR_EQUAL; + } } Linear_Expression expr = rhs - b_lhs; generalized_affine_image(v, new_relsym, expr, denom); @@ -6244,8 +6621,9 @@ // Compute the set of variables occurring in `lhs'. std::vector lhs_vars; for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end(); - i != i_end; ++i) + i != i_end; ++i) { lhs_vars.push_back(i.variable()); + } const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim); if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) { @@ -6344,30 +6722,35 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0"); + } // `var' should be one of the dimensions of the octagon. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", var_id + 1); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "ub", ub_expr); + } strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // Number of non-zero coefficients in `lb_expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -6377,13 +6760,13 @@ if (w_id != 0) { ++t; - if (!lb_expr.all_zeroes(1, w_id)) + if (!lb_expr.all_zeroes(1, w_id)) { ++t; + } --w_id; } typedef typename OR_Matrix::row_iterator row_iterator; - typedef typename OR_Matrix::row_reference_type row_reference; typedef typename OR_Matrix::const_row_iterator Row_iterator; typedef typename OR_Matrix::const_row_reference_type Row_reference; @@ -6453,17 +6836,22 @@ // +/-denominator * w + b. const dimension_type n_w = 2*w_id; // Add the new constraint `var - w >= b/denominator'. - if (w_coeff == denominator) - if (var_id < w_id) + if (w_coeff == denominator) { + if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var + 1, b, minus_denom); - else + } + else { add_octagonal_constraint(n_var, n_w, b, minus_denom); + } + } else { // Add the new constraint `var + w >= b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w, n_var + 1, b, minus_denom); - else + } + else { add_octagonal_constraint(n_var, n_w + 1, b, minus_denom); + } } PPL_ASSERT(OK()); return; @@ -6494,8 +6882,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -lb_expr; + } const Linear_Expression& sc_expr = is_sc ? lb_expr : minus_expr; PPL_DIRTY_TEMP(N, neg_sum); @@ -6599,22 +6988,28 @@ // Here `neg_pinf_count == 1'. if (neg_pinf_index != var_id) { const Coefficient& npi = sc_expr.coefficient(Variable(neg_pinf_index)); - if (npi == sc_denom) + if (npi == sc_denom) { // Add the constraint `v - neg_pinf_index >= -neg_sum', // i.e., `neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index] = neg_sum; - else + } + else { matrix[2*neg_pinf_index + 1][n_var + 1] = neg_sum; - else + } + } + else { if (npi == minus_sc_denom) { // Add the constraint `v + neg_pinf_index >= -neg_sum', // i.e., `-neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index + 1] = neg_sum; - else + } + else { matrix[2*neg_pinf_index][n_var + 1] = neg_sum; + } } + } } } @@ -6631,31 +7026,36 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", "e", expr); + } // `var' should be one of the dimensions of the octagon. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", var_id + 1); + } // The relation symbol cannot be a strict relation symbol. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is the disequality relation symbol"); + } if (relsym == EQUAL) { // The relation symbol is "=": @@ -6666,8 +7066,9 @@ // The image of an empty octagon is empty too. strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; + } // Check whether the preimage of this affine relation can be easily // computed as the image of its inverse relation. @@ -6692,8 +7093,9 @@ refine(var, relsym, expr, denominator); // If the shrunk OS is empty, its preimage is empty too; ... - if (is_empty()) + if (is_empty()) { return; + } // ... otherwise, since the relation was not invertible, // we just forget all constraints on `var'. forget_all_octagonal_constraints(var_id); @@ -6710,31 +7112,34 @@ // The dimension of `lhs' should not be greater than the dimension // of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)", "e1", lhs); + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)", "e2", rhs); + } // Strict relation symbols are not admitted for octagons. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2)", "r is the disequality relation symbol"); - + } strong_closure_assign(); // The image of an empty octagon is empty. - if (marked_empty()) + if (marked_empty()) { return; - + } // Number of non-zero coefficients in `lhs': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type t_lhs = 0; @@ -6743,9 +7148,10 @@ if (j_lhs != 0) { ++t_lhs; - if (!lhs.all_zeroes(1, j_lhs)) + if (!lhs.all_zeroes(1, j_lhs)) { ++t_lhs; - j_lhs--; + } + --j_lhs; } const Coefficient& b_lhs = lhs.inhomogeneous_term(); @@ -6766,10 +7172,12 @@ const Coefficient& denom = lhs.coefficient(v); Relation_Symbol new_relsym = relsym; if (denom < 0) { - if (relsym == LESS_OR_EQUAL) + if (relsym == LESS_OR_EQUAL) { new_relsym = GREATER_OR_EQUAL; - else if (relsym == GREATER_OR_EQUAL) + } + else if (relsym == GREATER_OR_EQUAL) { new_relsym = LESS_OR_EQUAL; + } } Linear_Expression expr = rhs - b_lhs; generalized_affine_preimage(v, new_relsym, expr, denom); @@ -6780,8 +7188,9 @@ // Compute the set of variables occurring in `lhs'. std::vector lhs_vars; for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end(); - i != i_end; ++i) + i != i_end; ++i) { lhs_vars.push_back(i.variable()); + } const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim); if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) { @@ -6807,8 +7216,9 @@ } // Any image of an empty octagon is empty. - if (is_empty()) + if (is_empty()) { return; + } // Existentially quantify all variables in the lhs. for (dimension_type i = lhs_vars.size(); i-- > 0; ) { dimension_type lhs_vars_i = lhs_vars[i].id(); @@ -6874,30 +7284,35 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0"); + } // `var' should be one of the dimensions of the octagon. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", var_id + 1); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "ub", ub_expr); + } strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } if (ub_expr.coefficient(var) == 0) { refine(var, LESS_OR_EQUAL, ub_expr, denominator); @@ -6926,10 +7341,12 @@ PPL_ASSERT(!marked_empty()); generalized_affine_preimage(var, LESS_OR_EQUAL, ub_expr, denominator); - if (sgn(denominator) == sgn(inverse_denom)) + if (sgn(denominator) == sgn(inverse_denom)) { refine_no_check(var >= new_var) ; - else + } + else { refine_no_check(var <= new_var); + } // Remove the temporarily added dimension. remove_higher_space_dimensions(space_dim-1); } @@ -6937,13 +7354,13 @@ template Constraint_System Octagonal_Shape::constraints() const { - const dimension_type space_dim = space_dimension(); Constraint_System cs; cs.set_space_dimension(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cs = Constraint_System::zero_dim_empty(); + } return cs; } @@ -7047,20 +7464,21 @@ Octagonal_Shape::expand_space_dimension(Variable var, dimension_type m) { // `var' should be one of the dimensions of the vector space. const dimension_type var_id = var.id(); - if (var_id + 1 > space_dim) + if (var_id + 1 > space_dim) { throw_dimension_incompatible("expand_space_dimension(v, m)", var_id + 1); + } // The space dimension of the resulting octagon should not // overflow the maximum allowed space dimension. - if (m > max_space_dimension() - space_dim) + if (m > max_space_dimension() - space_dim) { throw_invalid_argument("expand_dimension(v, m)", "adding m new space dimensions exceeds " "the maximum allowed space dimension"); - + } // Nothing to do, if no dimensions must be added. - if (m == 0) + if (m == 0) { return; - + } // Keep track of the dimension before adding the new ones. const dimension_type old_num_rows = matrix.num_rows(); @@ -7103,8 +7521,9 @@ } // In general, adding a constraint does not preserve the strong closure // of the octagon. - if (marked_strongly_closed()) + if (marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -7113,22 +7532,24 @@ Octagonal_Shape::fold_space_dimensions(const Variables_Set& vars, Variable dest) { // `dest' should be one of the dimensions of the octagon. - if (dest.space_dimension() > space_dim) + if (dest.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", "v", dest); - + } // The folding of no dimensions is a no-op. - if (vars.empty()) + if (vars.empty()) { return; - + } // All variables in `vars' should be dimensions of the octagon. - if (vars.space_dimension() > space_dim) + if (vars.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", vars.space_dimension()); + } // Moreover, `dest.id()' should not occur in `vars'. - if (vars.find(dest.id()) != vars.end()) + if (vars.find(dest.id()) != vars.end()) { throw_invalid_argument("fold_space_dimensions(vs, v)", "v should not occur in vs"); + } // Recompute the elements of the row and the column corresponding // to variable `dest' by taking the join of their value with the @@ -7206,8 +7627,9 @@ const Octagonal_Shape& x = *this; const dimension_type x_space_dim = x.space_dimension(); - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { throw_dimension_incompatible("upper_bound_assign_if_exact(y)", y); + } // The zero-dim case is trivial. if (x_space_dim == 0) { @@ -7219,8 +7641,9 @@ *this = y; return true; } - else if (y.is_empty()) + else if (y.is_empty()) { return true; + } else if (x.is_empty()) { *this = y; return true; @@ -7264,12 +7687,15 @@ const N& ub_i_ci = ub_i[ci]; for (dimension_type j = row_size_i; j-- > 0; ) { // Check redundancy of x_i_j. - if (!x_non_red_i[j]) + if (!x_non_red_i[j]) { continue; + } const N& x_i_j = x_i[j]; // Check 1st condition in BHZ09 theorem. - if (x_i_j >= y_i[j]) + if (x_i_j >= y_i[j]) { continue; + } + const dimension_type cj = coherent_index(j); const dimension_type row_size_cj = OR_Matrix::row_size(cj); row_reference ub_cj = *(ub_m_begin + cj); @@ -7296,12 +7722,14 @@ for (dimension_type ell = row_size_k; ell-- > 0; ) { // Check redundancy of y_k_ell. - if (!y_non_red_k[ell]) + if (!y_non_red_k[ell]) { continue; + } const N& y_k_ell = y_k[ell]; // Check 2nd condition in BHZ09 theorem. - if (y_k_ell >= x_k[ell]) + if (y_k_ell >= x_k[ell]) { continue; + } const dimension_type cell = coherent_index(ell); row_reference ub_cell = *(ub_m_begin + cell); const N& ub_i_ell @@ -7315,37 +7743,43 @@ // Check 3rd condition in BHZ09 theorem. add_assign_r(lhs, x_i_j, y_k_ell, ROUND_UP); add_assign_r(rhs, ub_i_ell, ub_k_j, ROUND_UP); - if (lhs >= rhs) + if (lhs >= rhs) { continue; + } // Check 4th condition in BHZ09 theorem. add_assign_r(rhs, ub_i_ck, ub_cj_ell, ROUND_UP); - if (lhs >= rhs) + if (lhs >= rhs) { continue; + } // Check 5th condition in BHZ09 theorem. assign_r(lhs_copy, lhs, ROUND_NOT_NEEDED); add_assign_r(lhs, lhs_copy, x_i_j, ROUND_UP); add_assign_r(rhs, ub_i_ell, ub_i_ck, ROUND_UP); add_assign_r(rhs, rhs, ub_cj_j, ROUND_UP); - if (lhs >= rhs) + if (lhs >= rhs) { continue; + } // Check 6th condition in BHZ09 theorem. add_assign_r(rhs, ub_k_j, ub_cj_ell, ROUND_UP); add_assign_r(rhs, rhs, ub_i_ci, ROUND_UP); - if (lhs >= rhs) + if (lhs >= rhs) { continue; + } // Check 7th condition of BHZ09 theorem. add_assign_r(lhs, lhs_copy, y_k_ell, ROUND_UP); add_assign_r(rhs, ub_i_ell, ub_cj_ell, ROUND_UP); add_assign_r(rhs, rhs, ub_k_ck, ROUND_UP); - if (lhs >= rhs) + if (lhs >= rhs) { continue; + } // Check 8th (last) condition in BHZ09 theorem. add_assign_r(rhs, ub_k_j, ub_i_ck, ROUND_UP); add_assign_r(rhs, rhs, ub_cell[ell], ROUND_UP); - if (lhs < rhs) + if (lhs < rhs) { // All 8 conditions are satisfied: // upper bound is not exact. return false; + } } } } @@ -7369,9 +7803,9 @@ const Octagonal_Shape& x = *this; const dimension_type x_space_dim = x.space_dimension(); - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { throw_dimension_incompatible("integer_upper_bound_assign_if_exact(y)", y); - + } // The zero-dim case is trivial. if (x_space_dim == 0) { upper_bound_assign(y); @@ -7450,15 +7884,17 @@ const N& ub_i_ci = ub_i[ci]; for (dimension_type j = row_size_i; j-- > 0; ) { // Check redundancy of tx_i_j. - if (!tx_non_red_i[j]) + if (!tx_non_red_i[j]) { continue; + } const N& tx_i_j = tx_i[j]; const dimension_type cj = coherent_index(j); const N& eps_i_j = (i == cj) ? temp_two : temp_one; // Check condition 1a in BHZ09 Theorem 6.8. add_assign_r(lhs_i_j, tx_i_j, eps_i_j, ROUND_NOT_NEEDED); - if (lhs_i_j > ty_i[j]) + if (lhs_i_j > ty_i[j]) { continue; + } const dimension_type row_size_cj = OR_Matrix::row_size(cj); row_reference ub_cj = *(ub_m_begin + cj); const N& ub_cj_j = ub_cj[j]; @@ -7484,15 +7920,17 @@ for (dimension_type ell = row_size_k; ell-- > 0; ) { // Check redundancy of y_k_ell. - if (!ty_non_red_k[ell]) + if (!ty_non_red_k[ell]) { continue; + } const N& ty_k_ell = ty_k[ell]; const dimension_type cell = coherent_index(ell); const N& eps_k_ell = (k == cell) ? temp_two : temp_one; // Check condition 1b in BHZ09 Theorem 6.8. add_assign_r(lhs_k_ell, ty_k_ell, eps_k_ell, ROUND_NOT_NEEDED); - if (lhs_k_ell > tx_k[ell]) + if (lhs_k_ell > tx_k[ell]) { continue; + } row_reference ub_cell = *(ub_m_begin + cell); const N& ub_i_ell = (i == ell) @@ -7505,37 +7943,43 @@ // Check condition 2a in BHZ09 Theorem 6.8. add_assign_r(lhs, lhs_i_j, lhs_k_ell, ROUND_NOT_NEEDED); add_assign_r(rhs, ub_i_ell, ub_k_j, ROUND_NOT_NEEDED); - if (lhs > rhs) + if (lhs > rhs) { continue; + } // Check condition 2b in BHZ09 Theorem 6.8. add_assign_r(rhs, ub_i_ck, ub_cj_ell, ROUND_NOT_NEEDED); - if (lhs > rhs) + if (lhs > rhs) { continue; + } // Check condition 3a in BHZ09 Theorem 6.8. assign_r(lhs_copy, lhs, ROUND_NOT_NEEDED); add_assign_r(lhs, lhs, lhs_i_j, ROUND_NOT_NEEDED); add_assign_r(rhs, ub_i_ell, ub_i_ck, ROUND_NOT_NEEDED); add_assign_r(rhs, rhs, ub_cj_j, ROUND_NOT_NEEDED); - if (lhs > rhs) + if (lhs > rhs) { continue; + } // Check condition 3b in BHZ09 Theorem 6.8. add_assign_r(rhs, ub_k_j, ub_cj_ell, ROUND_NOT_NEEDED); add_assign_r(rhs, rhs, ub_i_ci, ROUND_NOT_NEEDED); - if (lhs > rhs) + if (lhs > rhs) { continue; + } // Check condition 4a in BHZ09 Theorem 6.8. add_assign_r(lhs, lhs_copy, lhs_k_ell, ROUND_NOT_NEEDED); add_assign_r(rhs, ub_i_ell, ub_cj_ell, ROUND_NOT_NEEDED); add_assign_r(rhs, rhs, ub_k_ck, ROUND_NOT_NEEDED); - if (lhs > rhs) + if (lhs > rhs) { continue; + } // Check condition 4b in BHZ09 Theorem 6.8. add_assign_r(rhs, ub_k_j, ub_i_ck, ROUND_NOT_NEEDED); add_assign_r(rhs, rhs, ub_cell[ell], ROUND_NOT_NEEDED); - if (lhs <= rhs) + if (lhs <= rhs) { // All 8 conditions are satisfied: // integer upper bound is not exact. return false; + } } } } @@ -7550,17 +7994,19 @@ template void Octagonal_Shape::drop_some_non_integer_points(Complexity_Class) { - if (std::numeric_limits::is_integer) + if (std::numeric_limits::is_integer) { return; + } - const dimension_type space_dim = space_dimension(); strong_closure_assign(); - if (space_dim == 0 || marked_empty()) + if (space_dim == 0 || marked_empty()) { return; + } for (typename OR_Matrix::element_iterator i = matrix.element_begin(), - i_end = matrix.element_end(); i != i_end; ++i) + i_end = matrix.element_end(); i != i_end; ++i) { drop_some_non_integer_points_helper(*i); + } // Unary constraints should have an even integer boundary. PPL_DIRTY_TEMP(N, temp_one); @@ -7589,16 +8035,19 @@ Complexity_Class) { // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("drop_some_non_integer_points(vs, cmpl)", min_space_dim); + } - if (std::numeric_limits::is_integer || min_space_dim == 0) + if (std::numeric_limits::is_integer || min_space_dim == 0) { return; + } strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; + } PPL_DIRTY_TEMP(N, temp_one); assign_r(temp_one, 1, ROUND_NOT_NEEDED); @@ -7649,9 +8098,10 @@ void Octagonal_Shape ::export_interval_constraints(U& dest) const { - if (space_dim > dest.space_dimension()) + if (space_dim > dest.space_dimension()) { throw std::invalid_argument( "Octagonal_Shape::export_interval_constraints"); + } strong_closure_assign(); @@ -7672,8 +8122,9 @@ assign_r(ub, twice_ub, ROUND_NOT_NEEDED); div_2exp_assign_r(ub, ub, 1, ROUND_UP); // FIXME: passing a raw value may not be general enough. - if (!dest.restrict_upper(i, ub.raw_value())) + if (!dest.restrict_upper(i, ub.raw_value())) { return; + } } // Set the lower bound. @@ -7683,8 +8134,9 @@ neg_assign_r(lb, lb, ROUND_NOT_NEEDED); div_2exp_assign_r(lb, lb, 1, ROUND_DOWN); // FIXME: passing a raw value may not be general enough. - if (!dest.restrict_lower(i, lb.raw_value())) + if (!dest.restrict_lower(i, lb.raw_value())) { return; + } } } @@ -7730,49 +8182,61 @@ if (is_additive_inverse(c_i_ii, c_ii_i)) { // It is an equality. PPL_ASSERT(!is_plus_infinity(c_i_ii) && !is_plus_infinity(c_ii_i)); - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } // If the value bound can NOT be divided by 2 exactly, // then we output the constraint `2*v_i = bound'. if (div_2exp_assign_r(half, c_ii_i, 1, ROUND_UP | ROUND_STRICT_RELATION) - == V_EQ) + == V_EQ) { s << v_i << " = " << half; - else + } + else { s << "2*" << v_i << " = " << c_ii_i; + } } else { // We will print unary non-strict inequalities, if any. if (!is_plus_infinity(c_i_ii)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } neg_assign_r(negation, c_i_ii, ROUND_NOT_NEEDED); // If the value bound can NOT be divided by 2 exactly, // then we output the constraint `2*v_i >= negation'. if (div_2exp_assign_r(half, negation, 1, ROUND_UP | ROUND_STRICT_RELATION) - == V_EQ) + == V_EQ) { s << v_i << " >= " << half; - else + } + else { s << "2*" << v_i << " >= " << negation; + } } if (!is_plus_infinity(c_ii_i)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } // If the value bound can NOT be divided by 2 exactly, // then we output the constraint `2*v_i <= bound'. if (div_2exp_assign_r(half, c_ii_i, 1, ROUND_UP | ROUND_STRICT_RELATION) - == V_EQ) + == V_EQ) { s << v_i << " <= " << half; - else + } + else { s << "2*" << v_i << " <= " << c_ii_i; + } } } } @@ -7796,36 +8260,46 @@ if (is_additive_inverse(c_ii_jj, c_i_j)) { // It is an equality. PPL_ASSERT(!is_plus_infinity(c_i_j) && !is_plus_infinity(c_ii_jj)); - if (first) + if (first) { first = false; - else + } + else { s << ", "; - if (sgn(c_i_j) >= 0) + } + if (sgn(c_i_j) >= 0) { s << v_j << " - " << v_i << " = " << c_i_j; - else + } + else { s << v_i << " - " << v_j << " = " << c_ii_jj; + } } else { // We will print non-strict inequalities, if any. if (!is_plus_infinity(c_i_j)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; - if (sgn(c_i_j) >= 0) + } + if (sgn(c_i_j) >= 0) { s << v_j << " - " << v_i << " <= " << c_i_j; + } else { neg_assign_r(negation, c_i_j, ROUND_DOWN); s << v_i << " - " << v_j << " >= " << negation; } } if (!is_plus_infinity(c_ii_jj)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; - if (sgn(c_ii_jj) >= 0) + } + if (sgn(c_ii_jj) >= 0) { s << v_i << " - " << v_j << " <= " << c_ii_jj; + } else { neg_assign_r(negation, c_ii_jj, ROUND_DOWN); s << v_j << " - " << v_i << " >= " << negation; @@ -7839,27 +8313,33 @@ if (is_additive_inverse(c_i_jj, c_ii_j)) { // It is an equality. PPL_ASSERT(!is_plus_infinity(c_i_jj) && !is_plus_infinity(c_ii_j)); - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } s << v_j << " + " << v_i << " = " << c_ii_j; } else { // We will print non-strict inequalities, if any. if (!is_plus_infinity(c_i_jj)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } neg_assign_r(negation, c_i_jj, ROUND_DOWN); s << v_j << " + " << v_i << " >= " << negation; } if (!is_plus_infinity(c_ii_j)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } s << v_j << " + " << v_i << " <= " << c_ii_j; } } @@ -7886,17 +8366,21 @@ Octagonal_Shape::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "space_dim") + if (!(s >> str) || str != "space_dim") { return false; + } - if (!(s >> space_dim)) + if (!(s >> space_dim)) { return false; + } - if (!status.ascii_load(s)) + if (!status.ascii_load(s)) { return false; + } - if (!matrix.ascii_load(s)) + if (!matrix.ascii_load(s)) { return false; + } PPL_ASSERT(OK()); return true; @@ -7912,26 +8396,30 @@ bool Octagonal_Shape::OK() const { // Check whether the matrix is well-formed. - if (!matrix.OK()) + if (!matrix.OK()) { return false; + } // Check whether the status information is legal. - if (!status.OK()) + if (!status.OK()) { return false; + } // All empty octagons are OK. - if (marked_empty()) + if (marked_empty()) { return true; + } // 0-dim universe octagon is OK. - if (space_dim == 0) + if (space_dim == 0) { return true; + } // MINUS_INFINITY cannot occur at all. for (typename OR_Matrix::const_row_iterator i = matrix.row_begin(), matrix_row_end = matrix.row_end(); i != matrix_row_end; ++i) { typename OR_Matrix::const_row_reference_type x_i = *i; - for (dimension_type j = i.row_size(); j-- > 0; ) + for (dimension_type j = i.row_size(); j-- > 0; ) { if (is_minus_infinity(x_i[j])) { #ifndef NDEBUG using namespace Parma_Polyhedra_Library::IO_Operators; @@ -7942,6 +8430,7 @@ #endif return false; } + } } // On the main diagonal only PLUS_INFINITY can occur. @@ -7980,13 +8469,14 @@ } // A closed octagon must be strong-coherent. - if (marked_strongly_closed()) + if (marked_strongly_closed()) { if (!is_strong_coherent()) { #ifndef NDEBUG std::cerr << "Octagonal_Shape is not strong-coherent!\n"; #endif return false; } + } } // All checks passed. diff -Nru ppl-1.1/src/Octagonal_Shape_types.hh ppl-1.2/src/Octagonal_Shape_types.hh --- ppl-1.1/src/Octagonal_Shape_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Octagonal_Shape_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Og_Status.cc ppl-1.2/src/Og_Status.cc --- ppl-1.1/src/Og_Status.cc 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/src/Og_Status.cc 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,41 @@ +/* BD_Shape::Status class implementation: data objects. + Copyright (C) 2001-2010 Roberto Bagnara + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) + +This file is part of the Parma Polyhedra Library (PPL). + +The PPL is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The PPL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. + +For the most up-to-date information see the Parma Polyhedra Library +site: http://bugseng.com/products/ppl/ . */ + +#include "ppl-config.h" + +namespace Parma_Polyhedra_Library { + +namespace Implementation { + +namespace Octagonal_Shapes { + +// These are the keywords that indicate the individual assertions. +const char* zero_dim_univ = "ZE"; +const char* empty = "EM"; +const char* strong_closed = "SC"; + +} // namespace Octagonal_Shapes + +} // namespace Implementation + +} // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/src/Og_Status_idefs.hh ppl-1.2/src/Og_Status_idefs.hh --- ppl-1.1/src/Og_Status_idefs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Og_Status_idefs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Octagonal_Shape::Status class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Og_Status_inlines.hh ppl-1.2/src/Og_Status_inlines.hh --- ppl-1.1/src/Og_Status_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Og_Status_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Octagonal_Shape::Status class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -72,9 +72,10 @@ inline void Octagonal_Shape::Status::reset_zero_dim_univ() { // This is a no-op if the current status is not zero-dim. - if (flags == ZERO_DIM_UNIV) + if (flags == ZERO_DIM_UNIV) { // In the zero-dim space, if it is not the universe it is empty. flags = EMPTY; + } } template @@ -123,15 +124,17 @@ template inline bool Octagonal_Shape::Status::OK() const { - if (test_zero_dim_univ()) + if (test_zero_dim_univ()) { // Zero-dim universe is OK. return true; + } if (test_empty()) { Status copy = *this; copy.reset_empty(); - if (copy.test_zero_dim_univ()) + if (copy.test_zero_dim_univ()) { return true; + } else { #ifndef NDEBUG std::cerr << "The empty flag is incompatible with any other one." @@ -150,9 +153,9 @@ namespace Octagonal_Shapes { // These are the keywords that indicate the individual assertions. -const std::string zero_dim_univ = "ZE"; -const std::string empty = "EM"; -const std::string strong_closed = "SC"; +extern const char* zero_dim_univ; +extern const char* empty; +extern const char* strong_closed; const char yes = '+'; const char no = '-'; const char separator = ' '; @@ -165,12 +168,13 @@ is on; it is set to false otherwise. */ inline bool -get_field(std::istream& s, const std::string& keyword, bool& positive) { +get_field(std::istream& s, const char* keyword, bool& positive) { std::string str; if (!(s >> str) || (str[0] != yes && str[0] != no) - || str.substr(1) != keyword) + || str.substr(1) != keyword) { return false; + } positive = (str[0] == yes); return true; } @@ -198,23 +202,30 @@ using namespace Implementation::Octagonal_Shapes; PPL_UNINITIALIZED(bool, positive); - if (!get_field(s, zero_dim_univ, positive)) + if (!get_field(s, zero_dim_univ, positive)) { return false; - if (positive) + } + if (positive) { set_zero_dim_univ(); + } - if (!get_field(s, empty, positive)) + if (!get_field(s, empty, positive)) { return false; - if (positive) + } + + if (positive) { set_empty(); + } - if (!get_field(s, strong_closed, positive)) + if (!get_field(s, strong_closed, positive)) { return false; - if (positive) + } + if (positive) { set_strongly_closed(); - else + } + else { reset_strongly_closed(); - + } // Check invariants. PPL_ASSERT(OK()); return true; diff -Nru ppl-1.1/src/Opposite_Floating_Point_Expression_defs.hh ppl-1.2/src/Opposite_Floating_Point_Expression_defs.hh --- ppl-1.1/src/Opposite_Floating_Point_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Opposite_Floating_Point_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declarations for the Opposite_Floating_Point_Expression class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Opposite_Floating_Point_Expression_inlines.hh ppl-1.2/src/Opposite_Floating_Point_Expression_inlines.hh --- ppl-1.1/src/Opposite_Floating_Point_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Opposite_Floating_Point_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Opposite_Floating_Point_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -59,8 +59,9 @@ ::linearize(const FP_Interval_Abstract_Store& int_store, const FP_Linear_Form_Abstract_Store& lf_store, FP_Linear_Form& result) const { - if (!operand->linearize(int_store, lf_store, result)) + if (!operand->linearize(int_store, lf_store, result)) { return false; + } result.negate(); return true; diff -Nru ppl-1.1/src/Opposite_Floating_Point_Expression_types.hh ppl-1.2/src/Opposite_Floating_Point_Expression_types.hh --- ppl-1.1/src/Opposite_Floating_Point_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Opposite_Floating_Point_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/OR_Matrix_defs.hh ppl-1.2/src/OR_Matrix_defs.hh --- ppl-1.1/src/OR_Matrix_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/OR_Matrix_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* OR_Matrix class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,8 +24,8 @@ #ifndef PPL_OR_Matrix_defs_hh #define PPL_OR_Matrix_defs_hh 1 -#include "globals_defs.hh" #include "OR_Matrix_types.hh" +#include "globals_defs.hh" #include "DB_Row_defs.hh" #include "Checked_Number_defs.hh" #include diff -Nru ppl-1.1/src/OR_Matrix_inlines.hh ppl-1.2/src/OR_Matrix_inlines.hh --- ppl-1.1/src/OR_Matrix_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/OR_Matrix_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* OR_Matrix class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,7 +28,7 @@ #include "Checked_Number_defs.hh" #include "C_Polyhedron_defs.hh" #include "distances_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include "checked_defs.hh" #include @@ -192,8 +192,9 @@ OR_Matrix::any_row_iterator::operator++() { ++e; dimension_type increment = e; - if (e % 2 != 0) + if (e % 2 != 0) { ++increment; + } #if PPL_OR_MATRIX_EXTRA_DEBUG else { value.size_ += 2; @@ -246,8 +247,9 @@ difference_type e_dt = static_cast(e); difference_type i_dt = static_cast(i); difference_type increment = m + (m * m) / 2 + m * e_dt; - if (e_dt % 2 == 0 && m % 2 != 0) + if (e_dt % 2 == 0 && m % 2 != 0) { ++increment; + } e_dt += m; i_dt += increment; e = static_cast(e_dt); @@ -270,8 +272,9 @@ OR_Matrix::any_row_iterator::operator+=(Unsigned m) { dimension_type n = m; dimension_type increment = n + (n*n)/2 + n*e; - if (e % 2 == 0 && n % 2 != 0) + if (e % 2 == 0 && n % 2 != 0) { ++increment; + } e += n; i += increment; value.first += increment; @@ -590,8 +593,9 @@ OR_Matrix new_matrix(new_dim); element_iterator j = new_matrix.element_begin(); for (element_iterator i = element_begin(), - mend = element_end(); i != mend; ++i, ++j) + mend = element_end(); i != mend; ++i, ++j) { assign_or_swap(*j, *i); + } m_swap(new_matrix); } } @@ -622,8 +626,9 @@ m_swap(new_matrix); } } - else if (new_dim < space_dim) + else if (new_dim < space_dim) { shrink(new_dim); + } } #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS @@ -638,8 +643,9 @@ Temp& tmp0, Temp& tmp1, Temp& tmp2) { - if (x.num_rows() != y.num_rows()) + if (x.num_rows() != y.num_rows()) { return false; + } assign_r(tmp0, 0, ROUND_NOT_NEEDED); for (typename OR_Matrix::const_element_iterator i = x.element_begin(), j = y.element_begin(), @@ -647,17 +653,18 @@ const T& x_i = *i; const T& y_i = *j; if (is_plus_infinity(x_i)) { - if (is_plus_infinity(y_i)) + if (is_plus_infinity(y_i)) { continue; + } else { pinf: assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); return true; } } - else if (is_plus_infinity(y_i)) + else if (is_plus_infinity(y_i)) { goto pinf; - + } const Temp* tmp1p; const Temp* tmp2p; if (x_i > y_i) { diff -Nru ppl-1.1/src/OR_Matrix_templates.hh ppl-1.2/src/OR_Matrix_templates.hh --- ppl-1.1/src/OR_Matrix_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/OR_Matrix_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* OR_Matrix class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -53,8 +53,9 @@ } // The underlying DB_Row should be OK. - if (!vec.OK(vec.size(), vec_capacity)) + if (!vec.OK(vec.size(), vec_capacity)) { return false; + } // All checks passed. return true; @@ -85,8 +86,9 @@ bool OR_Matrix::ascii_load(std::istream& s) { dimension_type space; - if (!(s >> space)) + if (!(s >> space)) { return false; + } resize_no_copy(space); for (row_iterator i = row_begin(), this_row_end = row_end(); i != this_row_end; ++i) { @@ -94,8 +96,9 @@ const dimension_type rs = i.row_size(); for (dimension_type j = 0; j < rs; ++j) { Result r = input(r_i[j], s, ROUND_CHECK); - if (result_relation(r) != VR_EQ || is_minus_infinity(r_i[j])) + if (result_relation(r) != VR_EQ || is_minus_infinity(r_i[j])) { return false; + } } } PPL_ASSERT(OK()); @@ -112,8 +115,9 @@ m_end = m.row_end(); m_iter != m_end; ++m_iter) { typename OR_Matrix::const_row_reference_type r_m = *m_iter; const dimension_type mr_size = m_iter.row_size(); - for (dimension_type j = 0; j < mr_size; ++j) + for (dimension_type j = 0; j < mr_size; ++j) { s << r_m[j] << " "; + } s << "\n"; } return s; diff -Nru ppl-1.1/src/OR_Matrix_types.hh ppl-1.2/src/OR_Matrix_types.hh --- ppl-1.1/src/OR_Matrix_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/OR_Matrix_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Partial_Function.cc ppl-1.2/src/Partial_Function.cc --- ppl-1.1/src/Partial_Function.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Partial_Function.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Implementation of class Partial_Function (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -31,12 +31,16 @@ void Partial_Function::print(std::ostream& s) const { using namespace Parma_Polyhedra_Library::IO_Operators; - if (has_empty_codomain()) + if (has_empty_codomain()) { s << "empty" << std::endl; - else - for (dimension_type i = 0, i_end = vec.size(); i < i_end; ++i) - if (vec[i] != not_a_dimension()) + } + else { + for (dimension_type i = 0, i_end = vec.size(); i < i_end; ++i) { + if (vec[i] != not_a_dimension()) { s << Variable(i) << " --> " << Variable(vec[i]) << "\n"; + } + } + } } } // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/src/Partial_Function_defs.hh ppl-1.2/src/Partial_Function_defs.hh --- ppl-1.1/src/Partial_Function_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Partial_Function_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Partial_Function class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Partial_Function_inlines.hh ppl-1.2/src/Partial_Function_inlines.hh --- ppl-1.1/src/Partial_Function_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Partial_Function_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Partial_Function class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,8 +24,8 @@ #ifndef PPL_Partial_Function_inlines_hh #define PPL_Partial_Function_inlines_hh 1 +#include "assertions.hh" #include -#include "assert.hh" namespace Parma_Polyhedra_Library { @@ -42,9 +42,10 @@ inline dimension_type Partial_Function::max_in_codomain() const { - if (has_empty_codomain()) + if (has_empty_codomain()) { throw std::runtime_error("Partial_Function::max_in_codomain() called" " when has_empty_codomain()"); + } PPL_ASSERT(codomain.begin() != codomain.end() && max == *codomain.rbegin()); return max; @@ -60,27 +61,31 @@ // Expand `vec' if needed. const dimension_type sz = vec.size(); - if (i >= sz) + if (i >= sz) { vec.insert(vec.end(), i - sz + 1, not_a_dimension()); + } // We cannot remap the same index to another one. PPL_ASSERT(i < vec.size() && vec[i] == not_a_dimension()); vec[i] = j; // Maybe update `max'. - if (j > max) + if (j > max) { max = j; + } PPL_ASSERT(codomain.begin() != codomain.end() && max == *codomain.rbegin()); } inline bool Partial_Function::maps(dimension_type i, dimension_type& j) const { - if (i >= vec.size()) + if (i >= vec.size()) { return false; + } const dimension_type vec_i = vec[i]; - if (vec_i == not_a_dimension()) + if (vec_i == not_a_dimension()) { return false; + } j = vec_i; return true; } diff -Nru ppl-1.1/src/Partial_Function_types.hh ppl-1.2/src/Partial_Function_types.hh --- ppl-1.1/src/Partial_Function_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Partial_Function_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Partially_Reduced_Product_defs.hh ppl-1.2/src/Partially_Reduced_Product_defs.hh --- ppl-1.1/src/Partially_Reduced_Product_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Partially_Reduced_Product_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Partially_Reduced_Product class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Partially_Reduced_Product_inlines.hh ppl-1.2/src/Partially_Reduced_Product_inlines.hh --- ppl-1.1/src/Partially_Reduced_Product_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Partially_Reduced_Product_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Partially_Reduced_Product class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -251,11 +251,13 @@ y.reduce(); D1 d1_copy = d1; bool ub_exact = d1_copy.upper_bound_assign_if_exact(y.d1); - if (!ub_exact) + if (!ub_exact) { return false; + } ub_exact = d2.upper_bound_assign_if_exact(y.d2); - if (!ub_exact) + if (!ub_exact) { return false; + } using std::swap; swap(d1, d1_copy); return true; @@ -598,8 +600,9 @@ ::concatenate_assign(const Partially_Reduced_Product& y) { d1.concatenate_assign(y.d1); d2.concatenate_assign(y.d2); - if (!is_reduced() || !y.is_reduced()) + if (!is_reduced() || !y.is_reduced()) { clear_reduced_flag(); + } } template @@ -668,8 +671,9 @@ Partially_Reduced_Product::reduce() const { Partially_Reduced_Product& dp = const_cast(*this); - if (dp.is_reduced()) + if (dp.is_reduced()) { return false; + } R r; r.product_reduce(dp.d1, dp.d2); set_reduced_flag(); diff -Nru ppl-1.1/src/Partially_Reduced_Product_templates.hh ppl-1.2/src/Partially_Reduced_Product_templates.hh --- ppl-1.1/src/Partially_Reduced_Product_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Partially_Reduced_Product_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Partially_Reduced_Product class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -51,8 +51,9 @@ Constraint_System cs = d2.constraints(); const Constraint_System& cs1 = d1.constraints(); for (Constraint_System::const_iterator i = cs1.begin(), - cs_end = cs1.end(); i != cs_end; ++i) + cs_end = cs1.end(); i != cs_end; ++i) { cs.insert(*i); + } return cs; } @@ -63,8 +64,9 @@ Constraint_System cs = d2.constraints(); const Constraint_System& cs1 = d1.constraints(); for (Constraint_System::const_iterator i = cs1.begin(), - cs_end = cs1.end(); i != cs_end; ++i) + cs_end = cs1.end(); i != cs_end; ++i) { cs.insert(*i); + } if (cs.has_strict_inequalities()) { NNC_Polyhedron ph(cs); return ph.minimized_constraints(); @@ -82,8 +84,9 @@ Congruence_System cgs = d2.congruences(); const Congruence_System& cgs1 = d1.congruences(); for (Congruence_System::const_iterator i = cgs1.begin(), - cgs_end = cgs1.end(); i != cgs_end; ++i) + cgs_end = cgs1.end(); i != cgs_end; ++i) { cgs.insert(*i); + } return cgs; } @@ -94,8 +97,9 @@ Congruence_System cgs = d2.congruences(); const Congruence_System& cgs1 = d1.congruences(); for (Congruence_System::const_iterator i = cgs1.begin(), - cgs_end = cgs1.end(); i != cgs_end; ++i) + cgs_end = cgs1.end(); i != cgs_end; ++i) { cgs.insert(*i); + } Grid gr(cgs); return gr.minimized_congruences(); } @@ -108,7 +112,7 @@ d2.refine_with_constraints(cs); d1.add_recycled_constraints(cs); } - else + else { if (d2.can_recycle_constraint_systems()) { d1.refine_with_constraints(cs); d2.add_recycled_constraints(cs); @@ -117,6 +121,7 @@ d1.add_constraints(cs); d2.add_constraints(cs); } + } clear_reduced_flag(); } @@ -128,7 +133,7 @@ d2.refine_with_congruences(cgs); d1.add_recycled_congruences(cgs); } - else + else { if (d2.can_recycle_congruence_systems()) { d1.refine_with_congruences(cgs); d2.add_recycled_congruences(cgs); @@ -137,6 +142,7 @@ d1.add_congruences(cgs); d2.add_congruences(cgs); } + } clear_reduced_flag(); } @@ -146,10 +152,12 @@ ::relation_with(const Generator& g) const { reduce(); if (Poly_Gen_Relation::nothing() == d1.relation_with(g) - || Poly_Gen_Relation::nothing() == d2.relation_with(g)) + || Poly_Gen_Relation::nothing() == d2.relation_with(g)) { return Poly_Gen_Relation::nothing(); - else + } + else { return Poly_Gen_Relation::subsumes(); + } } template @@ -162,18 +170,24 @@ Poly_Con_Relation result = Poly_Con_Relation::nothing(); - if (relation1.implies(Poly_Con_Relation::is_included())) + if (relation1.implies(Poly_Con_Relation::is_included())) { result = result && Poly_Con_Relation::is_included(); - else if (relation2.implies(Poly_Con_Relation::is_included())) + } + else if (relation2.implies(Poly_Con_Relation::is_included())) { result = result && Poly_Con_Relation::is_included(); - if (relation1.implies(Poly_Con_Relation::saturates())) + } + if (relation1.implies(Poly_Con_Relation::saturates())) { result = result && Poly_Con_Relation::saturates(); - else if (relation2.implies(Poly_Con_Relation::saturates())) + } + else if (relation2.implies(Poly_Con_Relation::saturates())) { result = result && Poly_Con_Relation::saturates(); - if (relation1.implies(Poly_Con_Relation::is_disjoint())) + } + if (relation1.implies(Poly_Con_Relation::is_disjoint())) { result = result && Poly_Con_Relation::is_disjoint(); - else if (relation2.implies(Poly_Con_Relation::is_disjoint())) + } + else if (relation2.implies(Poly_Con_Relation::is_disjoint())) { result = result && Poly_Con_Relation::is_disjoint(); + } return result; } @@ -188,18 +202,24 @@ Poly_Con_Relation result = Poly_Con_Relation::nothing(); - if (relation1.implies(Poly_Con_Relation::is_included())) + if (relation1.implies(Poly_Con_Relation::is_included())) { result = result && Poly_Con_Relation::is_included(); - else if (relation2.implies(Poly_Con_Relation::is_included())) + } + else if (relation2.implies(Poly_Con_Relation::is_included())) { result = result && Poly_Con_Relation::is_included(); - if (relation1.implies(Poly_Con_Relation::saturates())) + } + if (relation1.implies(Poly_Con_Relation::saturates())) { result = result && Poly_Con_Relation::saturates(); - else if (relation2.implies(Poly_Con_Relation::saturates())) + } + else if (relation2.implies(Poly_Con_Relation::saturates())) { result = result && Poly_Con_Relation::saturates(); - if (relation1.implies(Poly_Con_Relation::is_disjoint())) + } + if (relation1.implies(Poly_Con_Relation::is_disjoint())) { result = result && Poly_Con_Relation::is_disjoint(); - else if (relation2.implies(Poly_Con_Relation::is_disjoint())) + } + else if (relation2.implies(Poly_Con_Relation::is_disjoint())) { result = result && Poly_Con_Relation::is_disjoint(); + } return result; } @@ -213,8 +233,9 @@ bool& maximum) const { reduce(); - if (is_empty()) + if (is_empty()) { return false; + } PPL_DIRTY_TEMP_COEFFICIENT(sup1_n); PPL_DIRTY_TEMP_COEFFICIENT(sup1_d); @@ -225,8 +246,9 @@ bool r1 = d1.maximize(expr, sup1_n, sup1_d, maximum1); bool r2 = d2.maximize(expr, sup2_n, sup2_d, maximum2); // If neither is bounded from above, return false. - if (!r1 && !r2) + if (!r1 && !r2) { return false; + } // If only d2 is bounded from above, then use the values for d2. if (!r1) { sup_n = sup2_n; @@ -264,8 +286,9 @@ bool& minimum) const { reduce(); - if (is_empty()) + if (is_empty()) { return false; + } PPL_ASSERT(reduced); PPL_DIRTY_TEMP_COEFFICIENT(inf1_n); @@ -277,8 +300,9 @@ bool r1 = d1.minimize(expr, inf1_n, inf1_d, minimum1); bool r2 = d2.minimize(expr, inf2_n, inf2_d, minimum2); // If neither is bounded from below, return false. - if (!r1 && !r2) + if (!r1 && !r2) { return false; + } // If only d2 is bounded from below, then use the values for d2. if (!r1) { inf_n = inf2_n; @@ -317,8 +341,9 @@ Generator& g) const { reduce(); - if (is_empty()) + if (is_empty()) { return false; + } PPL_ASSERT(reduced); PPL_DIRTY_TEMP_COEFFICIENT(sup1_n); @@ -332,8 +357,9 @@ bool r1 = d1.maximize(expr, sup1_n, sup1_d, maximum1, g1); bool r2 = d2.maximize(expr, sup2_n, sup2_d, maximum2, g2); // If neither is bounded from above, return false. - if (!r1 && !r2) + if (!r1 && !r2) { return false; + } // If only d2 is bounded from above, then use the values for d2. if (!r1) { sup_n = sup2_n; @@ -376,8 +402,9 @@ Generator& g) const { reduce(); - if (is_empty()) + if (is_empty()) { return false; + } PPL_ASSERT(reduced); PPL_DIRTY_TEMP_COEFFICIENT(inf1_n); @@ -391,8 +418,9 @@ bool r1 = d1.minimize(expr, inf1_n, inf1_d, minimum1, g1); bool r2 = d2.minimize(expr, inf2_n, inf2_d, minimum2, g2); // If neither is bounded from below, return false. - if (!r1 && !r2) + if (!r1 && !r2) { return false; + } // If only d2 is bounded from below, then use the values for d2. if (!r1) { inf_n = inf2_n; @@ -434,8 +462,9 @@ /* Force dp1 reduction */ dp1.clear_reduced_flag(); dp1.reduce(); - if (dp1 != dp2) + if (dp1 != dp2) { return false; + } } return d1.OK() && d2.OK(); } @@ -446,23 +475,30 @@ const char yes = '+'; const char no = '-'; std::string str; - if (!(s >> str) || str != "Partially_Reduced_Product") + if (!(s >> str) || str != "Partially_Reduced_Product") { return false; + } if (!(s >> str) || (str[0] != yes && str[0] != no) - || str.substr(1) != "reduced") + || str.substr(1) != "reduced") { return false; + } reduced = (str[0] == yes); - if (!(s >> str) || str != "Domain") + if (!(s >> str) || str != "Domain") { return false; - if (!(s >> str) || str != "1:") + } + if (!(s >> str) || str != "1:") { return false; - if (!d1.ascii_load(s)) + } + if (!d1.ascii_load(s)) { return false; - if (!(s >> str) || str != "Domain") + } + if (!(s >> str) || str != "Domain") { return false; - if (!(s >> str) || str != "2:") + } + if (!(s >> str) || str != "2:") { return false; + } return d2.ascii_load(s); } @@ -551,17 +587,21 @@ PPL_DIRTY_TEMP_COEFFICIENT(min_increased); // Find the amount by which the maximum value may be decreased. shrink_amount = max_numer % mod; - if (!max_included && shrink_amount == 0) + if (!max_included && shrink_amount == 0) { shrink_amount = mod; - if (shrink_amount < 0) + } + if (shrink_amount < 0) { shrink_amount += mod; + } max_decreased = max_numer - shrink_amount; // Find the amount by which the minimum value may be increased. shrink_amount = min_numer % mod; - if (!min_included && shrink_amount == 0) + if (!min_included && shrink_amount == 0) { shrink_amount = - mod; - if (shrink_amount > 0) + } + if (shrink_amount > 0) { shrink_amount -= mod; + } min_increased = min_numer - shrink_amount; if (max_decreased == min_increased) { // The domain element d2 intersects exactly one hyperplane @@ -603,26 +643,32 @@ for (Congruence_System::const_iterator i = cgs1.begin(), cgs_end = cgs1.end(); i != cgs_end; ++i) { const Congruence& cg1 = *i; - if (cg1.is_equality()) + if (cg1.is_equality()) { d2.refine_with_congruence(cg1); - else + } + else { if (!Parma_Polyhedra_Library:: - shrink_to_congruence_no_check(d1, d2, cg1)) + shrink_to_congruence_no_check(d1, d2, cg1)) { // The product is empty. return; + } + } } // Use the congruences representing d2 to shrink both components. const Congruence_System cgs2 = d2.minimized_congruences(); for (Congruence_System::const_iterator i = cgs2.begin(), cgs_end = cgs2.end(); i != cgs_end; ++i) { const Congruence& cg2 = *i; - if (cg2.is_equality()) + if (cg2.is_equality()) { d1.refine_with_congruence(cg2); - else + } + else { if (!Parma_Polyhedra_Library:: - shrink_to_congruence_no_check(d2, d1, cg2)) + shrink_to_congruence_no_check(d2, d1, cg2)) { // The product is empty. return; + } + } } } @@ -632,8 +678,9 @@ // First do the congruences reduction. Parma_Polyhedra_Library::Congruences_Reduction cgr; cgr.product_reduce(d1, d2); - if (d1.is_empty()) + if (d1.is_empty()) { return; + } PPL_DIRTY_TEMP_COEFFICIENT(freq_n); PPL_DIRTY_TEMP_COEFFICIENT(freq_d); @@ -646,17 +693,20 @@ for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { const Constraint& c = *i; - if (c.is_equality()) + if (c.is_equality()) { continue; + } // Check the frequency and value of the linear expression for // the constraint `c'. Linear_Expression le(c.expression()); - if (!d1.frequency(le, freq_n, freq_d, val_n, val_d)) + if (!d1.frequency(le, freq_n, freq_d, val_n, val_d)) { // Nothing to do. continue; - if (val_n == 0) + } + if (val_n == 0) { // Nothing to do. continue; + } // Adjust the value of the inhomogeneous term to satisfy // the implied congruence. if (val_n < 0) { @@ -675,18 +725,21 @@ for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { const Constraint& c = *i; - if (c.is_equality()) + if (c.is_equality()) { // Equalities already shared. continue; + } // Check the frequency and value of the linear expression for // the constraint `c'. Linear_Expression le(c.expression()); - if (!d2.frequency(le, freq_n, freq_d, val_n, val_d)) + if (!d2.frequency(le, freq_n, freq_d, val_n, val_d)) { // Nothing to do. continue; - if (val_n == 0) + } + if (val_n == 0) { // Nothing to do. continue; + } // Adjust the value of the inhomogeneous term to satisfy // the implied congruence. if (val_n < 0) { diff -Nru ppl-1.1/src/Partially_Reduced_Product_types.hh ppl-1.2/src/Partially_Reduced_Product_types.hh --- ppl-1.1/src/Partially_Reduced_Product_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Partially_Reduced_Product_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Pending_Element_defs.hh ppl-1.2/src/Pending_Element_defs.hh --- ppl-1.1/src/Pending_Element_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pending_Element_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Pending_Element class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Pending_Element_inlines.hh ppl-1.2/src/Pending_Element_inlines.hh --- ppl-1.1/src/Pending_Element_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pending_Element_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Pending_Element class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Pending_Element_types.hh ppl-1.2/src/Pending_Element_types.hh --- ppl-1.1/src/Pending_Element_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pending_Element_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Pending_List_defs.hh ppl-1.2/src/Pending_List_defs.hh --- ppl-1.1/src/Pending_List_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pending_List_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Pending_List class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Pending_List_inlines.hh ppl-1.2/src/Pending_List_inlines.hh --- ppl-1.1/src/Pending_List_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pending_List_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Pending_List class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Pending_List_templates.hh ppl-1.2/src/Pending_List_templates.hh --- ppl-1.1/src/Pending_List_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pending_List_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Pending_List class implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -41,15 +41,16 @@ for (iterator active_list_end = active_list.end(); position != active_list_end && Traits::less_than(position->deadline(), deadline); - ++position) - ; + ++position) { + } iterator pending_element_p; // Only allocate a new element if the free list is empty. - if (free_list.empty()) + if (free_list.empty()) { pending_element_p = new Pending_Element(deadline, handler, expired_flag); + } else { pending_element_p = free_list.begin(); free_list.erase(pending_element_p); @@ -63,11 +64,12 @@ template bool Pending_List::OK() const { - if (!active_list.OK()) + if (!active_list.OK()) { return false; - - if (!free_list.OK()) + } + if (!free_list.OK()) { return false; + } const typename Traits::Threshold* old; const_iterator i = active_list.begin(); diff -Nru ppl-1.1/src/Pending_List_types.hh ppl-1.2/src/Pending_List_types.hh --- ppl-1.1/src/Pending_List_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pending_List_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Ph_Status.cc ppl-1.2/src/Ph_Status.cc --- ppl-1.1/src/Ph_Status.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Ph_Status.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Polyhedron::Status class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -23,7 +23,7 @@ #include "ppl-config.h" #include "Polyhedron_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include #include @@ -55,8 +55,9 @@ std::string str; if (!(s >> str) || (str[0] != '+' && str[0] != '-') - || str.substr(1) != keyword) + || str.substr(1) != keyword) { return false; + } positive = (str[0] == '+'); return true; } @@ -87,71 +88,99 @@ PPL::Polyhedron::Status::ascii_load(std::istream& s) { PPL_UNINITIALIZED(bool, positive); - if (!get_field(s, zero_dim_univ, positive)) + if (!get_field(s, zero_dim_univ, positive)) { return false; - if (positive) + } + if (positive) { set_zero_dim_univ(); + } - if (!get_field(s, empty, positive)) + if (!get_field(s, empty, positive)) { return false; - if (positive) + } + if (positive) { set_empty(); + } - if (!get_field(s, consys_min, positive)) + if (!get_field(s, consys_min, positive)) { return false; - if (positive) + } + if (positive) { set_c_minimized(); - else + } + else { reset_c_minimized(); + } - if (!get_field(s, gensys_min, positive)) + if (!get_field(s, gensys_min, positive)) { return false; - if (positive) + } + if (positive) { set_g_minimized(); - else + } + else { reset_g_minimized(); + } - if (!get_field(s, consys_upd, positive)) + if (!get_field(s, consys_upd, positive)) { return false; - if (positive) + } + if (positive) { set_c_up_to_date(); - else + } + else { reset_c_up_to_date(); + } - if (!get_field(s, gensys_upd, positive)) + if (!get_field(s, gensys_upd, positive)) { return false; - if (positive) + } + if (positive) { set_g_up_to_date(); - else + } + else { reset_g_up_to_date(); + } - if (!get_field(s, consys_pending, positive)) + if (!get_field(s, consys_pending, positive)) { return false; - if (positive) + } + if (positive) { set_c_pending(); - else + } + else { reset_c_pending(); + } - if (!get_field(s, gensys_pending, positive)) + if (!get_field(s, gensys_pending, positive)) { return false; - if (positive) + } + if (positive) { set_g_pending(); - else + } + else { reset_g_pending(); + } - if (!get_field(s, satc_upd, positive)) + if (!get_field(s, satc_upd, positive)) { return false; - if (positive) + } + if (positive) { set_sat_c_up_to_date(); - else + } + else { reset_sat_c_up_to_date(); + } - if (!get_field(s, satg_upd, positive)) + if (!get_field(s, satg_upd, positive)) { return false; - if (positive) + } + if (positive) { set_sat_g_up_to_date(); - else + } + else { reset_sat_g_up_to_date(); + } // Check invariants. PPL_ASSERT(OK()); @@ -165,15 +194,17 @@ using std::cerr; #endif - if (test_zero_dim_univ()) + if (test_zero_dim_univ()) { // Zero-dim universe is OK. return true; + } if (test_empty()) { Status copy = *this; copy.reset_empty(); - if (copy.test_zero_dim_univ()) + if (copy.test_zero_dim_univ()) { return true; + } else { #ifndef NDEBUG cerr << "The empty flag is incompatible with any other one." diff -Nru ppl-1.1/src/Ph_Status_idefs.hh ppl-1.2/src/Ph_Status_idefs.hh --- ppl-1.1/src/Ph_Status_idefs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Ph_Status_idefs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Polyhedron::Status class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Ph_Status_inlines.hh ppl-1.2/src/Ph_Status_inlines.hh --- ppl-1.1/src/Ph_Status_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Ph_Status_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Polyhedron::Status class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -64,9 +64,10 @@ inline void Polyhedron::Status::reset_zero_dim_univ() { // This is a no-op if the current status is not zero-dim. - if (flags == ZERO_DIM_UNIV) + if (flags == ZERO_DIM_UNIV) { // In the zero-dim space, if it is not the universe it is empty. flags = EMPTY; + } } inline void diff -Nru ppl-1.1/src/PIP_Problem.cc ppl-1.2/src/PIP_Problem.cc --- ppl-1.1/src/PIP_Problem.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/PIP_Problem.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Problem class implementation: non-inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -33,13 +33,16 @@ s << "Space dimension: " << pip.space_dimension(); s << "\nConstraints:"; for (PIP_Problem::const_iterator i = pip.constraints_begin(), - i_end = pip.constraints_end(); i != i_end; ++i) + i_end = pip.constraints_end(); i != i_end; ++i) { s << "\n" << *i; + } s << "\nProblem parameters: " << pip.parameter_space_dimensions(); - if (pip.get_big_parameter_dimension() == not_a_dimension()) + if (pip.get_big_parameter_dimension() == not_a_dimension()) { s << "\nNo big-parameter set.\n"; - else + } + else { s << "\nBig-parameter: " << Variable(pip.get_big_parameter_dimension()); + } s << "\n"; return s; } @@ -55,10 +58,11 @@ initial_context(), big_parameter_dimension(not_a_dimension()) { // Check for space dimension overflow. - if (dim > max_space_dimension()) + if (dim > max_space_dimension()) { throw std::length_error("PPL::PIP_Problem::PIP_Problem(dim):\n" "dim exceeds the maximum allowed " "space dimension."); + } control_parameters_init(); PPL_ASSERT(OK()); } @@ -93,8 +97,9 @@ void PPL::PIP_Problem::control_parameters_copy(const PIP_Problem& y) { - for (dimension_type i = CONTROL_PARAMETER_NAME_SIZE; i-- > 0; ) + for (dimension_type i = CONTROL_PARAMETER_NAME_SIZE; i-- > 0; ) { control_parameters[i] = y.control_parameters[i]; + } } PPL::PIP_Problem_Status @@ -113,14 +118,16 @@ { PIP_Problem& x = const_cast(*this); // Allocate PIP solution tree root, if needed. - if (current_solution == 0) + if (current_solution == 0) { x.current_solution = new PIP_Solution_Node(this); + } // Properly resize context matrix. const dimension_type new_num_cols = parameters.size() + 1; const dimension_type old_num_cols = initial_context.num_columns(); - if (old_num_cols < new_num_cols) + if (old_num_cols < new_num_cols) { x.initial_context.add_zero_columns(new_num_cols - old_num_cols); + } // Computed once for all (to be used inside loop). const Variables_Set::const_iterator param_begin = parameters.begin(); @@ -140,8 +147,9 @@ // Constraints having a non-zero variable coefficient // should not be inserted in context. - if (!c.expression().all_zeroes_except(parameters, 1, c_space_dim + 1)) + if (!c.expression().all_zeroes_except(parameters, 1, c_space_dim + 1)) { continue; + } check_feasible_context = true; @@ -155,13 +163,15 @@ if (c.inhomogeneous_term() != 0) { itr = row.insert(0, c.inhomogeneous_term()); // Adjust inhomogeneous term if strict. - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { --(*itr); + } } else { // Adjust inhomogeneous term if strict. - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { itr = row.insert(0, -1); + } } dimension_type i = 1; @@ -175,11 +185,13 @@ if (*pi < c_space_dim) { Coefficient_traits::const_reference coeff_pi = c.coefficient(Variable(*pi)); - if (coeff_pi != 0) + if (coeff_pi != 0) { itr = row.insert(itr, i, coeff_pi); + } } - else + else { break; + } } } @@ -194,8 +206,9 @@ last_row = x.initial_context[x.initial_context.num_rows()-2]; for (Row::iterator i = last_row.begin(), - i_end = last_row.end(); i != i_end; ++i) + i_end = last_row.end(); i != i_end; ++i) { neg_assign(*i); + } } } @@ -246,15 +259,17 @@ PPL::PIP_Tree PPL::PIP_Problem::solution() const { - if (status == PARTIALLY_SATISFIABLE) + if (status == PARTIALLY_SATISFIABLE) { solve(); + } return current_solution; } PPL::PIP_Tree PPL::PIP_Problem::optimizing_solution() const { - if (status == PARTIALLY_SATISFIABLE) + if (status == PARTIALLY_SATISFIABLE) { solve(); + } return current_solution; } @@ -322,10 +337,12 @@ return false; } - if (!parameters.OK()) + if (!parameters.OK()) { return false; - if (!initial_context.OK()) + } + if (!initial_context.OK()) { return false; + } if (current_solution != 0) { // Check well formedness of the solution tree. @@ -360,8 +377,9 @@ const dimension_type input_cs_size = input_cs.size(); s << "\ninput_cs( " << input_cs_size << " )\n"; - for (dimension_type i = 0; i < input_cs_size; ++i) + for (dimension_type i = 0; i < input_cs_size; ++i) { input_cs[i].ascii_dump(s); + } s << "\nfirst_pending_constraint: " << first_pending_constraint << "\n"; @@ -413,8 +431,9 @@ s << "\nbig_parameter_dimension: " << big_parameter_dimension << "\n"; s << "\ncurrent_solution: "; - if (current_solution == 0) + if (current_solution == 0) { s << "BOTTOM\n"; + } else if (const PIP_Decision_Node* const dec = current_solution->as_decision()) { s << "DECISION\n"; @@ -433,123 +452,159 @@ bool PPL::PIP_Problem::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "external_space_dim:") + if (!(s >> str) || str != "external_space_dim:") { return false; + } - if (!(s >> external_space_dim)) + if (!(s >> external_space_dim)) { return false; + } - if (!(s >> str) || str != "internal_space_dim:") + if (!(s >> str) || str != "internal_space_dim:") { return false; + } - if (!(s >> internal_space_dim)) + if (!(s >> internal_space_dim)) { return false; + } - if (!(s >> str) || str != "input_cs(") + if (!(s >> str) || str != "input_cs(") { return false; + } dimension_type input_cs_size; - if (!(s >> input_cs_size)) + if (!(s >> input_cs_size)) { return false; + } - if (!(s >> str) || str != ")") + if (!(s >> str) || str != ")") { return false; + } Constraint c(Constraint::zero_dim_positivity()); for (dimension_type i = 0; i < input_cs_size; ++i) { - if (!c.ascii_load(s)) + if (!c.ascii_load(s)) { return false; + } input_cs.push_back(c); } - if (!(s >> str) || str != "first_pending_constraint:") + if (!(s >> str) || str != "first_pending_constraint:") { return false; + } - if (!(s >> first_pending_constraint)) + if (!(s >> first_pending_constraint)) { return false; + } - if (!(s >> str) || str != "status:") + if (!(s >> str) || str != "status:") { return false; + } - if (!(s >> str)) + if (!(s >> str)) { return false; + } - if (str == "UNSATISFIABLE") + if (str == "UNSATISFIABLE") { status = UNSATISFIABLE; - else if (str == "OPTIMIZED") + } + else if (str == "OPTIMIZED") { status = OPTIMIZED; - else if (str == "PARTIALLY_SATISFIABLE") + } + else if (str == "PARTIALLY_SATISFIABLE") { status = PARTIALLY_SATISFIABLE; - else + } + else { return false; + } - if (!(s >> str) || str != "parameters") + if (!(s >> str) || str != "parameters") { return false; + } - if (!parameters.ascii_load(s)) + if (!parameters.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "initial_context") + if (!(s >> str) || str != "initial_context") { return false; + } - if (!initial_context.ascii_load(s)) + if (!initial_context.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "control_parameters") + if (!(s >> str) || str != "control_parameters") { return false; + } for (dimension_type i = 0; i < CONTROL_PARAMETER_NAME_SIZE; ++i) { - if (!(s >> str)) + if (!(s >> str)) { return false; + } Control_Parameter_Value value; - if (str == "CUTTING_STRATEGY_FIRST") + if (str == "CUTTING_STRATEGY_FIRST") { value = CUTTING_STRATEGY_FIRST; - else if (str == "CUTTING_STRATEGY_DEEPEST") + } + else if (str == "CUTTING_STRATEGY_DEEPEST") { value = CUTTING_STRATEGY_DEEPEST; - else if (str == "CUTTING_STRATEGY_ALL") + } + else if (str == "CUTTING_STRATEGY_ALL") { value = CUTTING_STRATEGY_ALL; - else if (str == "PIVOT_ROW_STRATEGY_FIRST") + } + else if (str == "PIVOT_ROW_STRATEGY_FIRST") { value = PIVOT_ROW_STRATEGY_FIRST; - else if (str == "PIVOT_ROW_STRATEGY_MAX_COLUMN") + } + else if (str == "PIVOT_ROW_STRATEGY_MAX_COLUMN") { value = PIVOT_ROW_STRATEGY_MAX_COLUMN; - else + } + else { return false; + } control_parameters[i] = value; } - if (!(s >> str) || str != "big_parameter_dimension:") + if (!(s >> str) || str != "big_parameter_dimension:") { return false; - if (!(s >> big_parameter_dimension)) + } + if (!(s >> big_parameter_dimension)) { return false; + } // Release current_solution tree (if any). delete current_solution; current_solution = 0; // Load current_solution (if any). - if (!(s >> str) || str != "current_solution:") + if (!(s >> str) || str != "current_solution:") { return false; - if (!(s >> str)) + } + if (!(s >> str)) { return false; - if (str == "BOTTOM") + } + if (str == "BOTTOM") { current_solution = 0; + } else if (str == "DECISION") { PIP_Decision_Node* const dec = new PIP_Decision_Node(0, 0, 0); current_solution = dec; - if (!dec->ascii_load(s)) + if (!dec->ascii_load(s)) { return false; + } dec->set_owner(this); } else if (str == "SOLUTION") { PIP_Solution_Node* const sol = new PIP_Solution_Node(0); current_solution = sol; - if (!sol->ascii_load(s)) + if (!sol->ascii_load(s)) { return false; + } sol->set_owner(this); } - else + else { // Unknown node kind. return false; + } PPL_ASSERT(OK()); return true; @@ -578,8 +633,9 @@ const dimension_type m_params) { // Adding no space dims at all is a no-op: // this avoids invalidating problem status (if it was optimized). - if (m_vars == 0 && m_params == 0) + if (m_vars == 0 && m_params == 0) { return; + } // The space dimension of the resulting PIP problem should not // overflow the maximum allowed space dimension. @@ -589,11 +645,12 @@ available -= m_vars; should_throw = (m_params > available); } - if (should_throw) + if (should_throw) { throw std::length_error("PPL::PIP_Problem::" "add_space_dimensions_and_embed(m_v, m_p):\n" "adding m_v+m_p new space dimensions exceeds " "the maximum allowed space dimension."); + } // First add PIP variables ... external_space_dim += m_vars; // ... then add PIP parameters. @@ -602,19 +659,21 @@ ++external_space_dim; } // Update problem status. - if (status != UNSATISFIABLE) + if (status != UNSATISFIABLE) { status = PARTIALLY_SATISFIABLE; + } PPL_ASSERT(OK()); } void PPL::PIP_Problem ::add_to_parameter_space_dimensions(const Variables_Set& p_vars) { - if (p_vars.space_dimension() > external_space_dim) + if (p_vars.space_dimension() > external_space_dim) { throw std::invalid_argument("PPL::PIP_Problem::" "add_to_parameter_space_dimension(p_vars):\n" "*this and p_vars are dimension " "incompatible."); + } const dimension_type original_size = parameters.size(); parameters.insert(p_vars.begin(), p_vars.end()); // Do not allow to turn variables into parameters. @@ -629,8 +688,9 @@ // If a new parameter was inserted, set the internal status to // PARTIALLY_SATISFIABLE. - if (parameters.size() != original_size && status != UNSATISFIABLE) + if (parameters.size() != original_size && status != UNSATISFIABLE) { status = PARTIALLY_SATISFIABLE; + } } void @@ -644,21 +704,24 @@ } input_cs.push_back(c); // Update problem status. - if (status != UNSATISFIABLE) + if (status != UNSATISFIABLE) { status = PARTIALLY_SATISFIABLE; + } } void PPL::PIP_Problem::add_constraints(const Constraint_System& cs) { for (Constraint_System::const_iterator ci = cs.begin(), - ci_end = cs.end(); ci != ci_end; ++ci) + ci_end = cs.end(); ci != ci_end; ++ci) { add_constraint(*ci); + } } bool PPL::PIP_Problem::is_satisfiable() const { - if (status == PARTIALLY_SATISFIABLE) + if (status == PARTIALLY_SATISFIABLE) { solve(); + } return status == OPTIMIZED; } @@ -685,15 +748,17 @@ void PPL::PIP_Problem::set_big_parameter_dimension(dimension_type big_dim) { - if (parameters.count(big_dim) == 0) + if (parameters.count(big_dim) == 0) { throw std::invalid_argument("PPL::PIP_Problem::" "set_big_parameter_dimension(big_dim):\n" "dimension 'big_dim' is not a parameter."); - if (big_dim < internal_space_dim) + } + if (big_dim < internal_space_dim) { throw std::invalid_argument("PPL::PIP_Problem::" "set_big_parameter_dimension(big_dim):\n" "only newly-added parameters can be" "converted into the big parameter."); + } big_parameter_dimension = big_dim; } @@ -701,13 +766,15 @@ PPL::PIP_Problem::external_memory_in_bytes() const { memory_size_type n = initial_context.external_memory_in_bytes(); // Adding the external memory for `current_solution'. - if (current_solution != 0) + if (current_solution != 0) { n += current_solution->total_memory_in_bytes(); + } // Adding the external memory for `input_cs'. n += input_cs.capacity() * sizeof(Constraint); for (const_iterator i = input_cs.begin(), - i_end = input_cs.end(); i != i_end; ++i) + i_end = input_cs.end(); i != i_end; ++i) { n += (i->external_memory_in_bytes()); + } // FIXME: Adding the external memory for `parameters'. n += parameters.size() * sizeof(dimension_type); @@ -738,4 +805,3 @@ "the PIP problem has not been solved."); } } - diff -Nru ppl-1.1/src/PIP_Problem_defs.hh ppl-1.2/src/PIP_Problem_defs.hh --- ppl-1.1/src/PIP_Problem_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/PIP_Problem_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Problem class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,6 +28,7 @@ #include "PIP_Tree_types.hh" #include "globals_types.hh" #include "Linear_Expression_defs.hh" +#include "Matrix_defs.hh" #include "Constraint_defs.hh" #include "Constraint_System_types.hh" #include "Generator_defs.hh" @@ -36,8 +37,6 @@ #include #include -#include "Matrix_defs.hh" - namespace Parma_Polyhedra_Library { namespace IO_Operators { diff -Nru ppl-1.1/src/PIP_Problem_inlines.hh ppl-1.2/src/PIP_Problem_inlines.hh --- ppl-1.1/src/PIP_Problem_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/PIP_Problem_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Problem class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -62,8 +62,9 @@ swap(first_pending_constraint, y.first_pending_constraint); swap(parameters, y.parameters); swap(initial_context, y.initial_context); - for (dimension_type i = CONTROL_PARAMETER_NAME_SIZE; i-- > 0; ) + for (dimension_type i = CONTROL_PARAMETER_NAME_SIZE; i-- > 0; ) { swap(control_parameters[i], y.control_parameters[i]); + } swap(big_parameter_dimension, y.big_parameter_dimension); } diff -Nru ppl-1.1/src/PIP_Problem_templates.hh ppl-1.2/src/PIP_Problem_templates.hh --- ppl-1.1/src/PIP_Problem_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/PIP_Problem_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Problem class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -54,11 +54,12 @@ } // Check for space dimension overflow. - if (dim > max_space_dimension()) + if (dim > max_space_dimension()) { throw std::length_error("PPL::PIP_Problem::" "PIP_Problem(dim, first, last, p_vars):\n" "dim exceeds the maximum allowed " "space dimension."); + } // Check the constraints. for (In i = first; i != last; ++i) { if (i->space_dimension() > dim) { diff -Nru ppl-1.1/src/PIP_Problem_types.hh ppl-1.2/src/PIP_Problem_types.hh --- ppl-1.1/src/PIP_Problem_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/PIP_Problem_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/PIP_Tree.cc ppl-1.2/src/PIP_Tree.cc --- ppl-1.1/src/PIP_Tree.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/PIP_Tree.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Tree related class implementation: non-inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,9 +28,11 @@ #include #include -// #define NOISY_PIP_TREE_STRUCTURE 1 -// #define NOISY_PIP 1 -// #define VERY_NOISY_PIP 1 +#if 0 +#define NOISY_PIP_TREE_STRUCTURE 1 +#define NOISY_PIP 1 +#define VERY_NOISY_PIP 1 +#endif namespace Parma_Polyhedra_Library { @@ -42,8 +44,9 @@ Coefficient_traits::const_reference y, Coefficient_traits::const_reference z) { rem_assign(x, y, z); - if (x < 0) + if (x < 0) { x += z; + } } class Add_Mul_Assign_Row_Helper1 { @@ -121,8 +124,9 @@ const dimension_type params_size = parameters.size(); PPL_ASSERT(params_size == x.num_columns() - 1); const dimension_type new_rows = Implementation::num_constraints(y); - if (new_rows == 0) + if (new_rows == 0) { return; + } const dimension_type old_num_rows = x.num_rows(); x.add_zero_rows(new_rows); @@ -141,19 +145,22 @@ = y_i->inhomogeneous_term(); Variables_Set::const_iterator pj = param_begin; PIP_Tree_Node::Row::iterator itr = x_i.end(); - if (inhomogeneous_term != 0) + if (inhomogeneous_term != 0) { itr = x_i.insert(0, inhomogeneous_term); + } // itr may still be end() but it can still be used as a hint. // TODO: This code could be optimized more (if it's expected that the // size of `parameters' will be greater than the number of nonzero // coefficients in y_i). for (dimension_type j = 1; pj != param_end; ++pj, ++j) { const Variable vj(*pj); - if (vj.space_dimension() > cs_space_dim) + if (vj.space_dimension() > cs_space_dim) { break; + } Coefficient_traits::const_reference c = y_i->coefficient(vj); - if (c != 0) + if (c != 0) { itr = x_i.insert(itr, j, c); + } } WEIGHT_ADD_MUL(102, params_size); } @@ -198,23 +205,26 @@ neg_assign_row(x, y); PIP_Tree_Node::Row::iterator itr = x.insert(0); Coefficient& x_0 = *itr; - if (denom == 1) + if (denom == 1) { --x_0; + } else { PPL_DIRTY_TEMP_COEFFICIENT(mod); pos_rem_assign(mod, x_0, denom); x_0 -= (mod == 0) ? denom : mod; } - if (x_0 == 0) + if (x_0 == 0) { x.reset(itr); + } } // Add to `context' the columns for new artificial parameters. inline void add_artificial_parameters(Matrix& context, const dimension_type num_art_params) { - if (num_art_params > 0) + if (num_art_params > 0) { context.add_zero_columns(num_art_params); + } } // Add to `params' the indices of new artificial parameters. @@ -222,8 +232,9 @@ add_artificial_parameters(Variables_Set& params, const dimension_type space_dim, const dimension_type num_art_params) { - for (dimension_type i = 0; i < num_art_params; ++i) + for (dimension_type i = 0; i < num_art_params; ++i) { params.insert(space_dim + i); + } } // Update `context', `params' and `space_dim' to account for @@ -284,23 +295,28 @@ while (true) { const dimension_type mk = mapping[k]; const bool in_base = basis[k]; - if (++k >= num_vars) + if (++k >= num_vars) { return false; + } if (in_base) { // Reconstitute the identity submatrix part of tableau. if (mk == ja) { // Optimizing for: lhs == lhs_coeff && rhs == 0; - if (lhs_coeff == 0) + if (lhs_coeff == 0) { continue; - else + } + else { return lhs_coeff > 0; + } } if (mk == jb) { // Optimizing for: lhs == 0 && rhs == rhs_coeff; - if (rhs_coeff == 0) + if (rhs_coeff == 0) { continue; - else + } + else { return 0 > rhs_coeff; + } } // Optimizing for: lhs == 0 && rhs == 0; continue; @@ -310,33 +326,42 @@ const PIP_Tree_Node::Row& t_mk = tableau[mk]; Coefficient_traits::const_reference t_mk_ja = t_mk.get(ja); Coefficient_traits::const_reference t_mk_jb = t_mk.get(jb); - if (t_mk_ja == 0) - if (t_mk_jb == 0) + if (t_mk_ja == 0) { + if (t_mk_jb == 0) { continue; + } else { const int rhs_sign = rhs_coeff_sign * sgn(t_mk_jb); - if (0 == rhs_sign) + if (0 == rhs_sign) { continue; - else + } + else { return 0 > rhs_sign; + } } - else + } + else { if (t_mk_jb == 0) { const int lhs_sign = lhs_coeff_sign * sgn(t_mk_ja); - if (lhs_sign == 0) + if (lhs_sign == 0) { continue; - else + } + else { return lhs_sign > 0; + } } else { WEIGHT_ADD(2); lhs = lhs_coeff * t_mk_ja; rhs = rhs_coeff * t_mk_jb; - if (lhs == rhs) + if (lhs == rhs) { continue; - else + } + else { return lhs > rhs; + } } + } } } // This point should be unreachable. @@ -370,9 +395,10 @@ new_candidates.push_back(*i); dimension_type min_column = *i; ++i; - if (i == i_end) + if (i == i_end) { // Only one candidate left, so it is the minimum. break; + } PIP_Tree_Node::Row::const_iterator pivot_itr; pivot_itr = pivot_row.find(min_column); PPL_ASSERT(pivot_itr != pivot_row.end()); @@ -398,9 +424,10 @@ sij_b = sij_a; new_candidates.push_back(min_column); } - else + else { // Optimizing for: lhs == 0 && rhs == 0; new_candidates.push_back(*i); + } } } WEIGHT_ADD_MUL(44, candidates.size()); @@ -411,8 +438,9 @@ PIP_Tree_Node::Row::const_iterator row_itr = row.lower_bound(min_column); PIP_Tree_Node::Row::const_iterator row_end = row.end(); PPL_DIRTY_TEMP_COEFFICIENT(row_jb); - if (row_itr == row_end || row_itr.index() > min_column) + if (row_itr == row_end || row_itr.index() > min_column) { row_jb = 0; + } else { PPL_ASSERT(row_itr.index() == min_column); row_jb = *row_itr; @@ -427,11 +455,13 @@ PPL_DIRTY_TEMP_COEFFICIENT(lhs); PPL_DIRTY_TEMP_COEFFICIENT(rhs); - if (row_itr != row_end && row_itr.index() < *i) + if (row_itr != row_end && row_itr.index() < *i) { row_itr = row.lower_bound(row_itr, *i); + } PPL_DIRTY_TEMP_COEFFICIENT(row_ja); - if (row_itr == row_end || row_itr.index() > *i) + if (row_itr == row_end || row_itr.index() > *i) { row_ja = 0; + } else { PPL_ASSERT(row_itr.index() == *i); row_ja = *row_itr; @@ -442,9 +472,10 @@ // rhs is actually the right-hand side with toggled sign. lhs = sij_b * row_ja; rhs = sij_a * row_jb; - if (lhs == rhs) + if (lhs == rhs) { new_candidates.push_back(*i); - else + } + else { if (lhs < rhs) { new_candidates.clear(); min_column = *i; @@ -452,6 +483,7 @@ sij_b = sij_a; new_candidates.push_back(min_column); } + } } WEIGHT_ADD_MUL(68, candidates.size()); } @@ -475,16 +507,18 @@ const dimension_type num_columns = tableau.num_columns(); PPL_ASSERT(start_j <= pivot_row.size()); - if (start_j == pivot_row.size()) + if (start_j == pivot_row.size()) { // There are no candidates, so there is no minimum. return false; + } // This is used as a set, it is always sorted. std::vector candidates; for (PIP_Tree_Node::Row::const_iterator i = pivot_row.lower_bound(start_j), i_end = pivot_row.end(); i != i_end; ++i) { - if (*i > 0) + if (*i > 0) { candidates.push_back(i.index()); + } } WEIGHT_ADD_MUL(201, candidates.size()); @@ -506,18 +540,21 @@ void gcd_assign_iter(Coefficient& gcd, Iter first, Iter last) { PPL_ASSERT(gcd != 0); - if (gcd < 0) + if (gcd < 0) { neg_assign(gcd); - if (gcd == 1) + } + if (gcd == 1) { return; + } WEIGHT_BEGIN(); for ( ; first != last; ++first) { Coefficient_traits::const_reference coeff = *first; if (coeff != 0) { WEIGHT_ADD(24); gcd_assign(gcd, coeff, gcd); - if (gcd == 1) + if (gcd == 1) { return; + } } } } @@ -532,8 +569,9 @@ /* Find next column with a non-zero value (there should be one). */ ++j_begin; PPL_ASSERT(j_begin != j_end); - for ( ; *j_begin == 0; ++j_begin) + for ( ; *j_begin == 0; ++j_begin) { PPL_ASSERT(j_begin != j_end); + } /* Use it to initialize gcd. */ PPL_DIRTY_TEMP_COEFFICIENT(gcd); gcd = *j_begin; @@ -552,8 +590,9 @@ // Divide all coefficients in row x and denominator y by their GCD. void row_normalize(PIP_Tree_Node::Row& x, Coefficient& denom) { - if (denom == 1) + if (denom == 1) { return; + } PPL_DIRTY_TEMP_COEFFICIENT(gcd); gcd = denom; gcd_assign_iter(gcd, x.begin(), x.end()); @@ -629,22 +668,27 @@ // Reconstitute the identity submatrix part of tableau. if (row_index == pj) { // Optimizing for: lhs == lhs_coeff && rhs == 0; - if (lhs_coeff_sgn == 0) + if (lhs_coeff_sgn == 0) { new_candidates.push_back(*i); - else + } + else { found_better_pivot = (lhs_coeff_sgn > 0); + } } else { if (row_index == challenger_j) { // Optimizing for: lhs == 0 && rhs == rhs_coeff; - if (rhs_coeff_sgn == 0) + if (rhs_coeff_sgn == 0) { new_candidates.push_back(*i); - else + } + else { found_better_pivot = (0 > rhs_coeff_sgn); + } } - else + else { // Optimizing for: lhs == 0 && rhs == 0; new_candidates.push_back(*i); + } } if (found_better_pivot) { pj = challenger_j; @@ -666,8 +710,9 @@ row_value = *row_itr; ++row_itr; } - else + else { row_value = 0; + } PPL_DIRTY_TEMP_COEFFICIENT(row_challenger_value); for (++i; i != i_end; ++i) { const dimension_type challenger_j = i->first; @@ -699,7 +744,9 @@ if (lhs_sign != rhs_sign) { if (lhs_sign > rhs_sign) { +#ifndef NDEBUG pj = challenger_j; +#endif cost = challenger_cost; value = challenger_value; row_value = row_challenger_value; @@ -722,11 +769,14 @@ lhs *= row_value; rhs *= row_challenger_value; - if (lhs == rhs) + if (lhs == rhs) { new_candidates.push_back(*i); + } else { if (lhs > rhs) { +#ifndef NDEBUG pj = challenger_j; +#endif cost = challenger_cost; value = challenger_value; row_value = row_challenger_value; @@ -827,8 +877,9 @@ candidates_t candidates; for (candidates_map_t::iterator i = candidates_map.begin(), i_end = candidates_map.end(); - i != i_end; ++i) + i != i_end; ++i) { candidates.push_back(*i); + } if (!candidates.empty()) { compatibility_check_find_pivot_in_set(candidates, s, mapping, basis); PPL_ASSERT(!candidates.empty()); @@ -876,13 +927,17 @@ artificial_parameters(y.artificial_parameters) { } +PIP_Tree_Node::~PIP_Tree_Node() { +} + PIP_Tree_Node::Artificial_Parameter ::Artificial_Parameter(const Linear_Expression& expr, Coefficient_traits::const_reference d) : Linear_Expression(expr), denom(d) { - if (denom == 0) + if (denom == 0) { throw std::invalid_argument("PIP_Tree_Node::Artificial_Parameter(e, d): " "denominator d is zero."); + } // Normalize if needed. // FIXME: Provide a proper normalization helper. @@ -896,16 +951,20 @@ Coefficient gcd = param_expr.gcd(0, space_dimension() + 1); - if (gcd == 1) + if (gcd == 1) { return; + } - if (gcd == 0) + if (gcd == 0) { gcd = denom; - else + } + else { gcd_assign(gcd, denom, gcd); + } - if (gcd == 1) + if (gcd == 1) { return; + } // Divide coefficients and denominator by their (non-trivial) GCD. PPL_ASSERT(gcd > 1); @@ -919,10 +978,12 @@ PIP_Tree_Node::Artificial_Parameter ::operator==(const PIP_Tree_Node::Artificial_Parameter& y) const { const Artificial_Parameter& x = *this; - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { return false; - if (x.denom != y.denom) + } + if (x.denom != y.denom) { return false; + } return x.is_equal_to(y); } @@ -954,14 +1015,18 @@ bool PIP_Tree_Node::Artificial_Parameter::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "artificial_parameter") + if (!(s >> str) || str != "artificial_parameter") { return false; - if (!Linear_Expression::ascii_load(s)) + } + if (!Linear_Expression::ascii_load(s)) { return false; - if (!(s >> str) || str != "/") + } + if (!(s >> str) || str != "/") { return false; - if (!(s >> denom)) + } + if (!(s >> denom)) { return false; + } PPL_ASSERT(OK()); return true; } @@ -1020,10 +1085,12 @@ : PIP_Tree_Node(owner), false_child(fcp), true_child(tcp) { - if (false_child != 0) + if (false_child != 0) { false_child->set_parent(this); - if (true_child != 0) + } + if (true_child != 0) { true_child->set_parent(this); + } } PIP_Decision_Node::PIP_Decision_Node(const PIP_Decision_Node& y) @@ -1057,10 +1124,12 @@ void PIP_Decision_Node::set_owner(const PIP_Problem* owner) { owner_ = owner; - if (false_child != 0) + if (false_child != 0) { false_child->set_owner(owner); - if (true_child != 0) + } + if (true_child != 0) { true_child->set_owner(owner); + } } bool @@ -1133,7 +1202,7 @@ // Parameter constraint system should contain no strict inequalities. for (Constraint_System::const_iterator - i = constraints_.begin(), i_end = constraints_.end(); i != i_end; ++i) + i = constraints_.begin(), i_end = constraints_.end(); i != i_end; ++i) { if (i->is_strict_inequality()) { #ifndef NDEBUG cerr << "The feasible region of the PIP_Problem parameter context" @@ -1144,6 +1213,7 @@ #endif return false; } + } return true; } @@ -1160,8 +1230,9 @@ dimension_type j_index = 1; Row::const_iterator i = row.begin(); Row::const_iterator i_end = row.end(); - if (i != i_end && i.index() == 0) + if (i != i_end && i.index() == 0) { ++i; + } // NOTE: iterating in [1..num_params]. WEIGHT_BEGIN(); for ( ; i != i_end; ++i) { @@ -1193,13 +1264,15 @@ #ifndef NDEBUG using std::cerr; #endif - if (!PIP_Tree_Node::OK()) + if (!PIP_Tree_Node::OK()) { return false; + } // Check that every member used is OK. - if (!tableau.OK()) + if (!tableau.OK()) { return false; + } // Check coherency of basis, mapping, var_row and var_column if (basis.size() != mapping.size()) { @@ -1261,14 +1334,17 @@ bool PIP_Decision_Node::OK() const { // Perform base class well-formedness check on this node. - if (!PIP_Tree_Node::OK()) + if (!PIP_Tree_Node::OK()) { return false; + } // Recursively check if child nodes are well-formed. - if (false_child != 0 && !false_child->OK()) + if (false_child != 0 && !false_child->OK()) { return false; - if (true_child != 0 && !true_child->OK()) + } + if (true_child != 0 && !true_child->OK()) { return false; + } // Decision nodes should always have a true child. if (true_child == 0) { @@ -1307,12 +1383,13 @@ first_pending_constraint, input_cs, parameters); - if (false_child != 0) + if (false_child != 0) { false_child->update_tableau(pip, external_space_dim, first_pending_constraint, input_cs, parameters); + } PPL_ASSERT(OK()); } @@ -1470,8 +1547,9 @@ // Dump false child (if any). s << "\nfalse_child: "; - if (false_child == 0) + if (false_child == 0) { s << "BOTTOM\n"; + } else if (const PIP_Decision_Node* const dec = false_child->as_decision()) { // Note: this branch should normally be unreachable code. // Since a well-formed decision node having a false child should have @@ -1494,64 +1572,77 @@ std::string str; // Load base class info. - if (!PIP_Tree_Node::ascii_load(s)) + if (!PIP_Tree_Node::ascii_load(s)) { return false; + } // Release the "true" subtree (if any). delete true_child; true_child = 0; // Load true child (if any). - if (!(s >> str) || str != "true_child:") + if (!(s >> str) || str != "true_child:") { return false; - if (!(s >> str)) + } + if (!(s >> str)) { return false; - if (str == "BOTTOM") + } + if (str == "BOTTOM") { // Note: normally unreachable code (see comment on ascii_dump). true_child = 0; + } else if (str == "DECISION") { PIP_Decision_Node* const dec = new PIP_Decision_Node(0, 0, 0); true_child = dec; - if (!dec->ascii_load(s)) + if (!dec->ascii_load(s)) { return false; + } } else if (str == "SOLUTION") { PIP_Solution_Node* const sol = new PIP_Solution_Node(0); true_child = sol; - if (!sol->ascii_load(s)) + if (!sol->ascii_load(s)) { return false; + } } - else + else { // Unknown node kind. return false; + } // Release the "false" subtree (if any). delete false_child; false_child = 0; // Load false child (if any). - if (!(s >> str) || str != "false_child:") + if (!(s >> str) || str != "false_child:") { return false; - if (!(s >> str)) + } + if (!(s >> str)) { return false; - if (str == "BOTTOM") + } + if (str == "BOTTOM") { false_child = 0; + } else if (str == "DECISION") { // Note: normally unreachable code (see comment on ascii_dump). PIP_Decision_Node* const dec = new PIP_Decision_Node(0, 0, 0); false_child = dec; - if (!dec->ascii_load(s)) + if (!dec->ascii_load(s)) { return false; + } } else if (str == "SOLUTION") { PIP_Solution_Node* const sol = new PIP_Solution_Node(0); false_child = sol; - if (!sol->ascii_load(s)) + if (!sol->ascii_load(s)) { return false; + } } - else + else { // Unknown node kind. return false; + } // Loaded all info. PPL_ASSERT(OK()); @@ -1561,8 +1652,9 @@ void PIP_Solution_Node::Tableau::normalize() { - if (denom == 1) + if (denom == 1) { return; + } const dimension_type num_rows = s.num_rows(); @@ -1578,8 +1670,9 @@ if (s_ij != 0) { WEIGHT_ADD(30); gcd_assign(gcd, s_ij, gcd); - if (gcd == 1) + if (gcd == 1) { return; + } } } WEIGHT_BEGIN(); @@ -1590,8 +1683,9 @@ if (t_ij != 0) { WEIGHT_ADD(14); gcd_assign(gcd, t_ij, gcd); - if (gcd == 1) + if (gcd == 1) { return; + } } } } @@ -1727,28 +1821,36 @@ const dimension_type artificial_parameters_size = artificial_parameters.size(); s << "\nartificial_parameters( " << artificial_parameters_size << " )\n"; - for (dimension_type i = 0; i < artificial_parameters_size; ++i) + for (dimension_type i = 0; i < artificial_parameters_size; ++i) { artificial_parameters[i].ascii_dump(s); + } } bool PIP_Tree_Node::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "constraints_") + if (!(s >> str) || str != "constraints_") { return false; + } constraints_.ascii_load(s); - if (!(s >> str) || str != "artificial_parameters(") + if (!(s >> str) || str != "artificial_parameters(") { return false; + } + dimension_type artificial_parameters_size; - if (!(s >> artificial_parameters_size)) + if (!(s >> artificial_parameters_size)) { return false; - if (!(s >> str) || str != ")") + } + + if (!(s >> str) || str != ")") { return false; + } Artificial_Parameter ap; for (dimension_type i = 0; i < artificial_parameters_size; ++i) { - if (!ap.ascii_load(s)) + if (!ap.ascii_load(s)) { return false; + } artificial_parameters.push_back(ap); } @@ -1779,20 +1881,26 @@ bool PIP_Solution_Node::Tableau::ascii_load(std::istream& is) { std::string str; - if (!(is >> str) || str != "denominator") + if (!(is >> str) || str != "denominator") { return false; + } Coefficient d; - if (!(is >> d)) + if (!(is >> d)) { return false; + } denom = d; - if (!(is >> str) || str != "variables") + if (!(is >> str) || str != "variables") { return false; - if (!s.ascii_load(is)) + } + if (!s.ascii_load(is)) { return false; - if (!(is >> str) || str != "parameters") + } + if (!(is >> str) || str != "parameters") { return false; - if (!t.ascii_load(is)) + } + if (!t.ascii_load(is)) { return false; + } PPL_ASSERT(OK()); return true; } @@ -1807,26 +1915,31 @@ os << "\nbasis "; const dimension_type basis_size = basis.size(); os << basis_size; - for (dimension_type i = 0; i < basis_size; ++i) + for (dimension_type i = 0; i < basis_size; ++i) { os << (basis[i] ? " true" : " false"); + } os << "\nmapping "; const dimension_type mapping_size = mapping.size(); os << mapping_size; - for (dimension_type i = 0; i < mapping_size; ++i) + for (dimension_type i = 0; i < mapping_size; ++i) { os << " " << mapping[i]; + } os << "\nvar_row "; const dimension_type var_row_size = var_row.size(); os << var_row_size; - for (dimension_type i = 0; i < var_row_size; ++i) + for (dimension_type i = 0; i < var_row_size; ++i) { os << " " << var_row[i]; + } os << "\nvar_column "; const dimension_type var_column_size = var_column.size(); os << var_column_size; - for (dimension_type i = 0; i < var_column_size; ++i) + for (dimension_type i = 0; i < var_column_size; ++i) { os << " " << var_column[i]; + } + os << "\n"; os << "special_equality_row " << special_equality_row << "\n"; @@ -1859,8 +1972,9 @@ const dimension_type solution_size = solution.size(); os << "solution " << solution_size << "\n"; - for (dimension_type i = 0; i < solution_size; ++i) + for (dimension_type i = 0; i < solution_size; ++i) { solution[i].ascii_dump(os); + } os << "\n"; os << "solution_valid " << (solution_valid ? "true" : "false") << "\n"; @@ -1868,129 +1982,167 @@ bool PIP_Solution_Node::ascii_load(std::istream& is) { - if (!PIP_Tree_Node::ascii_load(is)) + if (!PIP_Tree_Node::ascii_load(is)) { return false; + } std::string str; - if (!(is >> str) || str != "tableau") + if (!(is >> str) || str != "tableau") { return false; - if (!tableau.ascii_load(is)) + } + if (!tableau.ascii_load(is)) { return false; - - if (!(is >> str) || str != "basis") + } + if (!(is >> str) || str != "basis") { return false; + } dimension_type basis_size; - if (!(is >> basis_size)) + if (!(is >> basis_size)) { return false; + } basis.clear(); for (dimension_type i = 0; i < basis_size; ++i) { - if (!(is >> str)) + if (!(is >> str)) { return false; + } bool val = false; - if (str == "true") + if (str == "true") { val = true; - else if (str != "false") + } + else if (str != "false") { return false; + } basis.push_back(val); } - if (!(is >> str) || str != "mapping") + if (!(is >> str) || str != "mapping") { return false; + } dimension_type mapping_size; - if (!(is >> mapping_size)) + if (!(is >> mapping_size)) { return false; + } mapping.clear(); for (dimension_type i = 0; i < mapping_size; ++i) { dimension_type val; - if (!(is >> val)) + if (!(is >> val)) { return false; + } mapping.push_back(val); } - if (!(is >> str) || str != "var_row") + if (!(is >> str) || str != "var_row") { return false; + } dimension_type var_row_size; - if (!(is >> var_row_size)) + if (!(is >> var_row_size)) { return false; + } var_row.clear(); for (dimension_type i = 0; i < var_row_size; ++i) { dimension_type val; - if (!(is >> val)) + if (!(is >> val)) { return false; + } var_row.push_back(val); } - if (!(is >> str) || str != "var_column") + if (!(is >> str) || str != "var_column") { return false; + } dimension_type var_column_size; - if (!(is >> var_column_size)) + if (!(is >> var_column_size)) { return false; + } var_column.clear(); for (dimension_type i = 0; i < var_column_size; ++i) { dimension_type val; - if (!(is >> val)) + if (!(is >> val)) { return false; + } var_column.push_back(val); } - if (!(is >> str) || str != "special_equality_row") + if (!(is >> str) || str != "special_equality_row") { return false; - if (!(is >> special_equality_row)) + } + if (!(is >> special_equality_row)) { return false; + } - if (!(is >> str) || str != "big_dimension") + if (!(is >> str) || str != "big_dimension") { return false; - if (!(is >> big_dimension)) + } + if (!(is >> big_dimension)) { return false; + } - if (!(is >> str) || str != "sign") + if (!(is >> str) || str != "sign") { return false; + } dimension_type sign_size; - if (!(is >> sign_size)) + if (!(is >> sign_size)) { return false; + } + sign.clear(); for (dimension_type i = 0; i < sign_size; ++i) { - if (!(is >> str)) + if (!(is >> str)) { return false; + } Row_Sign val; - if (str == "UNKNOWN") + if (str == "UNKNOWN") { val = UNKNOWN; - else if (str == "ZERO") + } + else if (str == "ZERO") { val = ZERO; - else if (str == "POSITIVE") + } + else if (str == "POSITIVE") { val = POSITIVE; - else if (str == "NEGATIVE") + } + else if (str == "NEGATIVE") { val = NEGATIVE; - else if (str == "MIXED") + } + else if (str == "MIXED") { val = MIXED; - else + } + else { return false; + } sign.push_back(val); } - if (!(is >> str) || str != "solution") + if (!(is >> str) || str != "solution") { return false; + } dimension_type solution_size; - if (!(is >> solution_size)) + if (!(is >> solution_size)) { return false; + } solution.clear(); for (dimension_type i = 0; i < solution_size; ++i) { Linear_Expression val; - if (!val.ascii_load(is)) + if (!val.ascii_load(is)) { return false; + } solution.push_back(val); } - if (!(is >> str) || str != "solution_valid") + if (!(is >> str) || str != "solution_valid") { return false; - if (!(is >> str)) + } + if (!(is >> str)) { return false; - if (str == "true") + } + if (str == "true") { solution_valid = true; - else if (str == "false") + } + else if (str == "false") { solution_valid = false; - else + } + else { return false; + } PPL_ASSERT(OK()); return true; @@ -2003,10 +2155,12 @@ // If a big parameter has been set and its coefficient is not zero, // then return the sign of the coefficient. Coefficient_traits::const_reference x_big = x.get(big_dimension); - if (x_big > 0) + if (x_big > 0) { return POSITIVE; - if (x_big < 0) + } + if (x_big < 0) { return NEGATIVE; + } // Otherwise x_big == 0, then no big parameter involved. } @@ -2014,13 +2168,15 @@ for (Row::const_iterator i = x.begin(), i_end = x.end(); i != i_end; ++i) { Coefficient_traits::const_reference x_i = *i; if (x_i > 0) { - if (sign == NEGATIVE) + if (sign == NEGATIVE) { return MIXED; + } sign = POSITIVE; } else if (x_i < 0) { - if (sign == POSITIVE) + if (sign == POSITIVE) { return MIXED; + } sign = NEGATIVE; } } @@ -2089,8 +2245,9 @@ const bool found_positive_pivot_candidate = compatibility_check_find_pivot(s, mapping, basis, pi, pj); - if (!found_positive_pivot_candidate) + if (!found_positive_pivot_candidate) { return false; + } if (pj == 0) { // No negative RHS: fractional optimum found. @@ -2101,15 +2258,17 @@ // the ordering of cut generation. WEIGHT_BEGIN(); for (dimension_type i = 0; i < num_vars; ++i) { - if (basis[i]) + if (basis[i]) { // Basic variable = 0, hence integer. continue; + } // Not a basic variable. WEIGHT_ADD(70); const dimension_type mi = mapping[i]; Coefficient_traits::const_reference denom = scaling[mi]; - if (s[mi].get(0) % denom == 0) + if (s[mi].get(0) % denom == 0) { continue; + } // Here constant term is not integer. all_integer_vars = false; // Generate a new cut. @@ -2130,17 +2289,20 @@ scaling.push_back(denom); } // Check if an integer solution was found. - if (all_integer_vars) + if (all_integer_vars) { return true; - else + } + else { continue; + } } // Here we have a positive s[pi][pj] pivot. // Normalize the tableau before pivoting. - for (dimension_type i = num_rows; i-- > 0; ) + for (dimension_type i = num_rows; i-- > 0; ) { row_normalize(s[i], scaling[i]); + } // Update basis. { @@ -2172,12 +2334,15 @@ { for (Row::const_iterator j = pivot.begin(), j_end = pivot.end(); j != j_end; ++j) { - if (j.index() == pj) + if (j.index() == pj) { continue; + } Coefficient_traits::const_reference pivot_j = *j; // Do nothing if the j-th pivot element is zero. - if (pivot_j == 0) + if (pivot_j == 0) { continue; + } + WEIGHT_BEGIN(); for (dimension_type i = num_rows; i-- > 0; ) { Row& s_i = s[i]; @@ -2245,8 +2410,9 @@ const Variables_Set& parameters) { // Make sure a parameter column exists, for the inhomogeneous term. - if (tableau.t.num_columns() == 0) + if (tableau.t.num_columns() == 0) { tableau.t.add_zero_columns(1); + } // NOTE: here 'params' stands for problem (i.e., non artificial) parameters. const dimension_type old_num_vars = tableau.s.num_columns(); @@ -2259,11 +2425,13 @@ const dimension_type num_added_vars = num_added_dims - num_added_params; // Resize the two tableau matrices. - if (num_added_vars > 0) + if (num_added_vars > 0) { tableau.s.add_zero_columns(num_added_vars); + } - if (num_added_params > 0) + if (num_added_params > 0) { tableau.t.add_zero_columns(num_added_params, old_num_params + 1); + } dimension_type new_var_column = old_num_vars; const dimension_type initial_space_dim = old_num_vars + old_num_params; @@ -2283,14 +2451,19 @@ basis.insert(nth_iter(basis, new_var_column), true); mapping.insert(nth_iter(mapping, new_var_column), new_var_column); // Update variable id's of slack variables. - for (dimension_type j = var_row.size(); j-- > 0; ) - if (var_row[j] >= new_var_column) + for (dimension_type j = var_row.size(); j-- > 0; ) { + if (var_row[j] >= new_var_column) { ++var_row[j]; - for (dimension_type j = var_column.size(); j-- > 0; ) - if (var_column[j] >= new_var_column) + } + } + for (dimension_type j = var_column.size(); j-- > 0; ) { + if (var_column[j] >= new_var_column) { ++var_column[j]; - if (special_equality_row > 0) + } + } + if (special_equality_row > 0) { ++special_equality_row; + } } var_column.push_back(new_var_column); ++new_var_column; @@ -2327,15 +2500,17 @@ if (constraint.inhomogeneous_term() != 0) { Coefficient& p_row0 = p_row[0]; p_row0 = constraint.inhomogeneous_term(); - if (constraint.is_strict_inequality()) + if (constraint.is_strict_inequality()) { // Transform (expr > 0) into (expr - 1 >= 0). --p_row0; + } p_row0 *= denom; } else { - if (constraint.is_strict_inequality()) + if (constraint.is_strict_inequality()) { // Transform (expr > 0) into (expr - 1 >= 0). neg_assign(p_row[0], denom); + } } WEIGHT_BEGIN(); dimension_type last_dim = 0; @@ -2486,13 +2661,16 @@ dimension_type first_mixed = not_a_dim; for (dimension_type i = 0; i < num_rows; ++i) { Row_Sign& sign_i = sign[i]; - if (sign_i == UNKNOWN || sign_i == MIXED) + if (sign_i == UNKNOWN || sign_i == MIXED) { sign_i = row_sign(tableau.t[i], big_dimension); + } - if (sign_i == NEGATIVE && first_negative == not_a_dim) + if (sign_i == NEGATIVE && first_negative == not_a_dim) { first_negative = i; - else if (sign_i == MIXED && first_mixed == not_a_dim) + } + else if (sign_i == MIXED && first_mixed == not_a_dim) { first_mixed = i; + } } // If no negative parameter row was found, try to refine the sign of @@ -2500,33 +2678,39 @@ if (first_negative == not_a_dim && first_mixed != not_a_dim) { for (dimension_type i = first_mixed; i < num_rows; ++i) { // Consider mixed sign parameter rows only. - if (sign[i] != MIXED) + if (sign[i] != MIXED) { continue; + } const Row& t_i = tableau.t[i]; Row_Sign new_sign = ZERO; // Check compatibility for constraint t_i(z) >= 0. - if (compatibility_check(ctx, t_i)) + if (compatibility_check(ctx, t_i)) { new_sign = POSITIVE; + } // Check compatibility for constraint t_i(z) < 0, // i.e., -t_i(z) - 1 >= 0. Row t_i_complement(num_params); complement_assign(t_i_complement, t_i, tableau_denom); - if (compatibility_check(ctx, t_i_complement)) + if (compatibility_check(ctx, t_i_complement)) { new_sign = (new_sign == POSITIVE) ? MIXED : NEGATIVE; + } // Update sign for parameter row i. sign[i] = new_sign; // Maybe update first_negative and first_mixed. if (new_sign == NEGATIVE && first_negative == not_a_dim) { first_negative = i; - if (i == first_mixed) + if (i == first_mixed) { first_mixed = not_a_dim; + } } else if (new_sign == MIXED) { - if (first_mixed == not_a_dim) + if (first_mixed == not_a_dim) { first_mixed = i; + } } - else if (i == first_mixed) + else if (i == first_mixed) { first_mixed = not_a_dim; + } } } @@ -2539,21 +2723,24 @@ WEIGHT_BEGIN(); for (dimension_type i = first_mixed; i < num_rows; ++i) { // Consider mixed sign parameter rows only. - if (sign[i] != MIXED) + if (sign[i] != MIXED) { continue; + } // Check for a positive variable coefficient. const Row& s_i = tableau.s[i]; bool has_positive = false; { for (Row::const_iterator - j = s_i.begin(), j_end = s_i.end(); j != j_end; ++j) + j = s_i.begin(), j_end = s_i.end(); j != j_end; ++j) { if (*j > 0) { has_positive = true; break; } + } } - if (!has_positive) + if (!has_positive) { continue; + } // Check compatibility of constraint t_i(z) > 0. Row row(tableau.t[i]); PPL_DIRTY_TEMP_COEFFICIENT(mod); @@ -2565,16 +2752,19 @@ // Maybe update sign (and first_* indices). if (compatible) { // Sign is still mixed. - if (first_mixed == not_a_dim) + if (first_mixed == not_a_dim) { first_mixed = i; + } } else { // Sign becomes negative (i.e., no longer mixed). sign[i] = NEGATIVE; - if (first_negative == not_a_dim) + if (first_negative == not_a_dim) { first_negative = i; - if (first_mixed == i) + } + if (first_mixed == i) { first_mixed = not_a_dim; + } } } } @@ -2594,8 +2784,9 @@ dimension_type pi = not_a_dim; dimension_type pj = not_a_dim; for (dimension_type i = first_negative; i < num_rows; ++i) { - if (sign[i] != NEGATIVE) + if (sign[i] != NEGATIVE) { continue; + } dimension_type j; if (!find_lexico_minimal_column(tableau.s, mapping, basis, tableau.s[i], 0, j)) { @@ -2613,9 +2804,10 @@ pi = i; pj = j; if (pip.control_parameters[PIP_Problem::PIVOT_ROW_STRATEGY] - == PIP_Problem::PIVOT_ROW_STRATEGY_FIRST) + == PIP_Problem::PIVOT_ROW_STRATEGY_FIRST) { // Stop at first valid row. break; + } } } @@ -2681,8 +2873,9 @@ PPL_DIRTY_TEMP_COEFFICIENT(s_i_pj); s_i_pj = s_i.get(pj); - if (s_i_pj == 0) + if (s_i_pj == 0) { continue; + } WEIGHT_BEGIN(); Row::iterator itr = s_i.end(); @@ -2726,8 +2919,9 @@ Row::iterator s_i_pj_itr = s_i.find(pj); - if (s_i_pj_itr == s_i.end()) + if (s_i_pj_itr == s_i.end()) { continue; + } // FIXME: the following comment does not make sense. // NOTE: This is a Coefficient& instead of a @@ -2735,8 +2929,9 @@ // modify it. const Coefficient& s_i_pj = *s_i_pj_itr; - if (s_i_pj == 0) + if (s_i_pj == 0) { continue; + } WEIGHT_BEGIN(); Row::iterator k = t_i.end(); @@ -2767,18 +2962,22 @@ Row_Sign& sign_i = sign[i]; switch (sign_i) { case ZERO: - if (product > 0) + if (product > 0) { sign_i = NEGATIVE; - else if (product < 0) + } + else if (product < 0) { sign_i = POSITIVE; + } break; case POSITIVE: - if (product > 0) + if (product > 0) { sign_i = MIXED; + } break; case NEGATIVE: - if (product < 0) + if (product < 0) { sign_i = MIXED; + } break; default: break; @@ -2795,8 +2994,9 @@ for (dimension_type i = num_rows; i-- > 0; ) { Row& s_i = tableau.s[i]; itr = s_i.find(pj); - if (itr == s_i.end()) + if (itr == s_i.end()) { continue; + } WEIGHT_ADD(43); product = *itr * pivot_denom; if (product % s_pivot_pj != 0) { @@ -2833,21 +3033,24 @@ PPL_DIRTY_TEMP_COEFFICIENT(score); for (dimension_type i = first_mixed; i < num_rows; ++i) { // Mixed parameter sign. - if (sign[i] != MIXED) + if (sign[i] != MIXED) { continue; + } // No positive variable coefficient. bool has_positive = false; { const Row& s_i = tableau.s[i]; for (Row::const_iterator - j = s_i.begin(), j_end = s_i.end(); j != j_end; ++j) + j = s_i.begin(), j_end = s_i.end(); j != j_end; ++j) { if (*j > 0) { has_positive = true; break; } + } } - if (has_positive) + if (has_positive) { continue; + } // Minimize parameter coefficient score, // eliminating implicated tautologies (if any). score = 0; @@ -2897,8 +3100,9 @@ // Heuristically choose "best" (mixed) pivoting row. dimension_type best_i = not_a_dim; for (dimension_type i = first_mixed; i < num_rows; ++i) { - if (sign[i] != MIXED) + if (sign[i] != MIXED) { continue; + } score = 0; { WEIGHT_BEGIN(); @@ -3034,8 +3238,9 @@ // a) append into `cs' the constraints of t_node; for (Constraint_System::const_iterator i = t_node->constraints_.begin(), - i_end = t_node->constraints_.end(); i != i_end; ++i) + i_end = t_node->constraints_.end(); i != i_end; ++i) { cs.insert(*i); + } // b) append into `aps' the parameters of t_node; aps.insert(aps.end(), t_node->artificial_parameters.begin(), @@ -3105,17 +3310,19 @@ // Look for any row having non integer parameter coefficients. Coefficient_traits::const_reference denom = tableau.denominator(); for (dimension_type k = 0; k < num_vars; ++k) { - if (basis[k]) + if (basis[k]) { // Basic variable = 0, hence integer. continue; + } const dimension_type i = mapping[k]; const Row& t_i = tableau.t[i]; WEIGHT_BEGIN(); for (Row::const_iterator j = t_i.begin(), j_end = t_i.end(); j != j_end; ++j) { WEIGHT_ADD(27); - if (*j % denom != 0) + if (*j % denom != 0) { goto non_integer; + } } } // The goto was not taken, the solution is integer. @@ -3137,8 +3344,9 @@ if (cutting_strategy == PIP_Problem::CUTTING_STRATEGY_FIRST) { // Find the first row with simplest parametric part. for (dimension_type k = 0; k < num_vars; ++k) { - if (basis[k]) + if (basis[k]) { continue; + } const dimension_type i = mapping[k]; // Count the number of non-integer parameter coefficients. WEIGHT_BEGIN(); @@ -3148,8 +3356,9 @@ j = t_i.begin(), j_end = t_i.end(); j != j_end; ++j) { WEIGHT_ADD(18); pos_rem_assign(mod, *j, denom); - if (mod != 0) + if (mod != 0) { ++pcount; + } } if (pcount > 0 && (best_i == not_a_dim || pcount < best_pcount)) { best_pcount = pcount; @@ -3171,8 +3380,9 @@ std::vector all_best_is; for (dimension_type k = 0; k < num_vars; ++k) { - if (basis[k]) + if (basis[k]) { continue; + } const dimension_type i = mapping[k]; // Compute score and pcount. score = 0; @@ -3219,22 +3429,26 @@ && (best_i == not_a_dim || pcount < best_pcount || (pcount == best_pcount && score > best_score))) { - if (pcount < best_pcount) + if (pcount < best_pcount) { all_best_is.clear(); + } best_i = i; best_pcount = pcount; best_score = score; } - if (pcount > 0) + if (pcount > 0) { all_best_is.push_back(i); + } } - if (cutting_strategy == PIP_Problem::CUTTING_STRATEGY_DEEPEST) + if (cutting_strategy == PIP_Problem::CUTTING_STRATEGY_DEEPEST) { generate_cut(best_i, all_params, ctx, space_dim, indent_level); + } else { PPL_ASSERT(cutting_strategy == PIP_Problem::CUTTING_STRATEGY_ALL); - for (dimension_type k = all_best_is.size(); k-- > 0; ) + for (dimension_type k = all_best_is.size(); k-- > 0; ) { generate_cut(all_best_is[k], all_params, ctx, space_dim, indent_level); + } } } // End of processing for non-integer solutions. @@ -3277,8 +3491,9 @@ Row::const_iterator j = row_t.begin(); Row::const_iterator j_end = row_t.end(); // Skip the element with index 0. - if (j != j_end && j.index() == 0) + if (j != j_end && j.index() == 0) { ++j; + } WEIGHT_BEGIN(); for ( ; j != j_end; ++j) { WEIGHT_ADD(7); @@ -3478,10 +3693,10 @@ } } } - if (ap_column != not_a_dimension()) + if (ap_column != not_a_dimension()) { // If we re-use an existing Artificial_Parameter cut_t[ap_column] = denom; - + } #ifdef NOISY_PIP { using namespace IO_Operators; @@ -3529,8 +3744,9 @@ n += artificial_parameters.capacity() * sizeof(Artificial_Parameter); for (Artificial_Parameter_Sequence::const_iterator ap = art_parameter_begin(), - ap_end = art_parameter_end(); ap != ap_end; ++ap) + ap_end = art_parameter_end(); ap != ap_end; ++ap) { n += (ap->external_memory_in_bytes()); + } return n; } @@ -3540,8 +3756,9 @@ memory_size_type n = PIP_Tree_Node::external_memory_in_bytes(); PPL_ASSERT(true_child != 0); n += true_child->total_memory_in_bytes(); - if (false_child != 0) + if (false_child != 0) { n += false_child->total_memory_in_bytes(); + } return n; } @@ -3569,8 +3786,10 @@ // FIXME: Adding the external memory for `solution'. n += solution.capacity() * sizeof(Linear_Expression); for (std::vector::const_iterator - i = solution.begin(), i_end = solution.end(); i != i_end; ++i) + i = solution.begin(), i_end = solution.end(); + i != i_end; ++i) { n += (i->external_memory_in_bytes()); + } return n; } @@ -3595,12 +3814,15 @@ std::vector pip_dim_is_param(pip_space_dim); for (Variables_Set::const_iterator p = pip_params.begin(), - p_end = pip_params.end(); p != p_end; ++p) + p_end = pip_params.end(); p != p_end; ++p) { pip_dim_is_param[*p] = true; + } dimension_type first_art_dim = pip_space_dim; - for (const PIP_Tree_Node* node = parent(); node != 0; node = node->parent()) + for (const PIP_Tree_Node* node = parent(); + node != 0; node = node->parent()) { first_art_dim += node->art_parameter_count(); + } print_tree(s, indent, pip_dim_is_param, first_art_dim); } @@ -3628,8 +3850,9 @@ Constraint_System::const_iterator ci_end = constraints_.end(); PPL_ASSERT(ci != ci_end); s << *ci; - for (++ci; ci != ci_end; ++ci) + for (++ci; ci != ci_end; ++ci) { s << " and " << *ci; + } s << " then\n"; } @@ -3651,11 +3874,13 @@ indent_and_print(s, indent, "else\n"); - if (false_child != 0) + if (false_child != 0) { false_child->print_tree(s, indent+1, pip_dim_is_param, child_first_art_dim); - else + } + else { indent_and_print(s, indent+1, "_|_\n"); + } } void @@ -3673,10 +3898,12 @@ indent_and_print(s, indent + (no_constraints ? 0 : 1), "{"); const dimension_type pip_space_dim = pip_dim_is_param.size(); for (dimension_type i = 0, num_var = 0; i < pip_space_dim; ++i) { - if (pip_dim_is_param[i]) + if (pip_dim_is_param[i]) { continue; - if (num_var > 0) + } + if (num_var > 0) { s << " ; "; + } using namespace IO_Operators; s << solution[num_var]; ++num_var; @@ -3709,14 +3936,17 @@ for (Variables_Set::const_iterator p = params.begin(), p_end = params.end(); p != p_end; ++p) { const dimension_type param_index = *p; - if (param_index < var.id()) + if (param_index < var.id()) { --solution_index; - else if (param_index == var.id()) + } + else if (param_index == var.id()) { throw std::invalid_argument("PPL::PIP_Solution_Node" "::parametric_values(v):\n" "v is a problem parameter."); - else + } + else { break; + } } update_solution(); @@ -3727,16 +3957,17 @@ void PIP_Solution_Node::update_solution() const { // Avoid doing useless work. - if (solution_valid) + if (solution_valid) { return; - + } const PIP_Problem* const pip = get_owner(); PPL_ASSERT(pip != 0); std::vector pip_dim_is_param(pip->space_dimension()); const Variables_Set& params = pip->parameter_space_dimensions(); for (Variables_Set::const_iterator p = params.begin(), - p_end = params.end(); p != p_end; ++p) + p_end = params.end(); p != p_end; ++p) { pip_dim_is_param[*p] = true; + } update_solution(pip_dim_is_param); } @@ -3745,8 +3976,9 @@ PIP_Solution_Node ::update_solution(const std::vector& pip_dim_is_param) const { // Avoid doing useless work. - if (solution_valid) + if (solution_valid) { return; + } // const_cast required so as to refresh the solution cache. PIP_Solution_Node& x = const_cast(*this); @@ -3757,21 +3989,24 @@ const dimension_type num_all_params = tableau.t.num_columns() - 1; const dimension_type num_art_params = num_all_params - num_pip_params; - if (solution.size() != num_pip_vars) + if (solution.size() != num_pip_vars) { x.solution.resize(num_pip_vars); + } // Compute external "names" (i.e., indices) for all parameters. std::vector all_param_names(num_all_params); // External indices for problem parameters. - for (dimension_type i = 0, p_index = 0; i < num_pip_dims; ++i) + for (dimension_type i = 0, p_index = 0; i < num_pip_dims; ++i) { if (pip_dim_is_param[i]) { all_param_names[p_index] = i; ++p_index; } + } // External indices for artificial parameters. - for (dimension_type i = 0; i < num_art_params; ++i) + for (dimension_type i = 0; i < num_art_params; ++i) { all_param_names[num_pip_params + i] = num_pip_dims + i; + } PPL_DIRTY_TEMP_COEFFICIENT(norm_coeff); @@ -3779,24 +4014,28 @@ for (dimension_type i = num_pip_vars; i-- > 0; ) { Linear_Expression& sol_i = x.solution[i]; sol_i = Linear_Expression(0); - if (basis[i]) + if (basis[i]) { continue; + } const Row& row = tableau.t[mapping[i]]; // Start from index 1 to skip the inhomogeneous term. Row::const_iterator j = row.begin(); Row::const_iterator j_end = row.end(); // Skip the element with index 0. - if (j != j_end && j.index() == 0) + if (j != j_end && j.index() == 0) { ++j; + } for ( ; j != j_end; ++j) { Coefficient_traits::const_reference coeff = *j; - if (coeff == 0) + if (coeff == 0) { continue; + } norm_coeff = coeff / denom; - if (norm_coeff != 0) + if (norm_coeff != 0) { add_mul_assign(sol_i, norm_coeff, Variable(all_param_names[j.index() - 1])); + } } norm_coeff = row.get(0) / denom; sol_i += norm_coeff; diff -Nru ppl-1.1/src/PIP_Tree_defs.hh ppl-1.2/src/PIP_Tree_defs.hh --- ppl-1.1/src/PIP_Tree_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/PIP_Tree_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Tree_Node class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/PIP_Tree_inlines.hh ppl-1.2/src/PIP_Tree_inlines.hh --- ppl-1.1/src/PIP_Tree_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/PIP_Tree_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* PIP_Tree related class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -52,10 +52,6 @@ return denom; } -inline -PIP_Tree_Node::~PIP_Tree_Node() { -} - inline void PIP_Tree_Node::set_parent(const PIP_Decision_Node* p) { parent_ = p; diff -Nru ppl-1.1/src/PIP_Tree_types.hh ppl-1.2/src/PIP_Tree_types.hh --- ppl-1.1/src/PIP_Tree_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/PIP_Tree_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Pointset_Powerset.cc ppl-1.2/src/Pointset_Powerset.cc --- ppl-1.1/src/Pointset_Powerset.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pointset_Powerset.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Pointset_Powerset class implementation: non-inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -61,9 +61,12 @@ PPL::Pointset_Powerset ::geometrically_covers(const Pointset_Powerset& y) const { const Pointset_Powerset& x = *this; - for (const_iterator yi = y.begin(), y_end = y.end(); yi != y_end; ++yi) - if (!check_containment(yi->pointset(), x)) + for (const_iterator yi = y.begin(), y_end = y.end(); + yi != y_end; ++yi) { + if (!check_containment(yi->pointset(), x)) { return false; + } + } return true; } @@ -71,8 +74,9 @@ bool PPL::check_containment(const NNC_Polyhedron& ph, const Pointset_Powerset& ps) { - if (ph.is_empty()) + if (ph.is_empty()) { return true; + } Pointset_Powerset tmp(ph.space_dimension(), EMPTY); tmp.add_disjunct(ph); for (Pointset_Powerset::const_iterator @@ -81,21 +85,25 @@ for (Pointset_Powerset::iterator j = tmp.begin(); j != tmp.end(); ) { const NNC_Polyhedron& pj = j->pointset(); - if (pi.contains(pj)) + if (pi.contains(pj)) { j = tmp.drop_disjunct(j); - else + } + else { ++j; + } } - if (tmp.empty()) + if (tmp.empty()) { return true; + } else { Pointset_Powerset new_disjuncts(ph.space_dimension(), EMPTY); for (Pointset_Powerset::iterator j = tmp.begin(); j != tmp.end(); ) { const NNC_Polyhedron& pj = j->pointset(); - if (pj.is_disjoint_from(pi)) + if (pj.is_disjoint_from(pi)) { ++j; + } else { const std::pair > partition = linear_partition(pi, pj); @@ -163,16 +171,19 @@ le -= c_inhomogeneous_term; PPL_DIRTY_TEMP_COEFFICIENT(n); rem_assign(n, c_inhomogeneous_term, c_modulus); - if (n < 0) + if (n < 0) { n += c_modulus; + } PPL_DIRTY_TEMP_COEFFICIENT(i); - for (i = c_modulus; i-- > 0; ) + for (i = c_modulus; i-- > 0; ) { if (i != n) { Grid gr_tmp(gr_copy); gr_tmp.add_congruence((le+i %= 0) / c_modulus); - if (!gr_tmp.is_empty()) + if (!gr_tmp.is_empty()) { r.add_disjunct(gr_tmp); + } } + } return true; } @@ -191,12 +202,14 @@ Grid gr = q; const Congruence_System& p_congruences = p.congruences(); for (Congruence_System::const_iterator i = p_congruences.begin(), - p_congruences_end = p_congruences.end(); i != p_congruences_end; ++i) + p_congruences_end = p_congruences.end(); + i != p_congruences_end; ++i) { if (!approximate_partition_aux(*i, gr, r)) { finite_partition = false; const Pointset_Powerset s(q); return std::make_pair(gr, s); } + } return std::make_pair(gr, r); } @@ -204,8 +217,9 @@ bool PPL::check_containment(const Grid& ph, const Pointset_Powerset& ps) { - if (ph.is_empty()) + if (ph.is_empty()) { return true; + } Pointset_Powerset tmp(ph.space_dimension(), EMPTY); tmp.add_disjunct(ph); for (Pointset_Powerset::const_iterator @@ -214,21 +228,25 @@ for (Pointset_Powerset::iterator j = tmp.begin(); j != tmp.end(); ) { const Grid& pj = j->pointset(); - if (pi.contains(pj)) + if (pi.contains(pj)) { j = tmp.drop_disjunct(j); - else + } + else { ++j; + } } - if (tmp.empty()) + if (tmp.empty()) { return true; + } else { Pointset_Powerset new_disjuncts(ph.space_dimension(), EMPTY); for (Pointset_Powerset::iterator j = tmp.begin(); j != tmp.end(); ) { const Grid& pj = j->pointset(); - if (pj.is_disjoint_from(pi)) + if (pj.is_disjoint_from(pi)) { ++j; + } else { bool finite_partition; const std::pair > @@ -241,8 +259,9 @@ // ignore checking the remaining temporary disjuncts as they // will all have the same lines and equalities and therefore // also not have a finite partition with respect to pi. - if (!finite_partition) + if (!finite_partition) { break; + } new_disjuncts.upper_bound_assign(partition.second); j = tmp.drop_disjunct(j); } @@ -287,9 +306,12 @@ PPL::Pointset_Powerset ::geometrically_covers(const Pointset_Powerset& y) const { const Pointset_Powerset& x = *this; - for (const_iterator yi = y.begin(), y_end = y.end(); yi != y_end; ++yi) - if (!check_containment(yi->pointset(), x)) + for (const_iterator yi = y.begin(), y_end = y.end(); + yi != y_end; ++yi) { + if (!check_containment(yi->pointset(), x)) { return false; + } + } return true; } @@ -301,9 +323,10 @@ : Base(), space_dim(y.space_dimension()) { Pointset_Powerset& x = *this; for (Pointset_Powerset::const_iterator i = y.begin(), - y_end = y.end(); i != y_end; ++i) + y_end = y.end(); i != y_end; ++i) { x.sequence.push_back(Determinate (NNC_Polyhedron(i->pointset()))); + } x.reduced = y.reduced; PPL_ASSERT_HEAVY(x.OK()); } @@ -316,9 +339,10 @@ : Base(), space_dim(y.space_dimension()) { Pointset_Powerset& x = *this; for (Pointset_Powerset::const_iterator i = y.begin(), - y_end = y.end(); i != y_end; ++i) + y_end = y.end(); i != y_end; ++i) { x.sequence.push_back(Determinate (NNC_Polyhedron(i->pointset()))); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -331,9 +355,10 @@ : Base(), space_dim(y.space_dimension()) { Pointset_Powerset& x = *this; for (Pointset_Powerset::const_iterator i = y.begin(), - y_end = y.end(); i != y_end; ++i) + y_end = y.end(); i != y_end; ++i) { x.sequence.push_back(Determinate (C_Polyhedron(i->pointset()))); + } // Note: this might be non-reduced even when `y' is known to be // omega-reduced, because the constructor of C_Polyhedron, by diff -Nru ppl-1.1/src/Pointset_Powerset_defs.hh ppl-1.2/src/Pointset_Powerset_defs.hh --- ppl-1.1/src/Pointset_Powerset_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pointset_Powerset_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Pointset_Powerset class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -1294,6 +1294,13 @@ typename Cert::Compare>& y_cert_ms) const; + /*! \brief + Template helper: common implementation for constraints + and congruences. + */ + template + Poly_Con_Relation relation_with_aux(const Cons_or_Congr& c) const; + // FIXME: here it should be enough to befriend the template constructor // template // Pointset_Powerset(const Pointset_Powerset&), diff -Nru ppl-1.1/src/Pointset_Powerset_inlines.hh ppl-1.2/src/Pointset_Powerset_inlines.hh --- ppl-1.1/src/Pointset_Powerset_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pointset_Powerset_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Pointset_Powerset class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -55,8 +55,9 @@ Degenerate_Element kind) : Base(), space_dim(num_dimensions) { Pointset_Powerset& x = *this; - if (kind == UNIVERSE) + if (kind == UNIVERSE) { x.sequence.push_back(Determinate(PSET(num_dimensions, kind))); + } PPL_ASSERT_HEAVY(x.OK()); } @@ -74,11 +75,13 @@ : Base(), space_dim(ph.space_dimension()) { Pointset_Powerset& x = *this; if (complexity == ANY_COMPLEXITY) { - if (ph.is_empty()) + if (ph.is_empty()) { return; + } } - else + else { x.reduced = false; + } x.sequence.push_back(Determinate(PSET(ph, complexity))); x.reduced = false; PPL_ASSERT_HEAVY(OK()); @@ -91,11 +94,13 @@ : Base(), space_dim(ph.space_dimension()) { Pointset_Powerset& x = *this; if (complexity == ANY_COMPLEXITY) { - if (ph.is_empty()) + if (ph.is_empty()) { return; + } } - else + else { x.reduced = false; + } x.sequence.push_back(Determinate(PSET(ph, complexity))); PPL_ASSERT_HEAVY(OK()); } @@ -121,11 +126,13 @@ : Base(), space_dim(prp.space_dimension()) { Pointset_Powerset& x = *this; if (complexity == ANY_COMPLEXITY) { - if (prp.is_empty()) + if (prp.is_empty()) { return; + } } - else + else { x.reduced = false; + } x.sequence.push_back(Determinate(PSET(prp, complexity))); x.reduced = false; PPL_ASSERT_HEAVY(OK()); @@ -137,8 +144,9 @@ Complexity_Class) : Base(), space_dim(box.space_dimension()) { Pointset_Powerset& x = *this; - if (!box.is_empty()) + if (!box.is_empty()) { x.sequence.push_back(Determinate(PSET(box))); + } PPL_ASSERT_HEAVY(OK()); } @@ -148,8 +156,9 @@ Complexity_Class) : Base(), space_dim(os.space_dimension()) { Pointset_Powerset& x = *this; - if (!os.is_empty()) + if (!os.is_empty()) { x.sequence.push_back(Determinate(PSET(os))); + } PPL_ASSERT_HEAVY(OK()); } @@ -159,8 +168,9 @@ Complexity_Class) : Base(), space_dim(bds.space_dimension()) { Pointset_Powerset& x = *this; - if (!bds.is_empty()) + if (!bds.is_empty()) { x.sequence.push_back(Determinate(PSET(bds))); + } PPL_ASSERT_HEAVY(OK()); } @@ -210,18 +220,28 @@ inline void Pointset_Powerset::intersection_assign(const Pointset_Powerset& y) { Pointset_Powerset& x = *this; - x.pairwise_apply_assign - (y, - Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::intersection_assign))); + x.pairwise_apply_assign(y, + Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::intersection_assign))); } template inline void Pointset_Powerset::time_elapse_assign(const Pointset_Powerset& y) { Pointset_Powerset& x = *this; - x.pairwise_apply_assign - (y, - Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::time_elapse_assign))); + x.pairwise_apply_assign(y, + Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::time_elapse_assign))); +} + +template +inline Poly_Con_Relation +Pointset_Powerset::relation_with(const Constraint& c) const { + return relation_with_aux(c); +} + +template +inline Poly_Con_Relation +Pointset_Powerset::relation_with(const Congruence& cg) const { + return relation_with_aux(cg); } template diff -Nru ppl-1.1/src/Pointset_Powerset_templates.hh ppl-1.2/src/Pointset_Powerset_templates.hh --- ppl-1.1/src/Pointset_Powerset_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pointset_Powerset_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Pointset_Powerset class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -63,10 +63,11 @@ : Base(), space_dim(y.space_dimension()) { Pointset_Powerset& x = *this; for (typename Pointset_Powerset::const_iterator i = y.begin(), - y_end = y.end(); i != y_end; ++i) + y_end = y.end(); i != y_end; ++i) { x.sequence.push_back(Determinate (NNC_Polyhedron(i->pointset(), complexity))); + } // FIXME: If the domain elements can be represented _exactly_ as NNC // polyhedra, then having x.reduced = y.reduced is correct. This is // the case if the domains are both linear and convex which holds @@ -89,8 +90,9 @@ : Base(), space_dim(y.space_dimension()) { Pointset_Powerset& x = *this; for (typename Pointset_Powerset::const_iterator i = y.begin(), - y_end = y.end(); i != y_end; ++i) + y_end = y.end(); i != y_end; ++i) { x.sequence.push_back(Determinate(PSET(i->pointset(), complexity))); + } // Note: this might be non-reduced even when `y' is known to be // omega-reduced, because the constructor of PSET may have made // different QH elements to become comparable. @@ -119,12 +121,14 @@ && (xi != x_end) && (y_begin != y_end)) { // Hurry up! PSET x_ph = xi->pointset(); - for (++xi; xi != x_end; ++xi) + for (++xi; xi != x_end; ++xi) { x_ph.upper_bound_assign(xi->pointset()); + } const_iterator yi = y_begin; PSET y_ph = yi->pointset(); - for (++yi; yi != y_end; ++yi) + for (++yi; yi != y_end; ++yi) { y_ph.upper_bound_assign(yi->pointset()); + } x_ph.concatenate_assign(y_ph); swap(x, new_x); x.add_disjunct(x_ph); @@ -141,8 +145,9 @@ Pointset_Powerset::add_constraint(const Constraint& c) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_constraint(c); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -152,8 +157,9 @@ Pointset_Powerset::refine_with_constraint(const Constraint& c) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().refine_with_constraint(c); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -163,8 +169,9 @@ Pointset_Powerset::add_constraints(const Constraint_System& cs) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_constraints(cs); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -174,8 +181,9 @@ Pointset_Powerset::refine_with_constraints(const Constraint_System& cs) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().refine_with_constraints(cs); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -185,8 +193,9 @@ Pointset_Powerset::add_congruence(const Congruence& cg) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_congruence(cg); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -196,8 +205,9 @@ Pointset_Powerset::refine_with_congruence(const Congruence& cg) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().refine_with_congruence(cg); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -207,8 +217,9 @@ Pointset_Powerset::add_congruences(const Congruence_System& cgs) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_congruences(cgs); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -218,8 +229,9 @@ Pointset_Powerset::refine_with_congruences(const Congruence_System& cgs) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().refine_with_congruences(cgs); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -253,8 +265,9 @@ Pointset_Powerset::add_space_dimensions_and_embed(dimension_type m) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_space_dimensions_and_embed(m); + } x.space_dim += m; PPL_ASSERT_HEAVY(x.OK()); } @@ -264,8 +277,9 @@ Pointset_Powerset::add_space_dimensions_and_project(dimension_type m) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_space_dimensions_and_project(m); + } x.space_dim += m; PPL_ASSERT_HEAVY(x.OK()); } @@ -311,16 +325,18 @@ dimension_type n = 0; for (dimension_type i = x.space_dim; i-- > 0; ) { dimension_type new_i; - if (pfunc.maps(i, new_i)) + if (pfunc.maps(i, new_i)) { ++n; + } } x.space_dim = n; } else { Sequence_iterator s_begin = x.sequence.begin(); for (Sequence_iterator si = s_begin, - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().map_space_dimensions(pfunc); + } x.space_dim = s_begin->pointset().space_dimension(); x.reduced = false; } @@ -333,8 +349,9 @@ dimension_type m) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().expand_space_dimension(var, m); + } x.space_dim += m; PPL_ASSERT_HEAVY(x.OK()); } @@ -347,8 +364,9 @@ Variables_Set::size_type num_folded = vars.size(); if (num_folded > 0) { for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().fold_space_dimensions(vars, dest); + } } x.space_dim -= num_folded; PPL_ASSERT_HEAVY(x.OK()); @@ -505,8 +523,9 @@ for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { const Constraint& c = *i; - if (c.is_equality()) + if (c.is_equality()) { phi.add_constraint(c); + } } x_ph.poly_hull_assign(phi); } @@ -520,11 +539,13 @@ Pointset_Powerset::is_universe() const { const Pointset_Powerset& x = *this; // Exploit omega-reduction, if already computed. - if (x.is_omega_reduced()) + if (x.is_omega_reduced()) { return x.size() == 1 && x.begin()->pointset().is_universe(); + } // A powerset is universe iff one of its disjuncts is. - for (const_iterator x_i = x.begin(), x_end = x.end(); x_i != x_end; ++x_i) + for (const_iterator x_i = x.begin(), x_end = x.end(); + x_i != x_end; ++x_i) { if (x_i->pointset().is_universe()) { // Speculative omega-reduction, if it is worth. if (x.size() > 1) { @@ -534,6 +555,7 @@ } return true; } + } return false; } @@ -542,9 +564,11 @@ Pointset_Powerset::is_empty() const { const Pointset_Powerset& x = *this; for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().is_empty()) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().is_empty()) { return false; + } + } return true; } @@ -553,9 +577,11 @@ Pointset_Powerset::is_discrete() const { const Pointset_Powerset& x = *this; for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().is_discrete()) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().is_discrete()) { return false; + } + } return true; } @@ -567,9 +593,11 @@ // topological closure. x.omega_reduce(); for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().is_topologically_closed()) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().is_topologically_closed()) { return false; + } + } return true; } @@ -578,9 +606,11 @@ Pointset_Powerset::is_bounded() const { const Pointset_Powerset& x = *this; for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().is_bounded()) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().is_bounded()) { return false; + } + } return true; } @@ -600,11 +630,15 @@ // omega_reduction needed, since a redundant disjunct may constrain var. x.omega_reduce(); // An empty powerset constrains all variables. - if (x.is_empty()) + if (x.is_empty()) { return true; - for (const_iterator x_i = x.begin(), x_end = x.end(); x_i != x_end; ++x_i) - if (x_i->pointset().constrains(var)) + } + for (const_iterator x_i = x.begin(), x_end = x.end(); + x_i != x_end; ++x_i) { + if (x_i->pointset().constrains(var)) { return true; + } + } return false; } @@ -618,8 +652,9 @@ for (Sequence_const_iterator sj = y.sequence.begin(), y_s_end = y.sequence.end(); sj != y_s_end; ++sj) { const PSET& pj = sj->pointset(); - if (!pi.is_disjoint_from(pj)) + if (!pi.is_disjoint_from(pj)) { return false; + } } } return true; @@ -632,8 +667,9 @@ Complexity_Class complexity) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().drop_some_non_integer_points(vars, complexity); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -644,8 +680,9 @@ ::drop_some_non_integer_points(Complexity_Class complexity) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().drop_some_non_integer_points(complexity); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -655,8 +692,9 @@ Pointset_Powerset::topological_closure_assign() { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().topological_closure_assign(); + } PPL_ASSERT_HEAVY(x.OK()); } @@ -675,8 +713,9 @@ PSET context_i(si->pointset()); context_i.intersection_assign(enlarged); PSET enlarged_i(dest); - if (enlarged_i.simplify_using_context_assign(context_i)) + if (enlarged_i.simplify_using_context_assign(context_i)) { nonempty_intersection = true; + } // TODO: merge the sorted constraints of `enlarged' and `enlarged_i'? enlarged.intersection_assign(enlarged_i); } @@ -696,8 +735,9 @@ // if it has been made redundant by any of the elements preceding it // (which have been already simplified). x.omega_reduce(); - if (x.is_empty()) + if (x.is_empty()) { return false; + } y.omega_reduce(); if (y.is_empty()) { x = y; @@ -710,22 +750,26 @@ for (Sequence_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ) { PSET& x_i = si->pointset(); - if (x_i.simplify_using_context_assign(y_i)) + if (x_i.simplify_using_context_assign(y_i)) { ++si; - else + } + else { // Intersection is empty: drop the disjunct. si = x.sequence.erase(si); + } } } else { // The context is not a singleton. for (Sequence_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ) { - if (y.intersection_preserving_enlarge_element(si->pointset())) + if (y.intersection_preserving_enlarge_element(si->pointset())) { ++si; - else + } + else { // Intersection with `*si' is empty: drop the disjunct. si = x.sequence.erase(si); + } } } x.reduced = false; @@ -746,11 +790,13 @@ (sj != x_s_end && !pi_is_contained); ++sj) { const PSET& pj = sj->pointset(); - if (pj.contains(pi)) + if (pj.contains(pi)) { pi_is_contained = true; + } } - if (!pi_is_contained) + if (!pi_is_contained) { return false; + } } return true; } @@ -771,100 +817,74 @@ x_s_end = x.sequence.end(); (sj != x_s_end && !pi_is_strictly_contained); ++sj) { const PSET& pj = sj->pointset(); - if (pj.strictly_contains(pi)) + if (pj.strictly_contains(pi)) { pi_is_strictly_contained = true; + } } - if (!pi_is_strictly_contained) + if (!pi_is_strictly_contained) { return false; + } } return true; } template +template Poly_Con_Relation -Pointset_Powerset::relation_with(const Congruence& cg) const { - const Pointset_Powerset& x = *this; - - /* *this is included in cg if every disjunct is included in cg */ - bool is_included = true; - /* *this is disjoint with cg if every disjunct is disjoint with cg */ - bool is_disjoint = true; - /* *this strictly_intersects with cg if some disjunct strictly - intersects with cg */ - bool is_strictly_intersecting = false; - /* *this saturates cg if some disjunct saturates cg and - every disjunct is either disjoint from cg or saturates cg */ - bool saturates_once = false; - bool may_saturate = true; - for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) { - Poly_Con_Relation relation_i = si->pointset().relation_with(cg); - if (!relation_i.implies(Poly_Con_Relation::is_included())) - is_included = false; - if (!relation_i.implies(Poly_Con_Relation::is_disjoint())) - is_disjoint = false; - if (relation_i.implies(Poly_Con_Relation::strictly_intersects())) - is_strictly_intersecting = true; - if (relation_i.implies(Poly_Con_Relation::saturates())) - saturates_once = true; - else if (!relation_i.implies(Poly_Con_Relation::is_disjoint())) - may_saturate = false; - } - - Poly_Con_Relation result = Poly_Con_Relation::nothing(); - if (is_included) - result = result && Poly_Con_Relation::is_included(); - if (is_disjoint) - result = result && Poly_Con_Relation::is_disjoint(); - if (is_strictly_intersecting) - result = result && Poly_Con_Relation::strictly_intersects(); - if (saturates_once && may_saturate) - result = result && Poly_Con_Relation::saturates(); - - return result; -} - -template -Poly_Con_Relation -Pointset_Powerset::relation_with(const Constraint& c) const { +Pointset_Powerset::relation_with_aux(const Cons_or_Congr& c) const { const Pointset_Powerset& x = *this; /* *this is included in c if every disjunct is included in c */ bool is_included = true; /* *this is disjoint with c if every disjunct is disjoint with c */ bool is_disjoint = true; - /* *this strictly_intersects with c if some disjunct strictly - intersects with c */ + /* *this strictly_intersects with c if: + - some disjunct strictly intersects with c + or + - there exists two disjoints d1 and d2 + such that d1 is included in c and d2 is disjoint with c + */ bool is_strictly_intersecting = false; - /* *this saturates c if some disjunct saturates c and - every disjunct is either disjoint from c or saturates c */ - bool saturates_once = false; - bool may_saturate = true; + bool included_once = false; + bool disjoint_once = false; + /* *this saturates c if all disjuncts saturate c */ + bool saturates = true; for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { Poly_Con_Relation relation_i = si->pointset().relation_with(c); - if (!relation_i.implies(Poly_Con_Relation::is_included())) + if (relation_i.implies(Poly_Con_Relation::is_included())) { + included_once = true; + } + else { is_included = false; - if (!relation_i.implies(Poly_Con_Relation::is_disjoint())) + } + if (relation_i.implies(Poly_Con_Relation::is_disjoint())) { + disjoint_once = true; + } + else { is_disjoint = false; - if (relation_i.implies(Poly_Con_Relation::strictly_intersects())) + } + if (relation_i.implies(Poly_Con_Relation::strictly_intersects())) { is_strictly_intersecting = true; - if (relation_i.implies(Poly_Con_Relation::saturates())) - saturates_once = true; - else if (!relation_i.implies(Poly_Con_Relation::is_disjoint())) - may_saturate = false; + } + if (!relation_i.implies(Poly_Con_Relation::saturates())) { + saturates = false; + } } Poly_Con_Relation result = Poly_Con_Relation::nothing(); - if (is_included) + if (is_included) { result = result && Poly_Con_Relation::is_included(); - if (is_disjoint) + } + if (is_disjoint) { result = result && Poly_Con_Relation::is_disjoint(); - if (is_strictly_intersecting) + } + if (is_strictly_intersecting || (included_once && disjoint_once)) { result = result && Poly_Con_Relation::strictly_intersects(); - if (saturates_once && may_saturate) + } + if (saturates) { result = result && Poly_Con_Relation::saturates(); - + } return result; } @@ -876,8 +896,9 @@ for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { Poly_Gen_Relation relation_i = si->pointset().relation_with(g); - if (relation_i.implies(Poly_Gen_Relation::subsumes())) + if (relation_i.implies(Poly_Gen_Relation::subsumes())) { return Poly_Gen_Relation::subsumes(); + } } return Poly_Gen_Relation::nothing(); @@ -890,9 +911,11 @@ const Pointset_Powerset& x = *this; x.omega_reduce(); for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().bounds_from_above(expr)) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().bounds_from_above(expr)) { return false; + } + } return true; } @@ -903,9 +926,11 @@ const Pointset_Powerset& x = *this; x.omega_reduce(); for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().bounds_from_below(expr)) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().bounds_from_below(expr)) { return false; + } + } return true; } @@ -917,8 +942,9 @@ bool& maximum) const { const Pointset_Powerset& x = *this; x.omega_reduce(); - if (x.is_empty()) + if (x.is_empty()) { return false; + } bool first = true; @@ -938,8 +964,9 @@ for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { - if (!si->pointset().maximize(expr, iter_sup_n, iter_sup_d, iter_max)) + if (!si->pointset().maximize(expr, iter_sup_n, iter_sup_d, iter_max)) { return false; + } else if (first) { first = false; @@ -954,8 +981,9 @@ best_sup_d = iter_sup_d; best_max = iter_max; } - else if (tmp == 0) + else if (tmp == 0) { best_max = (best_max || iter_max); + } } } sup_n = best_sup_n; @@ -973,8 +1001,9 @@ Generator& g) const { const Pointset_Powerset& x = *this; x.omega_reduce(); - if (x.is_empty()) + if (x.is_empty()) { return false; + } bool first = true; @@ -997,9 +1026,10 @@ for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { if (!si->pointset().maximize(expr, - iter_sup_n, iter_sup_d, iter_max, iter_g)) + iter_sup_n, iter_sup_d, iter_max, iter_g)) { return false; - else + } + else { if (first) { first = false; best_sup_n = iter_sup_n; @@ -1020,6 +1050,7 @@ best_g = iter_g; } } + } } sup_n = best_sup_n; sup_d = best_sup_d; @@ -1036,8 +1067,9 @@ bool& minimum) const { const Pointset_Powerset& x = *this; x.omega_reduce(); - if (x.is_empty()) + if (x.is_empty()) { return false; + } bool first = true; @@ -1057,9 +1089,10 @@ for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { - if (!si->pointset().minimize(expr, iter_inf_n, iter_inf_d, iter_min)) + if (!si->pointset().minimize(expr, iter_inf_n, iter_inf_d, iter_min)) { return false; - else + } + else { if (first) { first = false; best_inf_n = iter_inf_n; @@ -1073,9 +1106,11 @@ best_inf_d = iter_inf_d; best_min = iter_min; } - else if (tmp == 0) + else if (tmp == 0) { best_min = (best_min || iter_min); + } } + } } inf_n = best_inf_n; inf_d = best_inf_d; @@ -1092,8 +1127,9 @@ Generator& g) const { const Pointset_Powerset& x = *this; x.omega_reduce(); - if (x.is_empty()) + if (x.is_empty()) { return false; + } bool first = true; @@ -1116,9 +1152,10 @@ for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { if (!si->pointset().minimize(expr, - iter_inf_n, iter_inf_d, iter_min, iter_g)) + iter_inf_n, iter_inf_d, iter_min, iter_g)) { return false; - else + } + else { if (first) { first = false; best_inf_n = iter_inf_n; @@ -1139,6 +1176,7 @@ best_g = iter_g; } } + } } inf_n = best_inf_n; inf_d = best_inf_d; @@ -1152,9 +1190,11 @@ Pointset_Powerset::contains_integer_point() const { const Pointset_Powerset& x = *this; for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (si->pointset().contains_integer_point()) + s_end = x.sequence.end(); si != s_end; ++si) { + if (si->pointset().contains_integer_point()) { return true; + } + } return false; } @@ -1169,9 +1209,10 @@ bool wrap_individually) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().wrap_assign(vars, w, r, o, cs_p, complexity_threshold, wrap_individually); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -1193,14 +1234,16 @@ Sequence_iterator s_end = x.sequence.end(); unsigned si_index = 0; for (Sequence_iterator si = s_begin; si != s_end; ++si, ++si_index) { - if (marked[si_index]) + if (marked[si_index]) { continue; + } PSET& pi = si->pointset(); Sequence_const_iterator sj = si; unsigned sj_index = si_index; for (++sj, ++sj_index; sj != s_end; ++sj, ++sj_index) { - if (marked[sj_index]) + if (marked[sj_index]) { continue; + } const PSET& pj = sj->pointset(); if (pi.upper_bound_assign_if_exact(pj)) { marked[si_index] = true; @@ -1217,12 +1260,14 @@ iterator new_x_end = new_x.end(); unsigned xi_index = 0; for (const_iterator xi = x.begin(), - x_end = x.end(); xi != x_end; ++xi, ++xi_index) - if (!marked[xi_index]) + x_end = x.end(); xi != x_end; ++xi, ++xi_index) { + if (!marked[xi_index]) { new_x_begin = new_x.add_non_bottom_disjunct_preserve_reduction(*xi, new_x_begin, new_x_end); + } + } using std::swap; swap(x.sequence, new_x.sequence); n -= deleted; @@ -1254,7 +1299,8 @@ const_iterator x_end = x.end(); unsigned i_index = 0; for (const_iterator i = x_begin, - y_begin = y.begin(), y_end = y.end(); i != x_end; ++i, ++i_index) + y_begin = y.begin(), y_end = y.end(); + i != x_end; ++i, ++i_index) { for (const_iterator j = y_begin; j != y_end; ++j) { const PSET& pi = i->pointset(); const PSET& pj = j->pointset(); @@ -1265,15 +1311,18 @@ marked[i_index] = true; } } + } iterator new_x_begin = new_x.begin(); iterator new_x_end = new_x.end(); i_index = 0; - for (const_iterator i = x_begin; i != x_end; ++i, ++i_index) - if (!marked[i_index]) + for (const_iterator i = x_begin; i != x_end; ++i, ++i_index) { + if (!marked[i_index]) { new_x_begin = new_x.add_non_bottom_disjunct_preserve_reduction(*i, new_x_begin, new_x_end); + } + } using std::swap; swap(x.sequence, new_x.sequence); PPL_ASSERT_HEAVY(x.OK()); @@ -1300,8 +1349,9 @@ #endif x.pairwise_reduce(); - if (max_disjuncts != 0) + if (max_disjuncts != 0) { x.collapse(max_disjuncts); + } x.BGP99_heuristics_assign(y, widen_fun); } @@ -1347,9 +1397,10 @@ ++xi; ++yi; } - else + else { // Different number of occurrences: can decide ordering. return xi_count < yi_count; + } break; } case 1: @@ -1387,25 +1438,29 @@ // If `y' is the empty collection, do nothing. PPL_ASSERT(x.size() > 0); - if (y.size() == 0) + if (y.size() == 0) { return; + } // Compute the poly-hull of `x'. PSET x_hull(x.space_dim, EMPTY); - for (const_iterator i = x.begin(), x_end = x.end(); i != x_end; ++i) + for (const_iterator i = x.begin(), x_end = x.end(); i != x_end; ++i) { x_hull.upper_bound_assign(i->pointset()); + } // Compute the poly-hull of `y'. PSET y_hull(y.space_dim, EMPTY); - for (const_iterator i = y.begin(), y_end = y.end(); i != y_end; ++i) + for (const_iterator i = y.begin(), y_end = y.end(); i != y_end; ++i) { y_hull.upper_bound_assign(i->pointset()); + } // Compute the certificate for `y_hull'. const Cert y_hull_cert(y_hull); // If the hull is stabilizing, do nothing. int hull_stabilization = y_hull_cert.compare(x_hull); - if (hull_stabilization == 1) + if (hull_stabilization == 1) { return; + } // Multiset ordering is only useful when `y' is not a singleton. const bool y_is_not_a_singleton = y.size() > 1; @@ -1421,8 +1476,9 @@ y.collect_certificates(y_cert_ms); y_cert_ms_computed = true; // If multiset ordering is stabilizing, do nothing. - if (x.is_cert_multiset_stabilizing(y_cert_ms)) + if (x.is_cert_multiset_stabilizing(y_cert_ms)) { return; + } } // Second widening technique: try the BGP99 powerset heuristics. @@ -1432,8 +1488,9 @@ // Compute the poly-hull of `bgp99_heuristics'. PSET bgp99_heuristics_hull(x.space_dim, EMPTY); for (const_iterator i = bgp99_heuristics.begin(), - b_h_end = bgp99_heuristics.end(); i != b_h_end; ++i) + b_h_end = bgp99_heuristics.end(); i != b_h_end; ++i) { bgp99_heuristics_hull.upper_bound_assign(i->pointset()); + } // Check for stabilization and, if successful, // commit to the result of the extrapolation. @@ -1490,8 +1547,10 @@ s << "size " << x.size() << "\nspace_dim " << x.space_dim << "\n"; - for (const_iterator xi = x.begin(), x_end = x.end(); xi != x_end; ++xi) + for (const_iterator xi = x.begin(), x_end = x.end(); + xi != x_end; ++xi) { xi->pointset().ascii_dump(s); + } } PPL_OUTPUT_TEMPLATE_DEFINITIONS(PSET, Pointset_Powerset) @@ -1502,25 +1561,30 @@ Pointset_Powerset& x = *this; std::string str; - if (!(s >> str) || str != "size") + if (!(s >> str) || str != "size") { return false; + } size_type sz; - if (!(s >> sz)) + if (!(s >> sz)) { return false; + } - if (!(s >> str) || str != "space_dim") + if (!(s >> str) || str != "space_dim") { return false; + } - if (!(s >> x.space_dim)) + if (!(s >> x.space_dim)) { return false; + } Pointset_Powerset new_x(x.space_dim, EMPTY); while (sz-- > 0) { PSET ph; - if (!ph.ascii_load(s)) + if (!ph.ascii_load(s)) { return false; + } new_x.add_disjunct(ph); } swap(x, new_x); @@ -1570,8 +1634,9 @@ const Constraint& neg_c = c.is_strict_inequality() ? (le <= 0) : (le < 0); NNC_Polyhedron nnc_ph_pset(pset); nnc_ph_pset.add_constraint(neg_c); - if (!nnc_ph_pset.is_empty()) + if (!nnc_ph_pset.is_empty()) { r.add_disjunct(nnc_ph_pset); + } pset.add_constraint(c); } @@ -1599,8 +1664,9 @@ linear_partition_aux(le <= 0, pset, r); linear_partition_aux(le >= 0, pset, r); } - else + else { linear_partition_aux(c, pset, r); + } } return std::make_pair(pset, r); } diff -Nru ppl-1.1/src/Pointset_Powerset_types.hh ppl-1.2/src/Pointset_Powerset_types.hh --- ppl-1.1/src/Pointset_Powerset_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Pointset_Powerset_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Poly_Con_Relation.cc ppl-1.2/src/Poly_Con_Relation.cc --- ppl-1.1/src/Poly_Con_Relation.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Poly_Con_Relation.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Poly_Con_Relation class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -23,7 +23,7 @@ #include "ppl-config.h" #include "Poly_Con_Relation_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include #include @@ -54,10 +54,12 @@ s << "SATURATES"; f &= ~SATURATES; } - if (f != NOTHING) + if (f != NOTHING) { s << " & "; - else + } + else { break; + } } } diff -Nru ppl-1.1/src/Poly_Con_Relation_defs.hh ppl-1.2/src/Poly_Con_Relation_defs.hh --- ppl-1.1/src/Poly_Con_Relation_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Poly_Con_Relation_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Poly_Con_Relation class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Poly_Con_Relation_inlines.hh ppl-1.2/src/Poly_Con_Relation_inlines.hh --- ppl-1.1/src/Poly_Con_Relation_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Poly_Con_Relation_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Poly_Con_Relation class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Poly_Con_Relation_types.hh ppl-1.2/src/Poly_Con_Relation_types.hh --- ppl-1.1/src/Poly_Con_Relation_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Poly_Con_Relation_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Poly_Gen_Relation.cc ppl-1.2/src/Poly_Gen_Relation.cc --- ppl-1.1/src/Poly_Gen_Relation.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Poly_Gen_Relation.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Poly_Gen_Relation class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -23,7 +23,7 @@ #include "ppl-config.h" #include "Poly_Gen_Relation_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include #include @@ -42,10 +42,12 @@ s << "SUBSUMES"; f &= ~SUBSUMES; } - if (f != NOTHING) + if (f != NOTHING) { s << " & "; - else + } + else { break; + } } } diff -Nru ppl-1.1/src/Poly_Gen_Relation_defs.hh ppl-1.2/src/Poly_Gen_Relation_defs.hh --- ppl-1.1/src/Poly_Gen_Relation_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Poly_Gen_Relation_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Poly_Gen_Relation class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Poly_Gen_Relation_inlines.hh ppl-1.2/src/Poly_Gen_Relation_inlines.hh --- ppl-1.1/src/Poly_Gen_Relation_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Poly_Gen_Relation_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Poly_Gen_Relation class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Poly_Gen_Relation_types.hh ppl-1.2/src/Poly_Gen_Relation_types.hh --- ppl-1.1/src/Poly_Gen_Relation_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Poly_Gen_Relation_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Polyhedron_chdims.cc ppl-1.2/src/Polyhedron_chdims.cc --- ppl-1.1/src/Polyhedron_chdims.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_chdims.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Polyhedron class implementation (non-inline operators that may change the dimension of the vector space). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,7 +25,7 @@ #include "ppl-config.h" #include "Polyhedron_defs.hh" #include "Variables_Set_defs.hh" -#include "assert.hh" +#include "assertions.hh" #define BE_LAZY 1 @@ -42,8 +42,9 @@ "the maximum allowed space dimension"); // Adding no dimensions to any polyhedron is a no-op. - if (m == 0) + if (m == 0) { return; + } // Adding dimensions to an empty polyhedron is obtained by adjusting // `space_dim' and clearing `con_sys' (since it can contain the @@ -73,11 +74,12 @@ // we add the line having that direction. This is done by invoking // the function add_space_dimensions() giving the system of generators // as the second argument. - if (constraints_are_up_to_date()) + if (constraints_are_up_to_date()) { if (generators_are_up_to_date()) { // `sat_c' must be up to date for add_space_dimensions(). - if (!sat_c_is_up_to_date()) + if (!sat_c_is_up_to_date()) { update_sat_c(); + } // Adds rows and/or columns to both matrices. // `add_space_dimensions' correctly handles pending constraints // or generators. @@ -87,6 +89,7 @@ // Only constraints are up-to-date: no need to modify the generators. con_sys.set_space_dimension(con_sys.space_dimension() + m); } + } else { // Only generators are up-to-date: no need to modify the constraints. PPL_ASSERT(generators_are_up_to_date()); @@ -111,8 +114,9 @@ "the maximum allowed space dimension"); // Adding no dimensions to any polyhedron is a no-op. - if (m == 0) + if (m == 0) { return; + } // Adding dimensions to an empty polyhedron is obtained // by merely adjusting `space_dim'. @@ -129,8 +133,9 @@ // In an NNC polyhedron, all points have to be accompanied // by the corresponding closure points // (this time, dimensions are automatically adjusted). - if (!is_necessarily_closed()) + if (!is_necessarily_closed()) { gen_sys.insert(Generator::zero_dim_closure_point()); + } gen_sys.insert(Generator::zero_dim_point()); gen_sys.adjust_topology_and_space_dimension(topology(), m); set_generators_minimized(); @@ -146,11 +151,12 @@ // Thus, for each new dimensions `x[k]', we add the constraint // x[k] = 0: this is done by invoking the function add_space_dimensions() // giving the system of constraints as the second argument. - if (constraints_are_up_to_date()) + if (constraints_are_up_to_date()) { if (generators_are_up_to_date()) { // `sat_g' must be up to date for add_space_dimensions(). - if (!sat_g_is_up_to_date()) + if (!sat_g_is_up_to_date()) { update_sat_g(); + } // Adds rows and/or columns to both matrices. // `add_space_dimensions()' correctly handles pending constraints // or generators. @@ -160,6 +166,7 @@ // Only constraints are up-to-date: no need to modify the generators. con_sys.add_universe_rows_and_space_dimensions(m); } + } else { // Only generators are up-to-date: no need to modify the constraints. PPL_ASSERT(generators_are_up_to_date()); @@ -175,8 +182,9 @@ void PPL::Polyhedron::concatenate_assign(const Polyhedron& y) { - if (topology() != y.topology()) + if (topology() != y.topology()) { throw_topology_incompatible("concatenate_assign(y)", "y", y); + } // The space dimension of the resulting polyhedron should not // overflow the maximum allowed space dimension. @@ -197,8 +205,9 @@ } // If `y' is a non-empty 0-dim space polyhedron, the result is `*this'. - if (added_columns == 0) + if (added_columns == 0) { return; + } // If `*this' is a non-empty 0-dim space polyhedron, the result is `y'. if (space_dim == 0) { @@ -210,10 +219,12 @@ Constraint_System cs = y.constraints(); // The constraints of `x' (possibly with pending rows) are required. - if (has_pending_generators()) + if (has_pending_generators()) { process_pending_generators(); - else if (!constraints_are_up_to_date()) + } + else if (!constraints_are_up_to_date()) { update_constraints(); + } // The matrix for the new system of constraints is obtained // by leaving the old system of constraints in the upper left-hand side @@ -256,8 +267,10 @@ // The newly introduced lines saturate all the non-pending constraints, // thus their saturation rows are made of zeroes. using std::swap; - for (dimension_type i = sat_c.num_rows() - added_columns; i-- > 0; ) + for (dimension_type i = sat_c.num_rows() - added_columns; + i-- > 0; ) { swap(sat_c[i], sat_c[i+added_columns]); + } // Since `added_rows > 0', we now have pending constraints. set_constraints_pending(); } @@ -296,8 +309,9 @@ // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dim < min_space_dim) + if (space_dim < min_space_dim) { throw_dimension_incompatible("remove_space_dimensions(vs)", min_space_dim); + } const dimension_type new_space_dim = space_dim - vars.size(); @@ -338,9 +352,10 @@ void PPL::Polyhedron::remove_higher_space_dimensions(dimension_type new_dimension) { // Dimension-compatibility check. - if (new_dimension > space_dim) + if (new_dimension > space_dim) { throw_dimension_incompatible("remove_higher_space_dimensions(nd)", new_dimension); + } // The removal of no dimensions from any polyhedron is a no-op. // Note that this case also captures the only legal removal of @@ -385,8 +400,9 @@ void PPL::Polyhedron::expand_space_dimension(Variable var, dimension_type m) { // `var' should be one of the dimensions of the vector space. - if (var.space_dimension() > space_dim) + if (var.space_dimension() > space_dim) { throw_dimension_incompatible("expand_space_dimension(v, m)", "v", var); + } // The space dimension of the resulting polyhedron should not // overflow the maximum allowed space dimension. @@ -397,8 +413,9 @@ "the maximum allowed space dimension"); // Nothing to do, if no dimensions must be added. - if (m == 0) + if (m == 0) { return; + } // Keep track of the dimension before adding the new ones. const dimension_type old_dim = space_dim; @@ -415,12 +432,13 @@ Coefficient_traits::const_reference coeff = c.coefficient(var); // If `c' does not constrain `var', skip it. - if (coeff == 0) + if (coeff == 0) { continue; + } Constraint c_template = c; c_template.expr.set_coefficient(var, Coefficient_zero()); - + // Each relevant constraint results in `m' new constraints. for (dimension_type dst_d = old_dim; dst_d < old_dim+m; ++dst_d) { Constraint new_c = c_template; @@ -439,23 +457,27 @@ // TODO: this implementation is _really_ an executable specification. // `dest' should be one of the dimensions of the polyhedron. - if (dest.space_dimension() > space_dim) + if (dest.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", "v", dest); + } // The folding of no dimensions is a no-op. - if (vars.empty()) + if (vars.empty()) { return; + } // All variables in `vars' should be dimensions of the polyhedron. - if (vars.space_dimension() > space_dim) + if (vars.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", "vs.space_dimension()", vars.space_dimension()); + } // Moreover, `dest.id()' should not occur in `vars'. - if (vars.find(dest.id()) != vars.end()) + if (vars.find(dest.id()) != vars.end()) { throw_invalid_argument("fold_space_dimensions(vs, v)", "v should not occur in vs"); + } // All of the affine images we are going to compute are not invertible, // hence we will need to compute the generators of the polyhedron. diff -Nru ppl-1.1/src/Polyhedron_chdims_templates.hh ppl-1.2/src/Polyhedron_chdims_templates.hh --- ppl-1.1/src/Polyhedron_chdims_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_chdims_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Polyhedron class implementation (non-inline template operators that may change the dimension of the vector space). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -34,9 +34,6 @@ Bit_Matrix& sat1, Bit_Matrix& sat2, dimension_type add_dim) { - - typedef typename Linear_System2::row_type sys2_row_type; - PPL_ASSERT(sys1.topology() == sys2.topology()); PPL_ASSERT(sys1.space_dimension() == sys2.space_dimension()); PPL_ASSERT(add_dim != 0); @@ -52,8 +49,9 @@ // because the polyhedron has not been embedded in the new space. sat1.resize(sat1.num_rows() + add_dim, sat1.num_columns()); // The old matrix is moved to the end of the new matrix. - for (dimension_type i = sat1.num_rows() - add_dim; i-- > 0; ) + for (dimension_type i = sat1.num_rows() - add_dim; i-- > 0; ) { swap(sat1[i], sat1[i+add_dim]); + } // Computes the "sat_c", too. sat2.transpose_assign(sat1); } diff -Nru ppl-1.1/src/Polyhedron_conversion_templates.hh ppl-1.2/src/Polyhedron_conversion_templates.hh --- ppl-1.1/src/Polyhedron_conversion_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_conversion_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Polyhedron class implementation: conversion(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -35,6 +35,20 @@ #include #include +// This flag turns on the quick non-adjacency test; +// the performance impact of this test was evaluated by H. Le Verge (1994); +// see also Corollary 4.2 in B. Genov's PhD thesis (2014). +#ifndef PPL_QUICK_NON_ADJ_TEST +#define PPL_QUICK_NON_ADJ_TEST 1 +#endif + +// This flag turns on the quick adjacency test; +// for a justification, see Corollary 4.3 in B. Genov's PhD thesis (2014), +// where it is also said that the test was implemented in cddlib. +#ifndef PPL_QUICK_ADJ_TEST +#define PPL_QUICK_ADJ_TEST 1 +#endif + namespace Parma_Polyhedra_Library { /*! @@ -394,11 +408,28 @@ // This will contain the row indexes of the redundant rows of `source'. std::vector redundant_source_rows; +#if PPL_QUICK_ADJ_TEST + // This will contain the number of ones in each row of `sat'. + PPL_DIRTY_TEMP(std::vector, sat_num_ones); + sat_num_ones.resize(dest_num_rows, 0); + for (dimension_type i = dest_num_rows; i-- > 0; ) { + sat_num_ones[i] = sat[i].count_ones(); + } +#endif // PPL_QUICK_ADJ_TEST + // Converting the sub-system of `source' having rows with indexes // from `start' to the last one (i.e., `source_num_rows' - 1). for (dimension_type k = start; k < source_num_rows; ++k) { const source_row_type& source_k = source[k]; +#ifndef NDEBUG +#if PPL_QUICK_ADJ_TEST + for (dimension_type i = dest_num_rows; i-- > 0; ) { + PPL_ASSERT(sat_num_ones[i] == sat[i].count_ones()); + } +#endif // PPL_QUICK_ADJ_TEST +#endif // NDEBUG + // `scalar_prod[i]' will contain the scalar product of the // constraint `source_k' and the generator `dest_rows[i]'. This // product is 0 if and only if the generator saturates the @@ -418,9 +449,10 @@ source_k, dest.sys.rows[index_non_zero]); WEIGHT_ADD_MUL(17, source_space_dim); - if (scalar_prod[index_non_zero] != 0) + if (scalar_prod[index_non_zero] != 0) { // The generator does not saturate the constraint. break; + } // Check if the client has requested abandoning all expensive // computations. If so, the exception specified by the client // is thrown now. @@ -569,12 +601,16 @@ // the constraint is an inequality, we set to 1 the // corresponding element of `sat' ... Bit_Row& sat_nle = sat[num_lines_or_equalities]; - if (source_k.is_ray_or_point_or_inequality()) + if (source_k.is_ray_or_point_or_inequality()) { sat_nle.set(k - redundant_source_rows.size()); - // ... otherwise, the constraint is an equality which is - // violated by the generator `dest_nle': the generator has to be - // removed from `dest_rows'. +#if PPL_QUICK_ADJ_TEST + ++sat_num_ones[num_lines_or_equalities]; +#endif // PPL_QUICK_ADJ_TEST + } else { + // ... otherwise, the constraint is an equality which is + // violated by the generator `dest_nle': the generator has to be + // removed from `dest_rows'. --dest_num_rows; swap(dest.sys.rows[num_lines_or_equalities], dest.sys.rows[dest_num_rows]); @@ -585,291 +621,352 @@ swap(scalar_prod_nle, scalar_prod[dest_num_rows]); swap(sat_nle, sat[dest_num_rows]); +#if PPL_QUICK_ADJ_TEST + swap(sat_num_ones[num_lines_or_equalities], + sat_num_ones[dest_num_rows]); +#endif // PPL_QUICK_ADJ_TEST // dest_sorted has already been set to false. } + // Finished handling the line or equality case: + // continue with next `k'. + continue; } - // Here we have `index_non_zero' >= `num_lines_or_equalities', - // so that all the lines in `dest_rows' saturate the constraint `source_k'. - else { - // First, we reorder the generators in `dest_rows' as follows: - // -# all the lines should have indexes between 0 and - // `num_lines_or_equalities' - 1 (this already holds); - // -# all the rays that saturate the constraint should have - // indexes between `num_lines_or_equalities' and - // `lines_or_equal_bound' - 1; these rays form the set Q=. - // -# all the rays that have a positive scalar product with the - // constraint should have indexes between `lines_or_equal_bound' - // and `sup_bound' - 1; these rays form the set Q+. - // -# all the rays that have a negative scalar product with the - // constraint should have indexes between `sup_bound' and - // `dest_num_rows' - 1; these rays form the set Q-. - dimension_type lines_or_equal_bound = num_lines_or_equalities; - dimension_type inf_bound = dest_num_rows; - // While we find saturating generators, we simply increment - // `lines_or_equal_bound'. - while (inf_bound > lines_or_equal_bound - && scalar_prod[lines_or_equal_bound] == 0) + + // Here all the lines in `dest_rows' saturate the constraint `source_k'. + PPL_ASSERT(index_non_zero >= num_lines_or_equalities); + // First, we reorder the generators in `dest_rows' as follows: + // -# all the lines should have indexes between 0 and + // `num_lines_or_equalities' - 1 (this already holds); + // -# all the rays that saturate the constraint should have + // indexes between `num_lines_or_equalities' and + // `lines_or_equal_bound' - 1; these rays form the set Q=. + // -# all the rays that have a positive scalar product with the + // constraint should have indexes between `lines_or_equal_bound' + // and `sup_bound' - 1; these rays form the set Q+. + // -# all the rays that have a negative scalar product with the + // constraint should have indexes between `sup_bound' and + // `dest_num_rows' - 1; these rays form the set Q-. + dimension_type lines_or_equal_bound = num_lines_or_equalities; + dimension_type inf_bound = dest_num_rows; + // While we find saturating generators, we simply increment + // `lines_or_equal_bound'. + while (inf_bound > lines_or_equal_bound + && scalar_prod[lines_or_equal_bound] == 0) { + ++lines_or_equal_bound; + } + dimension_type sup_bound = lines_or_equal_bound; + while (inf_bound > sup_bound) { + const int sp_sign = sgn(scalar_prod[sup_bound]); + if (sp_sign == 0) { + // This generator has to be moved in Q=. + swap(dest.sys.rows[sup_bound], dest.sys.rows[lines_or_equal_bound]); + swap(scalar_prod[sup_bound], scalar_prod[lines_or_equal_bound]); + swap(sat[sup_bound], sat[lines_or_equal_bound]); +#if PPL_QUICK_ADJ_TEST + swap(sat_num_ones[sup_bound], sat_num_ones[lines_or_equal_bound]); +#endif // PPL_QUICK_ADJ_TEST ++lines_or_equal_bound; - dimension_type sup_bound = lines_or_equal_bound; - while (inf_bound > sup_bound) { - const int sp_sign = sgn(scalar_prod[sup_bound]); - if (sp_sign == 0) { - // This generator has to be moved in Q=. - swap(dest.sys.rows[sup_bound], dest.sys.rows[lines_or_equal_bound]); - swap(scalar_prod[sup_bound], scalar_prod[lines_or_equal_bound]); - swap(sat[sup_bound], sat[lines_or_equal_bound]); - ++lines_or_equal_bound; - ++sup_bound; - dest_sorted = false; - } - else if (sp_sign < 0) { - // This generator has to be moved in Q-. - --inf_bound; - swap(dest.sys.rows[sup_bound], dest.sys.rows[inf_bound]); - swap(sat[sup_bound], sat[inf_bound]); - swap(scalar_prod[sup_bound], scalar_prod[inf_bound]); - dest_sorted = false; - } - else - // sp_sign > 0: this generator has to be moved in Q+. - ++sup_bound; + ++sup_bound; + dest_sorted = false; } + else if (sp_sign < 0) { + // This generator has to be moved in Q-. + --inf_bound; + swap(dest.sys.rows[sup_bound], dest.sys.rows[inf_bound]); + swap(sat[sup_bound], sat[inf_bound]); + swap(scalar_prod[sup_bound], scalar_prod[inf_bound]); +#if PPL_QUICK_ADJ_TEST + swap(sat_num_ones[sup_bound], sat_num_ones[inf_bound]); +#endif // PPL_QUICK_ADJ_TEST + dest_sorted = false; + } + else { + // sp_sign > 0: this generator has to be moved in Q+. + ++sup_bound; + } + } - if (sup_bound == dest_num_rows) { - // Here the set Q- is empty. - // If the constraint is an inequality, then all the generators - // in Q= and Q+ satisfy the constraint. The constraint is redundant - // and it can be safely removed from the constraint system. - // This is why the `source' parameter is not declared `const'. - if (source_k.is_ray_or_point_or_inequality()) { - redundant_source_rows.push_back(k); - } - else { - // The constraint is an equality, so that all the generators - // in Q+ violate it. Since the set Q- is empty, we can simply - // remove from `dest_rows' all the generators of Q+. - PPL_ASSERT(dest_num_rows >= lines_or_equal_bound); - while (dest_num_rows != lines_or_equal_bound) { - recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); - swap(dest.sys.rows.back(), recyclable_dest_rows.back()); - dest.sys.rows.pop_back(); - --dest_num_rows; - } - PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); - } + if (sup_bound == dest_num_rows) { + // Here the set Q- is empty. + // If the constraint is an inequality, then all the generators + // in Q= and Q+ satisfy the constraint. The constraint is redundant + // and it can be safely removed from the constraint system. + // This is why the `source' parameter is not declared `const'. + if (source_k.is_ray_or_point_or_inequality()) { + redundant_source_rows.push_back(k); } else { - // The set Q- is not empty, i.e., at least one generator - // violates the constraint `source_k'. - // We have to further distinguish two cases: - if (sup_bound == num_lines_or_equalities) { - // The set Q+ is empty, so that all generators that satisfy - // the constraint also saturate it. - // We can simply remove from `dest_rows' all the generators in Q-. - PPL_ASSERT(dest_num_rows >= sup_bound); - while (dest_num_rows != sup_bound) { - recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); - swap(dest.sys.rows.back(), recyclable_dest_rows.back()); - dest.sys.rows.pop_back(); - --dest_num_rows; + // The constraint is an equality, so that all the generators + // in Q+ violate it. Since the set Q- is empty, we can simply + // remove from `dest_rows' all the generators of Q+. + PPL_ASSERT(dest_num_rows >= lines_or_equal_bound); + while (dest_num_rows != lines_or_equal_bound) { + recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); + swap(dest.sys.rows.back(), recyclable_dest_rows.back()); + dest.sys.rows.pop_back(); + --dest_num_rows; } - PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); + PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); + } + // Finished handling the case when Q- is empty: + // continue with next `k'. + continue; + } + + // The set Q- is not empty, i.e., at least one generator + // violates the constraint `source_k'. + if (sup_bound == num_lines_or_equalities) { + // The set Q+ is empty, so that all generators that satisfy + // the constraint also saturate it. + // We can simply remove from `dest_rows' all the generators in Q-. + PPL_ASSERT(dest_num_rows >= sup_bound); + while (dest_num_rows != sup_bound) { + recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); + swap(dest.sys.rows.back(), recyclable_dest_rows.back()); + dest.sys.rows.pop_back(); + --dest_num_rows; + } + PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); + // Finished handling the case when Q+ is empty: + // continue with next `k'. + continue; + } + + // The sets Q+ and Q- are both non-empty. + // The generators of the new pointed cone are all those satisfying + // the constraint `source_k' plus a set of new rays enjoying + // the following properties: + // -# they lie on the hyper-plane represented by the constraint + // -# they are obtained as a positive combination of two + // adjacent rays, the first taken from Q+ and the second + // taken from Q-. + + const dimension_type bound = dest_num_rows; + +#if PPL_QUICK_NON_ADJ_TEST + // For the quick non-adjacency test, we refer to the definition + // of a minimal proper face (see comments in Polyhedron_defs.hh): + // an extremal ray saturates at least `n' - `t' - 1 constraints, + // where `n' is the dimension of the space and `t' is the dimension + // of the lineality space. Since `n == source_num_columns - 1' and + // `t == num_lines_or_equalities', we obtain that an extremal ray + // saturates at least `source_num_columns - num_lines_or_equalities - 2' + // constraints. + const dimension_type min_saturators + = source_num_columns - num_lines_or_equalities - 2; + // NOTE: we are treating the `k'-th constraint. + const dimension_type max_saturators = k - redundant_source_rows.size(); +#endif // PPL_QUICK_NON_ADJ_TEST + + // In the following loop, + // `i' runs through the generators in the set Q+ and + // `j' runs through the generators in the set Q-. + for (dimension_type i = lines_or_equal_bound; i < sup_bound; ++i) { + for (dimension_type j = sup_bound; j < bound; ++j) { + // Checking if generators `dest_rows[i]' and `dest_rows[j]' are + // adjacent. + // If there exist another generator that saturates + // all the constraints saturated by both `dest_rows[i]' and + // `dest_rows[j]', then they are NOT adjacent. + PPL_ASSERT(sat[i].last() == C_Integer::max + || sat[i].last() < k); + PPL_ASSERT(sat[j].last() == C_Integer::max + || sat[j].last() < k); + + // Being the union of `sat[i]' and `sat[j]', + // `new_satrow' corresponds to a ray that saturates all the + // constraints saturated by both `dest_rows[i]' and + // `dest_rows[j]'. + Bit_Row new_satrow(sat[i], sat[j]); + + // Even before actually creating the new ray as a + // positive combination of `dest_rows[i]' and `dest_rows[j]', + // we exploit saturation information to perform: + // - a quick non-adjacency test; + // - a quick adjacency test. + +#if (PPL_QUICK_NON_ADJ_TEST || PPL_QUICK_ADJ_TEST) + // Compute the number of common saturators. + dimension_type new_satrow_ones = new_satrow.count_ones(); +#endif // (PPL_QUICK_NON_ADJ_TEST || PPL_QUICK_ADJ_TEST) + +#if PPL_QUICK_NON_ADJ_TEST + const dimension_type num_common_satur + = max_saturators - new_satrow_ones; + if (num_common_satur < min_saturators) { + // Quick non-adjacency test succeded: consider next `j'. + continue; } - else { - // The sets Q+ and Q- are both non-empty. - // The generators of the new pointed cone are all those satisfying - // the constraint `source_k' plus a set of new rays enjoying - // the following properties: - // -# they lie on the hyper-plane represented by the constraint - // -# they are obtained as a positive combination of two - // adjacent rays, the first taken from Q+ and the second - // taken from Q-. - - // The adjacency property is necessary to have an irredundant - // set of new rays (see proposition 2). - const dimension_type bound = dest_num_rows; - - // In the following loop, - // `i' runs through the generators in the set Q+ and - // `j' runs through the generators in the set Q-. - for (dimension_type i = lines_or_equal_bound; i < sup_bound; ++i) { - for(dimension_type j = sup_bound; j < bound; ++j) { - // Checking if generators `dest_rows[i]' and `dest_rows[j]' are - // adjacent. - // If there exist another generator that saturates - // all the constraints saturated by both `dest_rows[i]' and - // `dest_rows[j]', then they are NOT adjacent. - PPL_ASSERT(sat[i].last() == C_Integer::max - || sat[i].last() < k); - PPL_ASSERT(sat[j].last() == C_Integer::max - || sat[j].last() < k); - - // Being the union of `sat[i]' and `sat[j]', - // `new_satrow' corresponds to a ray that saturates all the - // constraints saturated by both `dest_rows[i]' and - // `dest_rows[j]'. - Bit_Row new_satrow(sat[i], sat[j]); - - // Compute the number of common saturators. - // NOTE: this number has to be less than `k' because - // we are treating the `k'-th constraint. - const dimension_type num_common_satur - = k - redundant_source_rows.size() - new_satrow.count_ones(); - - // Even before actually creating the new ray as a - // positive combination of `dest_rows[i]' and `dest_rows[j]', - // we exploit saturation information to check if - // it can be an extremal ray. To this end, we refer - // to the definition of a minimal proper face - // (see comments in Polyhedron_defs.hh): - // an extremal ray saturates at least `n' - `t' - 1 - // constraints, where `n' is the dimension of the space - // and `t' is the dimension of the lineality space. - // Since `n == source_num_columns - 1' and - // `t == num_lines_or_equalities', we obtain that - // an extremal ray saturates at least - // `source_num_columns - num_lines_or_equalities - 2' - // constraints. - if (num_common_satur - >= source_num_columns - num_lines_or_equalities - 2) { - // The minimal proper face rule is satisfied. - // Now we actually check for redundancy by computing - // adjacency information. - bool redundant = false; - WEIGHT_BEGIN(); - for (dimension_type - l = num_lines_or_equalities; l < bound; ++l) - if (l != i && l != j - && subset_or_equal(sat[l], new_satrow)) { - // Found another generator saturating all the - // constraints saturated by both `dest_rows[i]' and - // `dest_rows[j]'. - redundant = true; - break; - } - PPL_ASSERT(bound >= num_lines_or_equalities); - WEIGHT_ADD_MUL(15, bound - num_lines_or_equalities); - if (!redundant) { - // Adding the new ray to `dest_rows' and the corresponding - // saturation row to `sat'. - dest_row_type new_row; - if (recyclable_dest_rows.empty()) { - sat.add_recycled_row(new_satrow); - } - else { - swap(new_row, recyclable_dest_rows.back()); - recyclable_dest_rows.pop_back(); - new_row.set_space_dimension_no_ok(source_space_dim); - swap(sat[dest_num_rows], new_satrow); - } - - // The following fragment optimizes the computation of - // - // - // Coefficient scale = scalar_prod[i]; - // scale.gcd_assign(scalar_prod[j]); - // Coefficient normalized_sp_i = scalar_prod[i] / scale; - // Coefficient normalized_sp_j = scalar_prod[j] / scale; - // for (dimension_type c = dest_num_columns; c-- > 0; ) { - // new_row[c] = normalized_sp_i * dest[j][c]; - // new_row[c] -= normalized_sp_j * dest[i][c]; - // } - // - normalize2(scalar_prod[i], - scalar_prod[j], - normalized_sp_i, - normalized_sp_o); - WEIGHT_BEGIN(); - - neg_assign(normalized_sp_o); - new_row = dest.sys.rows[j]; - // TODO: Check if the following assertions hold. - PPL_ASSERT(normalized_sp_i != 0); - PPL_ASSERT(normalized_sp_o != 0); - new_row.expr.linear_combine(dest.sys.rows[i].expr, - normalized_sp_i, normalized_sp_o); - - WEIGHT_ADD_MUL(86, source_space_dim); - new_row.strong_normalize(); - // Don't assert new_row.OK() here, because it may fail if - // the parameter `dest' contained a row that wasn't ok. - // Since we added a new generator to `dest_rows', - // we also add a new element to `scalar_prod'; - // by construction, the new ray lies on the hyper-plane - // represented by the constraint `source_k'. - // Thus, the added scalar product is 0. - PPL_ASSERT(scalar_prod.size() >= dest_num_rows); - if (scalar_prod.size() <= dest_num_rows) - scalar_prod.push_back(Coefficient_zero()); - else - scalar_prod[dest_num_rows] = Coefficient_zero(); - - dest.sys.rows.resize(dest.sys.rows.size() + 1); - swap(dest.sys.rows.back(), new_row); - // Increment the number of generators. - ++dest_num_rows; - } // if (!redundant) - } +#endif // PPL_QUICK_NON_ADJ_TEST + +#if PPL_QUICK_ADJ_TEST + // If either `sat[i]' or `sat[j]' has exactly one more zeroes + // than `new_satrow', then `dest_rows[i]' and `dest_rows[j]' + // are adjacent. Equivalently, adjacency holds if `new_satrow_ones' + // is equal to 1 plus the maximum of `sat_num_ones[i]' and + // `sat_num_ones[j]'. + const dimension_type max_ones_i_j + = std::max(sat_num_ones[i], sat_num_ones[j]); + if (max_ones_i_j + 1 == new_satrow_ones) { + // Quick adjacency test succeded: skip the full test. + goto are_adjacent; + } +#endif // PPL_QUICK_ADJ_TEST + + // Perform the full (combinatorial) adjacency test. + { + bool redundant = false; + WEIGHT_BEGIN(); + for (dimension_type l = num_lines_or_equalities; l < bound; ++l) { + if (l != i && l != j + && subset_or_equal(sat[l], new_satrow)) { + // Found another generator saturating all the constraints + // saturated by both `dest_rows[i]' and `dest_rows[j]'. + redundant = true; + break; } - // Check if the client has requested abandoning all expensive - // computations. If so, the exception specified by the client - // is thrown now. - maybe_abandon(); - } - // Now we substitute the rays in Q- (i.e., the rays violating - // the constraint) with the newly added rays. - dimension_type j; - if (source_k.is_ray_or_point_or_inequality()) { - // The constraint is an inequality: - // the violating generators are those in Q-. - j = sup_bound; - // For all the generators in Q+, set to 1 the corresponding - // entry for the constraint `source_k' in the saturation matrix. - - // After the removal of redundant rows in `source', the k-th - // row will have index `new_k'. - const dimension_type new_k = k - redundant_source_rows.size(); - for (dimension_type l = lines_or_equal_bound; l < sup_bound; ++l) - sat[l].set(new_k); } - else - // The constraint is an equality: - // the violating generators are those in the union of Q+ and Q-. - j = lines_or_equal_bound; - - // Swapping the newly added rays - // (index `i' running through `dest_num_rows - 1' down-to `bound') - // with the generators violating the constraint - // (index `j' running through `j' up-to `bound - 1'). - dimension_type i = dest_num_rows; - while (j < bound && i > bound) { - --i; - swap(dest.sys.rows[i], dest.sys.rows[j]); - swap(scalar_prod[i], scalar_prod[j]); - swap(sat[i], sat[j]); - ++j; - dest_sorted = false; + PPL_ASSERT(bound >= num_lines_or_equalities); + WEIGHT_ADD_MUL(15, bound - num_lines_or_equalities); + if (redundant) { + // Full non-adjacency test succeded: consider next `j'. + continue; } - // Setting the number of generators in `dest': - // - if the number of generators violating the constraint - // is less than or equal to the number of the newly added - // generators, we assign `i' to `dest_num_rows' because - // all generators above this index are significant; - // - otherwise, we assign `j' to `dest_num_rows' because - // all generators below index `j-1' violates the constraint. - const dimension_type new_num_rows = (j == bound) ? i : j; - PPL_ASSERT(dest_num_rows >= new_num_rows); - while (dest_num_rows != new_num_rows) { - recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); - swap(dest.sys.rows.back(), recyclable_dest_rows.back()); - dest.sys.rows.pop_back(); - --dest_num_rows; - } - PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); } + +#if PPL_QUICK_ADJ_TEST + are_adjacent: +#endif // PPL_QUICK_ADJ_TEST + // Adding the new ray to `dest_rows' and the corresponding + // saturation row to `sat'. + dest_row_type new_row; + if (recyclable_dest_rows.empty()) { + sat.add_recycled_row(new_satrow); +#if PPL_QUICK_ADJ_TEST + sat_num_ones.push_back(new_satrow_ones); +#endif // PPL_QUICK_ADJ_TEST + } + else { + swap(new_row, recyclable_dest_rows.back()); + recyclable_dest_rows.pop_back(); + new_row.set_space_dimension_no_ok(source_space_dim); + swap(sat[dest_num_rows], new_satrow); +#if PPL_QUICK_ADJ_TEST + swap(sat_num_ones[dest_num_rows], new_satrow_ones); +#endif // PPL_QUICK_ADJ_TEST + } + + // The following fragment optimizes the computation of + // + // + // Coefficient scale = scalar_prod[i]; + // scale.gcd_assign(scalar_prod[j]); + // Coefficient normalized_sp_i = scalar_prod[i] / scale; + // Coefficient normalized_sp_j = scalar_prod[j] / scale; + // for (dimension_type c = dest_num_columns; c-- > 0; ) { + // new_row[c] = normalized_sp_i * dest[j][c]; + // new_row[c] -= normalized_sp_j * dest[i][c]; + // } + // + normalize2(scalar_prod[i], + scalar_prod[j], + normalized_sp_i, + normalized_sp_o); + WEIGHT_BEGIN(); + + neg_assign(normalized_sp_o); + new_row = dest.sys.rows[j]; + // TODO: Check if the following assertions hold. + PPL_ASSERT(normalized_sp_i != 0); + PPL_ASSERT(normalized_sp_o != 0); + new_row.expr.linear_combine(dest.sys.rows[i].expr, + normalized_sp_i, normalized_sp_o); + + WEIGHT_ADD_MUL(86, source_space_dim); + new_row.strong_normalize(); + // Don't assert new_row.OK() here, because it may fail if + // the parameter `dest' contained a row that wasn't ok. + // Since we added a new generator to `dest_rows', + // we also add a new element to `scalar_prod'; + // by construction, the new ray lies on the hyper-plane + // represented by the constraint `source_k'. + // Thus, the added scalar product is 0. + PPL_ASSERT(scalar_prod.size() >= dest_num_rows); + if (scalar_prod.size() <= dest_num_rows) { + scalar_prod.push_back(Coefficient_zero()); + } + else { + scalar_prod[dest_num_rows] = Coefficient_zero(); + } + dest.sys.rows.resize(dest.sys.rows.size() + 1); + swap(dest.sys.rows.back(), new_row); + // Increment the number of generators. + ++dest_num_rows; + } // End of loop on `j'. + // Check if the client has requested abandoning all expensive + // computations. If so, the exception specified by the client + // is thrown now. + maybe_abandon(); + } // End of loop on `i'. + // Now we substitute the rays in Q- (i.e., the rays violating + // the constraint) with the newly added rays. + dimension_type j; + if (source_k.is_ray_or_point_or_inequality()) { + // The constraint is an inequality: + // the violating generators are those in Q-. + j = sup_bound; + // For all the generators in Q+, set to 1 the corresponding + // entry for the constraint `source_k' in the saturation matrix. + + // After the removal of redundant rows in `source', the k-th + // row will have index `new_k'. + const dimension_type new_k = k - redundant_source_rows.size(); + for (dimension_type l = lines_or_equal_bound; + l < sup_bound; ++l) { + sat[l].set(new_k); +#if PPL_QUICK_ADJ_TEST + ++sat_num_ones[l]; +#endif // PPL_PPL_QUICK_ADJ_TEST } } - } + else { + // The constraint is an equality: + // the violating generators are those in the union of Q+ and Q-. + j = lines_or_equal_bound; + } + // Swapping the newly added rays + // (index `i' running through `dest_num_rows - 1' down-to `bound') + // with the generators violating the constraint + // (index `j' running through `j' up-to `bound - 1'). + dimension_type i = dest_num_rows; + while (j < bound && i > bound) { + --i; + swap(dest.sys.rows[i], dest.sys.rows[j]); + swap(scalar_prod[i], scalar_prod[j]); + swap(sat[i], sat[j]); +#if PPL_QUICK_ADJ_TEST + swap(sat_num_ones[i], sat_num_ones[j]); +#endif // PPL_QUICK_ADJ_TEST + ++j; + dest_sorted = false; + } + // Setting the number of generators in `dest': + // - if the number of generators violating the constraint + // is less than or equal to the number of the newly added + // generators, we assign `i' to `dest_num_rows' because + // all generators above this index are significant; + // - otherwise, we assign `j' to `dest_num_rows' because + // all generators below index `j-1' violates the constraint. + const dimension_type new_num_rows = (j == bound) ? i : j; + PPL_ASSERT(dest_num_rows >= new_num_rows); + while (dest_num_rows != new_num_rows) { + recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); + swap(dest.sys.rows.back(), recyclable_dest_rows.back()); + dest.sys.rows.pop_back(); + --dest_num_rows; + } + PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); + } // End of loop on `k'. // We may have identified some redundant constraints in `source', // which have been swapped at the end of the system. @@ -885,8 +982,9 @@ // `start == source_num_rows' (i.e., the second sub-system is empty) // or the row ordering holds for the two rows at the boundary between // the two sub-systems. - if (start > 0 && start < source.num_rows()) + if (start > 0 && start < source.num_rows()) { source.set_sorted(compare(source[start - 1], source[start]) <= 0); + } // There are no longer pending constraints in `source'. source.unset_pending_rows(); @@ -896,21 +994,24 @@ const dimension_type num_removed_rows = recyclable_dest_rows.size(); sat.remove_trailing_rows(num_removed_rows); } - if (dest_sorted) + if (dest_sorted) { // If the non-pending generators in `dest' are still declared to be // sorted, then we have to also check for the sortedness of the // pending generators. - for (dimension_type i = dest_first_pending_row; i < dest_num_rows; ++i) + for (dimension_type i = dest_first_pending_row; + i < dest_num_rows; ++i) { if (compare(dest.sys.rows[i - 1], dest.sys.rows[i]) > 0) { dest_sorted = false; break; } - + } + } #ifndef NDEBUG // The previous code can modify the rows' fields, exploiting the friendness. // Check that all rows are OK now. - for (dimension_type i = dest.num_rows(); i-- > 0; ) + for (dimension_type i = dest.num_rows(); i-- > 0; ) { PPL_ASSERT(dest.sys.rows[i].OK()); + } #endif dest.sys.index_first_pending = dest.num_rows(); diff -Nru ppl-1.1/src/Polyhedron_defs.hh ppl-1.2/src/Polyhedron_defs.hh --- ppl-1.1/src/Polyhedron_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Polyhedron class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Polyhedron_inlines.hh ppl-1.2/src/Polyhedron_inlines.hh --- ppl-1.1/src/Polyhedron_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Polyhedron class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -98,8 +98,9 @@ inline void Polyhedron::m_swap(Polyhedron& y) { - if (topology() != y.topology()) + if (topology() != y.topology()) { throw_topology_incompatible("swap(y)", "y", y); + } using std::swap; swap(con_sys, y.con_sys); swap(gen_sys, y.gen_sys); @@ -184,13 +185,15 @@ inline bool Polyhedron::is_empty() const { - if (marked_empty()) + if (marked_empty()) { return true; + } // Try a fast-fail test: if generators are up-to-date and // there are no pending constraints, then the generator system // (since it is well formed) contains a point. - if (generators_are_up_to_date() && !has_pending_constraints()) + if (generators_are_up_to_date() && !has_pending_constraints()) { return false; + } return !minimize(); } @@ -298,8 +301,9 @@ PPL_ASSERT(space_dim > 0 && !marked_empty()); PPL_ASSERT(has_something_pending()); - if (has_pending_constraints()) + if (has_pending_constraints()) { return process_pending_constraints(); + } PPL_ASSERT(has_pending_generators()); process_pending_generators(); @@ -350,10 +354,12 @@ Polyhedron::simplified_constraints() const { PPL_ASSERT(constraints_are_up_to_date()); Constraint_System cs(con_sys); - if (cs.num_pending_rows() > 0) + if (cs.num_pending_rows() > 0) { cs.unset_pending_rows(); - if (has_pending_constraints() || !constraints_are_minimized()) + } + if (has_pending_constraints() || !constraints_are_minimized()) { cs.simplify(); + } return cs; } diff -Nru ppl-1.1/src/Polyhedron_minimize_templates.hh ppl-1.2/src/Polyhedron_minimize_templates.hh --- ppl-1.1/src/Polyhedron_minimize_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_minimize_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Polyhedron class implementation: minimize() and add_and_minimize(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -85,9 +85,9 @@ PPL_ASSERT(!source.has_no_rows()); // Sort the source system, if necessary. - if (!source.is_sorted()) + if (!source.is_sorted()) { source.sort_rows(); - + } // Initialization of the system of generators `dest'. // The algorithm works incrementally and we haven't seen any // constraint yet: as a consequence, `dest' should describe @@ -106,13 +106,16 @@ for (dimension_type i = 0; i < dest_num_rows; ++i) { Linear_Expression expr; expr.set_space_dimension(dest_num_rows - 1); - if (i == 0) + if (i == 0) { expr += 1; - else + } + else { expr += Variable(i - 1); + } dest_row_type dest_i(expr, dest_row_type::LINE_OR_EQUALITY, NECESSARILY_CLOSED); - if (dest.topology() == NOT_NECESSARILY_CLOSED) + if (dest.topology() == NOT_NECESSARILY_CLOSED) { dest_i.mark_as_not_necessarily_closed(); + } dest.sys.insert_no_ok(dest_i, Recycle_Input()); } // The identity matrix `dest' is not sorted (see the sorting rules @@ -149,8 +152,9 @@ dest_num_rows = dest.num_rows(); #ifndef NDEBUG - for (dimension_type i = dest.num_rows(); i-- > 0; ) + for (dimension_type i = dest.num_rows(); i-- > 0; ) { PPL_ASSERT(dest[i].OK()); + } #endif // Checking if the generators in `dest' represent an empty polyhedron: @@ -163,22 +167,27 @@ if (dest.is_necessarily_closed()) { for (first_point = num_lines_or_equalities; first_point < dest_num_rows; - ++first_point) - if (dest[first_point].expr.inhomogeneous_term() > 0) + ++first_point) { + if (dest[first_point].expr.inhomogeneous_term() > 0) { break; + } + } } else { for (first_point = num_lines_or_equalities; first_point < dest_num_rows; - ++first_point) - if (dest[first_point].expr.get(Variable(dest.space_dimension())) > 0) + ++first_point) { + if (dest[first_point].expr.get(Variable(dest.space_dimension())) > 0) { break; + } + } } - if (first_point == dest_num_rows) - if (con_to_gen) + if (first_point == dest_num_rows) { + if (con_to_gen) { // No point has been found: the polyhedron is empty. return true; + } else { // Here `con_to_gen' is false: `dest' is a system of constraints. // In this case the condition `first_point == dest_num_rows' @@ -191,6 +200,7 @@ PPL_UNREACHABLE; return false; } + } else { // A point has been found: the polyhedron is not empty. // Now invoking simplify() to remove all the redundant constraints @@ -289,9 +299,10 @@ // we can increment index `k1' too. ++k1; } - else if (cmp < 0) + else if (cmp < 0) { // By sortedness, we can increment `k1'. ++k1; + } else { // Here `cmp > 0'. // By sortedness, `source2[k2]' cannot be in `source1'. @@ -302,19 +313,21 @@ } } // Have we scanned all the rows in `source2'? - if (k2 < source2_num_rows) + if (k2 < source2_num_rows) { // By sortedness, all the rows in `source2' having indexes // greater than or equal to `k2' were not in `source1'. // We add them as pending rows of 'source1' (sortedness not affected). - for ( ; k2 < source2_num_rows; ++k2) + for ( ; k2 < source2_num_rows; ++k2) { source1.add_pending_row(source2[k2]); + } + } - if (source1.num_pending_rows() == 0) + if (source1.num_pending_rows() == 0) { // No row was appended to `source1', because all the constraints // in `source2' were already in `source1'. // There is nothing left to do ... return false; - + } return add_and_minimize(con_to_gen, source1, dest, sat); } @@ -388,22 +401,27 @@ if (dest.is_necessarily_closed()) { for (first_point = num_lines_or_equalities; first_point < dest_num_rows; - ++first_point) - if (dest[first_point].expr.inhomogeneous_term() > 0) + ++first_point) { + if (dest[first_point].expr.inhomogeneous_term() > 0) { break; + } + } } else { for (first_point = num_lines_or_equalities; first_point < dest_num_rows; - ++first_point) - if (dest[first_point].expr.get(Variable(dest.space_dimension())) > 0) + ++first_point) { + if (dest[first_point].expr.get(Variable(dest.space_dimension())) > 0) { break; + } + } } - if (first_point == dest_num_rows) - if (con_to_gen) + if (first_point == dest_num_rows) { + if (con_to_gen) { // No point has been found: the polyhedron is empty. return true; + } else { // Here `con_to_gen' is false: `dest' is a system of constraints. // In this case the condition `first_point == dest_num_rows' @@ -416,6 +434,7 @@ PPL_UNREACHABLE; return false; } + } else { // A point has been found: the polyhedron is not empty. // Now invoking `simplify()' to remove all the redundant constraints diff -Nru ppl-1.1/src/Polyhedron_nonpublic.cc ppl-1.2/src/Polyhedron_nonpublic.cc --- ppl-1.1/src/Polyhedron_nonpublic.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_nonpublic.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Polyhedron class implementation (non-inline private or protected functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,7 +28,7 @@ #include "Scalar_Products_inlines.hh" #include "Linear_Form_defs.hh" #include "C_Integer.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -59,8 +59,9 @@ // Protecting against space dimension overflow is up to the caller. PPL_ASSERT(num_dimensions <= max_space_dimension()); - if (kind == EMPTY) + if (kind == EMPTY) { status.set_empty(); + } else if (num_dimensions > 0) { con_sys.add_low_level_constraints(); con_sys.adjust_topology_and_space_dimension(topol, num_dimensions); @@ -77,14 +78,18 @@ space_dim(y.space_dim) { // Being a protected method, we simply assert that topologies do match. PPL_ASSERT(topology() == y.topology()); - if (y.constraints_are_up_to_date()) + if (y.constraints_are_up_to_date()) { con_sys.assign_with_pending(y.con_sys); - if (y.generators_are_up_to_date()) + } + if (y.generators_are_up_to_date()) { gen_sys.assign_with_pending(y.gen_sys); - if (y.sat_c_is_up_to_date()) + } + if (y.sat_c_is_up_to_date()) { sat_c = y.sat_c; - if (y.sat_g_is_up_to_date()) + } + if (y.sat_g_is_up_to_date()) { sat_g = y.sat_g; + } } PPL::Polyhedron::Polyhedron(const Topology topol, const Constraint_System& cs) @@ -100,11 +105,11 @@ // Try to adapt `cs_copy' to the required topology. const dimension_type cs_copy_space_dim = cs_copy.space_dimension(); - if (!cs_copy.adjust_topology_and_space_dimension(topol, cs_copy_space_dim)) + if (!cs_copy.adjust_topology_and_space_dimension(topol, cs_copy_space_dim)) { throw_topology_incompatible((topol == NECESSARILY_CLOSED) ? "C_Polyhedron(cs)" : "NNC_Polyhedron(cs)", "cs", cs_copy); - + } // Set the space dimension. space_dim = cs_copy_space_dim; @@ -126,12 +131,13 @@ else { // Here `space_dim == 0'. // See if an inconsistent constraint has been passed. - for (dimension_type i = cs_copy.num_rows(); i-- > 0; ) + for (dimension_type i = cs_copy.num_rows(); i-- > 0; ) { if (cs_copy[i].is_inconsistent()) { // Inconsistent constraint found: the polyhedron is empty. set_empty(); break; } + } } PPL_ASSERT_HEAVY(OK()); } @@ -148,10 +154,11 @@ // Try to adapt `cs' to the required topology. const dimension_type cs_space_dim = cs.space_dimension(); - if (!cs.adjust_topology_and_space_dimension(topol, cs_space_dim)) + if (!cs.adjust_topology_and_space_dimension(topol, cs_space_dim)) { throw_topology_incompatible((topol == NECESSARILY_CLOSED) ? "C_Polyhedron(cs, recycle)" : "NNC_Polyhedron(cs, recycle)", "cs", cs); + } // Set the space dimension. space_dim = cs_space_dim; @@ -174,12 +181,13 @@ // Here `space_dim == 0'. // See if an inconsistent constraint has been passed. - for (dimension_type i = cs.num_rows(); i-- > 0; ) + for (dimension_type i = cs.num_rows(); i-- > 0; ) { if (cs[i].is_inconsistent()) { // Inconsistent constraint found: the polyhedron is empty. set_empty(); break; } + } } PPL_ASSERT_HEAVY(OK()); } @@ -201,20 +209,21 @@ } // Non-empty valid generator systems have a supporting point, at least. - if (!gs.has_points()) + if (!gs.has_points()) { throw_invalid_generators((topol == NECESSARILY_CLOSED) ? "C_Polyhedron(gs)" : "NNC_Polyhedron(gs)", "gs"); - + } // TODO: this implementation is just an executable specification. Generator_System gs_copy = gs; const dimension_type gs_copy_space_dim = gs_copy.space_dimension(); // Try to adapt `gs_copy' to the required topology. - if (!gs_copy.adjust_topology_and_space_dimension(topol, gs_copy_space_dim)) + if (!gs_copy.adjust_topology_and_space_dimension(topol, gs_copy_space_dim)) { throw_topology_incompatible((topol == NECESSARILY_CLOSED) ? "C_Polyhedron(gs)" : "NNC_Polyhedron(gs)", "gs", gs_copy); + } if (gs_copy_space_dim > 0) { // Stealing the rows from `gs_copy'. @@ -222,8 +231,9 @@ swap(gen_sys, gs_copy); // In a generator system describing a NNC polyhedron, // for each point we must also have the corresponding closure point. - if (topol == NOT_NECESSARILY_CLOSED) + if (topol == NOT_NECESSARILY_CLOSED) { gen_sys.add_corresponding_closure_points(); + } if (gen_sys.num_pending_rows() > 0) { // Even though `gs_copy' has pending generators, since the // constraints of the polyhedron are not up-to-date, the @@ -267,25 +277,28 @@ } // Non-empty valid generator systems have a supporting point, at least. - if (!gs.has_points()) + if (!gs.has_points()) { throw_invalid_generators((topol == NECESSARILY_CLOSED) ? "C_Polyhedron(gs, recycle)" : "NNC_Polyhedron(gs, recycle)", "gs"); + } const dimension_type gs_space_dim = gs.space_dimension(); // Try to adapt `gs' to the required topology. - if (!gs.adjust_topology_and_space_dimension(topol, gs_space_dim)) + if (!gs.adjust_topology_and_space_dimension(topol, gs_space_dim)) { throw_topology_incompatible((topol == NECESSARILY_CLOSED) ? "C_Polyhedron(gs, recycle)" : "NNC_Polyhedron(gs, recycle)", "gs", gs); + } if (gs_space_dim > 0) { // Stealing the rows from `gs'. swap(gen_sys, gs); // In a generator system describing a NNC polyhedron, // for each point we must also have the corresponding closure point. - if (topol == NOT_NECESSARILY_CLOSED) + if (topol == NOT_NECESSARILY_CLOSED) { gen_sys.add_corresponding_closure_points(); + } if (gen_sys.num_pending_rows() > 0) { // Even though `gs' has pending generators, since the constraints // of the polyhedron are not up-to-date, the polyhedron cannot @@ -315,20 +328,26 @@ // Being a protected method, we simply assert that topologies do match. PPL_ASSERT(topology() == y.topology()); space_dim = y.space_dim; - if (y.marked_empty()) + if (y.marked_empty()) { set_empty(); - else if (space_dim == 0) + } + else if (space_dim == 0) { set_zero_dim_univ(); + } else { status = y.status; - if (y.constraints_are_up_to_date()) + if (y.constraints_are_up_to_date()) { con_sys.assign_with_pending(y.con_sys); - if (y.generators_are_up_to_date()) + } + if (y.generators_are_up_to_date()) { gen_sys.assign_with_pending(y.gen_sys); - if (y.sat_c_is_up_to_date()) + } + if (y.sat_c_is_up_to_date()) { sat_c = y.sat_c; - if (y.sat_g_is_up_to_date()) + } + if (y.sat_g_is_up_to_date()) { sat_g = y.sat_g; + } } return *this; } @@ -348,12 +367,14 @@ if (x.constraints_are_minimized() && y.constraints_are_minimized()) { // Equivalent minimized constraint systems have: // - the same number of constraints; ... - if (x.con_sys.num_rows() != y.con_sys.num_rows()) + if (x.con_sys.num_rows() != y.con_sys.num_rows()) { return Polyhedron::TVB_FALSE; + } // - the same number of equalities; ... const dimension_type x_num_equalities = x.con_sys.num_equalities(); - if (x_num_equalities != y.con_sys.num_equalities()) + if (x_num_equalities != y.con_sys.num_equalities()) { return Polyhedron::TVB_FALSE; + } // - if there are no equalities, they have the same constraints. // Delay this test: try cheaper tests on generators first. css_normalized = (x_num_equalities == 0); @@ -362,21 +383,25 @@ if (x.generators_are_minimized() && y.generators_are_minimized()) { // Equivalent minimized generator systems have: // - the same number of generators; ... - if (x.gen_sys.num_rows() != y.gen_sys.num_rows()) + if (x.gen_sys.num_rows() != y.gen_sys.num_rows()) { return Polyhedron::TVB_FALSE; + } // - the same number of lines; ... const dimension_type x_num_lines = x.gen_sys.num_lines(); - if (x_num_lines != y.gen_sys.num_lines()) + if (x_num_lines != y.gen_sys.num_lines()) { return Polyhedron::TVB_FALSE; + } // - if there are no lines, they have the same generators. if (x_num_lines == 0) { // Sort the two systems and check for syntactic identity. x.obtain_sorted_generators(); y.obtain_sorted_generators(); - if (x.gen_sys == y.gen_sys) + if (x.gen_sys == y.gen_sys) { return Polyhedron::TVB_TRUE; - else + } + else { return Polyhedron::TVB_FALSE; + } } } @@ -384,10 +409,12 @@ // Sort the two systems and check for identity. x.obtain_sorted_constraints(); y.obtain_sorted_constraints(); - if (x.con_sys == y.con_sys) + if (x.con_sys == y.con_sys) { return Polyhedron::TVB_TRUE; - else - return Polyhedron::TVB_FALSE; + } + else { + return Polyhedron::TVB_FALSE; + } } } } @@ -404,22 +431,28 @@ const Polyhedron& x = *this; // `x' cannot have pending constraints, because we need its generators. - if (x.has_pending_constraints() && !x.process_pending_constraints()) + if (x.has_pending_constraints() && !x.process_pending_constraints()) { return true; + } // `y' cannot have pending generators, because we need its constraints. - if (y.has_pending_generators()) + if (y.has_pending_generators()) { y.process_pending_generators(); + } #if BE_LAZY - if (!x.generators_are_up_to_date() && !x.update_generators()) + if (!x.generators_are_up_to_date() && !x.update_generators()) { return true; - if (!y.constraints_are_up_to_date()) + } + if (!y.constraints_are_up_to_date()) { y.update_constraints(); + } #else - if (!x.generators_are_minimized()) + if (!x.generators_are_minimized()) { x.minimize(); - if (!y.constraints_are_minimized()) + } + if (!y.constraints_are_minimized()) { y.minimize(); + } #endif PPL_ASSERT_HEAVY(x.OK()); @@ -428,7 +461,7 @@ const Generator_System& gs = x.gen_sys; const Constraint_System& cs = y.con_sys; - if (x.is_necessarily_closed()) + if (x.is_necessarily_closed()) { // When working with necessarily closed polyhedra, // `x' is contained in `y' if and only if all the generators of `x' // satisfy all the inequalities and saturate all the equalities of `y'. @@ -442,22 +475,28 @@ const Generator& g = gs[j]; const int sp_sign = Scalar_Products::sign(c, g); if (g.is_line()) { - if (sp_sign != 0) + if (sp_sign != 0) { return false; + } } - else + else { // `g' is a ray or a point. - if (sp_sign < 0) + if (sp_sign < 0) { return false; + } + } } } else { // `c' is an equality. - for (dimension_type j = gs.num_rows(); j-- > 0; ) - if (Scalar_Products::sign(c, gs[j]) != 0) + for (dimension_type j = gs.num_rows(); j-- > 0; ) { + if (Scalar_Products::sign(c, gs[j]) != 0) { return false; + } + } } } + } else { // Here we have an NNC polyhedron: using the reduced scalar product, // which ignores the epsilon coefficient. @@ -469,19 +508,24 @@ const Generator& g = gs[j]; const int sp_sign = Scalar_Products::reduced_sign(c, g); if (g.is_line()) { - if (sp_sign != 0) + if (sp_sign != 0) { return false; + } } - else + else { // `g' is a ray or a point or a closure point. - if (sp_sign < 0) + if (sp_sign < 0) { return false; + } + } } break; case Constraint::EQUALITY: - for (dimension_type j = gs.num_rows(); j-- > 0; ) - if (Scalar_Products::reduced_sign(c, gs[j]) != 0) + for (dimension_type j = gs.num_rows(); j-- > 0; ) { + if (Scalar_Products::reduced_sign(c, gs[j]) != 0) { return false; + } + } break; case Constraint::STRICT_INEQUALITY: for (dimension_type j = gs.num_rows(); j-- > 0; ) { @@ -492,20 +536,23 @@ // If a point violates or saturates a strict inequality // (when ignoring the epsilon coefficients) then it is // not included in the polyhedron. - if (sp_sign <= 0) + if (sp_sign <= 0) { return false; + } break; case Generator::LINE: // Lines have to saturate all constraints. - if (sp_sign != 0) + if (sp_sign != 0) { return false; + } break; case Generator::RAY: // Intentionally fall through. case Generator::CLOSURE_POINT: // The generator is a ray or closure point: usual test. - if (sp_sign < 0) + if (sp_sign < 0) { return false; + } break; } } @@ -524,18 +571,19 @@ // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((from_above ? "bounds_from_above(e)" : "bounds_from_below(e)"), "e", expr); + } // A zero-dimensional or empty polyhedron bounds everything. if (space_dim == 0 || marked_empty() || (has_pending_constraints() && !process_pending_constraints()) - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { return true; - + } // The polyhedron has updated, possibly pending generators. for (dimension_type i = gen_sys.num_rows(); i-- > 0; ) { const Generator& g = gen_sys[i]; @@ -545,9 +593,10 @@ if (sp_sign != 0 && (g.is_line() || (from_above && sp_sign > 0) - || (!from_above && sp_sign < 0))) + || (!from_above && sp_sign < 0))) { // `*this' does not bound `expr'. return false; + } } } // No sources of unboundedness have been found for `expr' @@ -564,15 +613,17 @@ // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } // Deal with zero-dim polyhedra first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -585,8 +636,9 @@ // For an empty polyhedron we simply return false. if (marked_empty() || (has_pending_constraints() && !process_pending_constraints()) - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { return false; + } // The polyhedron has updated, possibly pending generators. // The following loop will iterate through the generator @@ -612,9 +664,10 @@ if (sp_sign != 0 && (gen_sys_i.is_line() || (maximize && sp_sign > 0) - || (!maximize && sp_sign < 0))) + || (!maximize && sp_sign < 0))) { // `expr' is unbounded in `*this'. return false; + } } else { // We have a point or a closure point. @@ -628,15 +681,15 @@ const bool g_is_point = gen_sys_i.is_point(); if (first_candidate || (maximize - && (candidate > extremum - || (g_is_point - && !ext_included - && candidate == extremum))) + && (candidate > extremum + || (g_is_point + && !ext_included + && candidate == extremum))) || (!maximize - && (candidate < extremum - || (g_is_point - && !ext_included - && candidate == extremum)))) { + && (candidate < extremum + || (g_is_point + && !ext_included + && candidate == extremum)))) { // We have a (new) candidate extremum. first_candidate = false; extremum = candidate; @@ -654,15 +707,8 @@ // The polyhedron is bounded in the right direction and we have // computed the extremum: write the result into the caller's structures. PPL_ASSERT(!first_candidate); - // FIXME: avoid these temporaries, if possible. - // This can be done adding an `assign' function working on native - // and checked or an operator= that have on one side a checked and - // on the other a native or checked. - // The reason why now we can't use operator= is the fact that we - // still can have Coefficient defined to mpz_class (and not - // Checked_Number). - ext_n = Coefficient(extremum.get_num()); - ext_d = Coefficient(extremum.get_den()); + ext_n = extremum.get_num(); + ext_d = extremum.get_den(); included = ext_included; g = gen_sys[ext_position]; @@ -696,10 +742,12 @@ // Integrate the pending part of the system of constraints and minimize. // We need `sat_c' up-to-date and `con_sys' sorted (together with `sat_c'). - if (!x.sat_c_is_up_to_date()) + if (!x.sat_c_is_up_to_date()) { x.sat_c.transpose_assign(x.sat_g); - if (!x.con_sys.is_sorted()) + } + if (!x.con_sys.is_sorted()) { x.obtain_sorted_constraints_with_sat_c(); + } // We sort in place the pending constraints, erasing those constraints // that also occur in the non-pending part of `con_sys'. x.con_sys.sort_pending_and_remove_duplicates(); @@ -713,8 +761,9 @@ const bool empty = add_and_minimize(true, x.con_sys, x.gen_sys, x.sat_c); PPL_ASSERT(x.con_sys.num_pending_rows() == 0); - if (empty) + if (empty) { x.set_empty(); + } else { x.clear_pending_constraints(); x.clear_sat_g_up_to_date(); @@ -733,10 +782,12 @@ // Integrate the pending part of the system of generators and minimize. // We need `sat_g' up-to-date and `gen_sys' sorted (together with `sat_g'). - if (!x.sat_g_is_up_to_date()) + if (!x.sat_g_is_up_to_date()) { x.sat_g.transpose_assign(x.sat_c); - if (!x.gen_sys.is_sorted()) + } + if (!x.gen_sys.is_sorted()) { x.obtain_sorted_generators_with_sat_g(); + } // We sort in place the pending generators, erasing those generators // that also occur in the non-pending part of `gen_sys'. x.gen_sys.sort_pending_and_remove_duplicates(); @@ -835,8 +886,9 @@ // If the system of constraints is not consistent the // polyhedron is empty. const bool empty = minimize(true, x.con_sys, x.gen_sys, x.sat_g); - if (empty) + if (empty) { x.set_empty(); + } else { // `sat_g' is the only saturation matrix up-to-date. x.set_sat_g_up_to_date(); @@ -863,7 +915,7 @@ // The columns of `sat_c' represent the constraints and // its rows represent the generators: resize accordingly. x.sat_c.resize(gsr, csr); - for (dimension_type i = gsr; i-- > 0; ) + for (dimension_type i = gsr; i-- > 0; ) { for (dimension_type j = csr; j-- > 0; ) { const int sp_sign = Scalar_Products::sign(con_sys[j], gen_sys[i]); // The negativity of this scalar product would mean @@ -871,13 +923,16 @@ // `con_sys[j]' and it is not possible because both generators // and constraints are up-to-date. PPL_ASSERT(sp_sign >= 0); - if (sp_sign > 0) + if (sp_sign > 0) { // `gen_sys[i]' satisfies (without saturate) `con_sys[j]'. x.sat_c[i].set(j); - else + } + else { // `gen_sys[i]' saturates `con_sys[j]'. x.sat_c[i].clear(j); + } } + } x.set_sat_c_up_to_date(); } @@ -895,7 +950,7 @@ // The columns of `sat_g' represent generators and its // rows represent the constraints: resize accordingly. x.sat_g.resize(csr, gsr); - for (dimension_type i = csr; i-- > 0; ) + for (dimension_type i = csr; i-- > 0; ) { for (dimension_type j = gsr; j-- > 0; ) { const int sp_sign = Scalar_Products::sign(con_sys[i], gen_sys[j]); // The negativity of this scalar product would mean @@ -903,13 +958,16 @@ // `con_sys[i]' and it is not possible because both generators // and constraints are up-to-date. PPL_ASSERT(sp_sign >= 0); - if (sp_sign > 0) + if (sp_sign > 0) { // `gen_sys[j]' satisfies (without saturate) `con_sys[i]'. x.sat_g[i].set(j); - else + } + else { // `gen_sys[j]' saturates `con_sys[i]'. x.sat_g[i].clear(j); + } } + } x.set_sat_g_up_to_date(); } @@ -932,10 +990,11 @@ x.set_sat_g_up_to_date(); x.clear_sat_c_up_to_date(); } - else + else { // If neither `sat_g' nor `sat_c' are up-to-date, // we just sort the constraints. x.con_sys.sort_rows(); + } } PPL_ASSERT(con_sys.check_sorted()); @@ -960,10 +1019,11 @@ x.set_sat_c_up_to_date(); x.clear_sat_g_up_to_date(); } - else + else { // If neither `sat_g' nor `sat_c' are up-to-date, we just sort // the generators. x.gen_sys.sort_rows(); + } } PPL_ASSERT(gen_sys.check_sorted()); @@ -976,14 +1036,15 @@ // `con_sys' will be sorted up to `index_first_pending'. Polyhedron& x = const_cast(*this); // At least one of the saturation matrices must be up-to-date. - if (!x.sat_c_is_up_to_date() && !x.sat_g_is_up_to_date()) + if (!x.sat_c_is_up_to_date() && !x.sat_g_is_up_to_date()) { x.update_sat_c(); - + } if (x.con_sys.is_sorted()) { - if (x.sat_c_is_up_to_date()) + if (x.sat_c_is_up_to_date()) { // If constraints are already sorted and sat_c is up to // date there is nothing to do. return; + } } else { if (!x.sat_g_is_up_to_date()) { @@ -1010,14 +1071,16 @@ // `gen_sys' will be sorted up to `index_first_pending'. Polyhedron& x = const_cast(*this); // At least one of the saturation matrices must be up-to-date. - if (!x.sat_c_is_up_to_date() && !x.sat_g_is_up_to_date()) + if (!x.sat_c_is_up_to_date() && !x.sat_g_is_up_to_date()) { x.update_sat_g(); + } if (x.gen_sys.is_sorted()) { - if (x.sat_g_is_up_to_date()) + if (x.sat_g_is_up_to_date()) { // If generators are already sorted and sat_g is up to // date there is nothing to do. return; + } } else { if (!x.sat_c_is_up_to_date()) { @@ -1041,10 +1104,12 @@ bool PPL::Polyhedron::minimize() const { // 0-dim space or empty polyhedra are already minimized. - if (marked_empty()) + if (marked_empty()) { return false; - if (space_dim == 0) + } + if (space_dim == 0) { return true; + } // If the polyhedron has something pending, process it. if (has_something_pending()) { @@ -1055,8 +1120,9 @@ // Here there are no pending constraints or generators. // Is the polyhedron already minimized? - if (constraints_are_minimized() && generators_are_minimized()) + if (constraints_are_minimized() && generators_are_minimized()) { return true; + } // If constraints or generators are up-to-date, invoking // update_generators() or update_constraints(), respectively, @@ -1087,14 +1153,14 @@ // We need `con_sys' (weakly) minimized and `gen_sys' up-to-date. // `minimize()' will process any pending constraints or generators. - if (!minimize()) + if (!minimize()) { return false; - + } // If the polyhedron `*this' is zero-dimensional // at this point it must be a universe polyhedron. - if (x.space_dim == 0) + if (x.space_dim == 0) { return true; - + } // We also need `sat_g' up-to-date. if (!sat_g_is_up_to_date()) { PPL_ASSERT(sat_c_is_up_to_date()); @@ -1110,7 +1176,7 @@ const dimension_type gs_rows = gen_sys.num_rows(); const dimension_type n_lines = gen_sys.num_lines(); - for (dimension_type i = gs_rows; i-- > n_lines; ) + for (dimension_type i = gs_rows; i-- > n_lines; ) { switch (gen_sys[i].type()) { case Generator::RAY: sat_all_but_rays.set(i); @@ -1126,6 +1192,7 @@ PPL_UNREACHABLE; break; } + } const Bit_Row sat_lines_and_rays(sat_all_but_points, sat_all_but_closure_points); const Bit_Row @@ -1147,7 +1214,7 @@ const Variable eps_var(cs.space_dimension()); // Note that cs.num_rows() is *not* constant because the calls to // cs.remove_row() decrease it. - for (dimension_type i = 0; i < cs.num_rows(); ) + for (dimension_type i = 0; i < cs.num_rows(); ) { if (cs[i].is_strict_inequality()) { // First, check if it is saturated by no closure points Bit_Row sat_ci; @@ -1182,7 +1249,7 @@ // when disregarding points. sat_ci.union_assign(sat[i], sat_all_but_points); bool eps_redundant = false; - for (dimension_type j = 0; j < cs.num_rows(); ++j) + for (dimension_type j = 0; j < cs.num_rows(); ++j) { if (i != j && cs[j].is_strict_inequality() && subset_or_equal(sat[j], sat_ci)) { // Constraint `cs[i]' is eps-redundant: @@ -1194,14 +1261,18 @@ changed = true; break; } + } // Continue with next constraint, which is already in place // due to the swap if we have found an eps-redundant constraint. - if (!eps_redundant) + if (!eps_redundant) { ++i; + } } - else + else { // `cs[i]' is not a strict inequality: consider next constraint. ++i; + } + } PPL_ASSERT(cs.num_pending_rows() == 0); @@ -1238,8 +1309,9 @@ PPL_ASSERT(status != UNFEASIBLE_MIP_PROBLEM); // If the epsilon dimension is actually unbounded, // then add the eps_leq_one constraint. - if (status == UNBOUNDED_MIP_PROBLEM) + if (status == UNBOUNDED_MIP_PROBLEM) { cs.insert(Constraint::epsilon_leq_one()); + } } } @@ -1256,13 +1328,14 @@ // We need `gen_sys' (weakly) minimized and `con_sys' up-to-date. // `minimize()' will process any pending constraints or generators. - if (!minimize()) + if (!minimize()) { return false; - + } // If the polyhedron `*this' is zero-dimensional // at this point it must be a universe polyhedron. - if (x.space_dim == 0) + if (x.space_dim == 0) { return true; + } // We also need `sat_c' up-to-date. if (!sat_c_is_up_to_date()) { @@ -1275,9 +1348,11 @@ Bit_Row sat_all_but_strict_ineq; const dimension_type cs_rows = con_sys.num_rows(); const dimension_type n_equals = con_sys.num_equalities(); - for (dimension_type i = cs_rows; i-- > n_equals; ) - if (con_sys[i].is_strict_inequality()) + for (dimension_type i = cs_rows; i-- > n_equals; ) { + if (con_sys[i].is_strict_inequality()) { sat_all_but_strict_ineq.set(i); + } + } // Will record whether or not we changed the generator system. bool changed = false; @@ -1328,14 +1403,16 @@ ++i; } } - else + else { // Consider next generator. ++i; + } } // If needed, erase the eps-redundant generators. - if (gs_rows < old_gs_rows) + if (gs_rows < old_gs_rows) { gs.sys.rows.resize(gs_rows); + } if (changed) { // The generator system is no longer sorted. @@ -1360,46 +1437,59 @@ // Dealing with a zero-dimensional space polyhedron first. if (space_dim == 0) { - if (c.is_inconsistent()) + if (c.is_inconsistent()) { set_empty(); + } return; } // The constraints (possibly with pending rows) are required. - if (has_pending_generators()) + if (has_pending_generators()) { process_pending_generators(); - else if (!constraints_are_up_to_date()) + } + else if (!constraints_are_up_to_date()) { update_constraints(); + } const bool adding_pending = can_have_something_pending(); - if (c.is_necessarily_closed() || !is_necessarily_closed()) + if (c.is_necessarily_closed() || !is_necessarily_closed()) { // Since `con_sys' is not empty, the topology and space dimension // of the inserted constraint are automatically adjusted. - if (adding_pending) + if (adding_pending) { con_sys.insert_pending(c); - else + } + else { con_sys.insert(c); + } + } else { // Here we know that the system of constraints has at least a row. // However, by barely invoking `con_sys.insert(c)' we would // cause a change in the topology of `con_sys', which is wrong. // Thus, we insert a "topology corrected" copy of `c'. const Linear_Expression nc_expr(c.expression()); - if (c.is_equality()) - if (adding_pending) + if (c.is_equality()) { + if (adding_pending) { con_sys.insert_pending(nc_expr == 0); - else + } + else { con_sys.insert(nc_expr == 0); - else - if (adding_pending) + } + } + else { + if (adding_pending) { con_sys.insert_pending(nc_expr >= 0); - else + } + else { con_sys.insert(nc_expr >= 0); + } + } } - if (adding_pending) + if (adding_pending) { set_constraints_pending(); + } else { // Constraints are not minimized and generators are not up-to-date. clear_constraints_minimized(); @@ -1430,17 +1520,20 @@ x = y; return true; } - else if (y.is_empty()) + else if (y.is_empty()) { return true; + } else if (x.is_empty()) { x = y; return true; } - if (x.is_necessarily_closed()) + if (x.is_necessarily_closed()) { return x.BHZ09_C_poly_hull_assign_if_exact(y); - else + } + else { return x.BHZ09_NNC_poly_hull_assign_if_exact(y); + } } bool @@ -1463,15 +1556,17 @@ // their upper bound is exact if and only if P includes Q. const dimension_type x_affine_dim = x.affine_dimension(); const dimension_type y_affine_dim = y.affine_dimension(); - if (x_affine_dim > y_affine_dim) + if (x_affine_dim > y_affine_dim) { return y.is_included_in(x); + } else if (x_affine_dim < y_affine_dim) { if (x.is_included_in(y)) { x = y; return true; } - else + else { return false; + } } const Constraint_System& x_cs = x.con_sys; @@ -1483,25 +1578,28 @@ // Step 1: generators of `x' that are redundant in `y', and vice versa. Bit_Row x_gs_red_in_y; dimension_type num_x_gs_red_in_y = 0; - for (dimension_type i = x_gs_num_rows; i-- > 0; ) + for (dimension_type i = x_gs_num_rows; i-- > 0; ) { if (y.relation_with(x_gs[i]).implies(Poly_Gen_Relation::subsumes())) { x_gs_red_in_y.set(i); ++num_x_gs_red_in_y; } + } + Bit_Row y_gs_red_in_x; dimension_type num_y_gs_red_in_x = 0; - for (dimension_type i = y_gs_num_rows; i-- > 0; ) + for (dimension_type i = y_gs_num_rows; i-- > 0; ) { if (x.relation_with(y_gs[i]).implies(Poly_Gen_Relation::subsumes())) { y_gs_red_in_x.set(i); ++num_y_gs_red_in_x; } - + } // Step 2: filter away special cases. // Step 2.1: inclusion tests. - if (num_y_gs_red_in_x == y_gs_num_rows) + if (num_y_gs_red_in_x == y_gs_num_rows) { // `y' is included into `x': upper bound `x' is exact. return true; + } if (num_x_gs_red_in_y == x_gs_num_rows) { // `x' is included into `y': upper bound `y' is exact. x = y; @@ -1511,8 +1609,9 @@ // Step 2.2: if no generator of `x' is redundant for `y', then // (as by 2.1 there exists a constraint of `x' non-redundant for `y') // the upper bound is not exact; the same if exchanging `x' and `y'. - if (num_x_gs_red_in_y == 0 || num_y_gs_red_in_x == 0) + if (num_x_gs_red_in_y == 0 || num_y_gs_red_in_x == 0) { return false; + } // Step 3: see if `x' has a non-redundant constraint `c_x' that is not // satisfied by `y' and a non-redundant generator in `y' (see Step 1) @@ -1521,8 +1620,9 @@ // Make sure the saturation matrix for `x' is up to date. // Any sat matrix would do: we choose `sat_g' because it matches // the two nested loops (constraints on rows and generators on columns). - if (!x.sat_g_is_up_to_date()) + if (!x.sat_g_is_up_to_date()) { x.update_sat_g(); + } const Bit_Matrix& x_sat = x.sat_g; Bit_Row all_ones; @@ -1533,15 +1633,18 @@ = y.relation_with(x_cs[i]).implies(Poly_Con_Relation::is_included()); if (!included) { row_union.union_assign(x_gs_red_in_y, x_sat[i]); - if (row_union != all_ones) + if (row_union != all_ones) { return false; + } } } // Here we know that the upper bound is exact: compute it. - for (dimension_type j = y_gs_num_rows; j-- > 0; ) - if (!y_gs_red_in_x[j]) + for (dimension_type j = y_gs_num_rows; j-- > 0; ) { + if (!y_gs_red_in_x[j]) { add_generator(y_gs[j]); + } + } PPL_ASSERT_HEAVY(OK()); return true; @@ -1574,14 +1677,17 @@ dimension_type num_x_gs_non_redundant_in_y = 0; for (dimension_type i = x_gs_num_rows; i-- > 0; ) { const Generator& x_gs_i = x_gs[i]; - if (x_gs_i.is_closure_point()) + if (x_gs_i.is_closure_point()) { x_closure_points.set(i); - if (y.relation_with(x_gs[i]).implies(Poly_Gen_Relation::subsumes())) + } + if (y.relation_with(x_gs[i]).implies(Poly_Gen_Relation::subsumes())) { continue; + } x_gs_non_redundant_in_y.set(i); ++num_x_gs_non_redundant_in_y; - if (x_gs_i.is_point()) + if (x_gs_i.is_point()) { x_points_non_redundant_in_y.set(i); + } } // If `x' is included into `y', the upper bound `y' is exact. @@ -1597,19 +1703,23 @@ dimension_type num_y_gs_non_redundant_in_x = 0; for (dimension_type i = y_gs_num_rows; i-- > 0; ) { const Generator& y_gs_i = y_gs[i]; - if (y_gs_i.is_closure_point()) + if (y_gs_i.is_closure_point()) { y_closure_points.set(i); - if (x.relation_with(y_gs_i).implies(Poly_Gen_Relation::subsumes())) + } + if (x.relation_with(y_gs_i).implies(Poly_Gen_Relation::subsumes())) { continue; + } y_gs_non_redundant_in_x.set(i); ++num_y_gs_non_redundant_in_x; - if (y_gs_i.is_point()) + if (y_gs_i.is_point()) { y_points_non_redundant_in_x.set(i); + } } // If `y' is included into `x', the upper bound `x' is exact. - if (num_y_gs_non_redundant_in_x == 0) + if (num_y_gs_non_redundant_in_x == 0) { return true; + } Bit_Row x_non_points_non_redundant_in_y; x_non_points_non_redundant_in_y @@ -1644,8 +1754,9 @@ // Make sure the saturation matrix for `x' is up to date. // Any sat matrix would do: we choose `sat_g' because it matches // the two nested loops (constraints on rows and generators on columns). - if (!x.sat_g_is_up_to_date()) + if (!x.sat_g_is_up_to_date()) { x.update_sat_g(); + } const Bit_Matrix& x_sat = x.sat_g; Bit_Row x_cs_condition_3; @@ -1657,13 +1768,15 @@ for (dimension_type i = x_cs_num_rows; i-- > 0; ) { const Constraint& x_c = x_cs[i]; // Skip constraint if it is not violated by `y'. - if (y.relation_with(x_c).implies(Poly_Con_Relation::is_included())) + if (y.relation_with(x_c).implies(Poly_Con_Relation::is_included())) { continue; + } saturators.difference_assign(all_ones, x_sat[i]); // Check condition 1. tmp_set.intersection_assign(x_non_points_non_redundant_in_y, saturators); - if (!tmp_set.empty()) + if (!tmp_set.empty()) { return false; + } if (x_c.is_strict_inequality()) { // Postpone check for condition 3. x_cs_condition_3.set(i); @@ -1674,8 +1787,9 @@ // Check condition 2. tmp_set.intersection_assign(x_points_non_redundant_in_y_closure, saturators); - if (!tmp_set.empty()) + if (!tmp_set.empty()) { return false; + } } } @@ -1708,8 +1822,9 @@ } // Make sure the saturation matrix `sat_g' for `y' is up to date. - if (!y.sat_g_is_up_to_date()) + if (!y.sat_g_is_up_to_date()) { y.update_sat_g(); + } const Bit_Matrix& y_sat = y.sat_g; Bit_Row y_cs_condition_3; @@ -1719,13 +1834,15 @@ for (dimension_type i = y_cs_num_rows; i-- > 0; ) { const Constraint& y_c = y_cs[i]; // Skip constraint if it is not violated by `x'. - if (x.relation_with(y_c).implies(Poly_Con_Relation::is_included())) + if (x.relation_with(y_c).implies(Poly_Con_Relation::is_included())) { continue; + } saturators.difference_assign(all_ones, y_sat[i]); // Check condition 1. tmp_set.intersection_assign(y_non_points_non_redundant_in_x, saturators); - if (!tmp_set.empty()) + if (!tmp_set.empty()) { return false; + } if (y_c.is_strict_inequality()) { // Postpone check for condition 3. y_cs_condition_3.set(i); @@ -1736,8 +1853,9 @@ // Check condition 2. tmp_set.intersection_assign(y_points_non_redundant_in_x_closure, saturators); - if (!tmp_set.empty()) + if (!tmp_set.empty()) { return false; + } } } @@ -1746,17 +1864,21 @@ if (x_cs_condition_3.empty() && y_cs_condition_3.empty()) { // No test for condition 3 is needed. // The hull is exact: compute it. - for (dimension_type j = y_gs_num_rows; j-- > 0; ) - if (y_gs_non_redundant_in_x[j]) + for (dimension_type j = y_gs_num_rows; j-- > 0; ) { + if (y_gs_non_redundant_in_x[j]) { add_generator(y_gs[j]); + } + } return true; } // We have anyway to compute the upper bound and its constraints too. Polyhedron ub(x); - for (dimension_type j = y_gs_num_rows; j-- > 0; ) - if (y_gs_non_redundant_in_x[j]) + for (dimension_type j = y_gs_num_rows; j-- > 0; ) { + if (y_gs_non_redundant_in_x[j]) { ub.add_generator(y_gs[j]); + } + } (void) ub.minimize(); PPL_ASSERT(!ub.is_empty()); @@ -1783,8 +1905,9 @@ x_gs_condition_3_not_in_y.set(j); } } - if (x_gs_condition_3.empty()) + if (x_gs_condition_3.empty()) { break; + } } } // Symmetrically, filter away from `y_gs_condition_3' those @@ -1805,8 +1928,9 @@ y_gs_condition_3_not_in_x.set(j); } } - if (y_gs_condition_3.empty()) + if (y_gs_condition_3.empty()) { break; + } } } @@ -1825,8 +1949,9 @@ PPL_ASSERT(x_cp.is_closure_point()); const int sp_sign = Scalar_Products::reduced_sign(ub_c, x_cp); PPL_ASSERT(sp_sign >= 0); - if (sp_sign == 0) + if (sp_sign == 0) { x_gs_condition_3_not_in_y.clear(j); + } } for (dimension_type j = y_gs_condition_3_not_in_x.first(); j != C_Integer::max; @@ -1835,18 +1960,19 @@ PPL_ASSERT(y_cp.is_closure_point()); const int sp_sign = Scalar_Products::reduced_sign(ub_c, y_cp); PPL_ASSERT(sp_sign >= 0); - if (sp_sign == 0) + if (sp_sign == 0) { y_gs_condition_3_not_in_x.clear(j); + } } } } if (!(x_gs_condition_3_not_in_y.empty() - && y_gs_condition_3_not_in_x.empty())) + && y_gs_condition_3_not_in_x.empty())) { // There exist a closure point satisfying condition 3, // hence the hull is not exact. return false; - + } // The speculative test was not successful: // apply the expensive (but conclusive) test for condition 3. @@ -1864,9 +1990,10 @@ ub_inters_hyperplane.add_constraint(eq_i); Polyhedron y_inters_hyperplane(y); y_inters_hyperplane.add_constraint(eq_i); - if (!y_inters_hyperplane.contains(ub_inters_hyperplane)) + if (!y_inters_hyperplane.contains(ub_inters_hyperplane)) { // The hull is not exact. return false; + } } // Consider strict inequalities in `y' violated by `x'. @@ -1882,9 +2009,10 @@ ub_inters_hyperplane.add_constraint(eq_i); Polyhedron x_inters_hyperplane(x); x_inters_hyperplane.add_constraint(eq_i); - if (!x_inters_hyperplane.contains(ub_inters_hyperplane)) + if (!x_inters_hyperplane.contains(ub_inters_hyperplane)) { // The hull is not exact. return false; + } } // The hull is exact. @@ -1911,8 +2039,9 @@ *this = y; return true; } - else if (y.is_empty()) + else if (y.is_empty()) { return true; + } else if (x.is_empty()) { *this = y; return true; @@ -1941,28 +2070,32 @@ // Step 1: generators of `x' that are redundant in `y', and vice versa. std::vector x_gs_red_in_y(x_gs_num_rows, false); dimension_type num_x_gs_red_in_y = 0; - for (dimension_type i = x_gs_num_rows; i-- > 0; ) + for (dimension_type i = x_gs_num_rows; i-- > 0; ) { if (y.relation_with(x_gs[i]).implies(Poly_Gen_Relation::subsumes())) { x_gs_red_in_y[i] = true; ++num_x_gs_red_in_y; } + } std::vector y_gs_red_in_x(y_gs_num_rows, false); dimension_type num_y_gs_red_in_x = 0; - for (dimension_type i = y_gs_num_rows; i-- > 0; ) + for (dimension_type i = y_gs_num_rows; i-- > 0; ) { if (x.relation_with(y_gs[i]).implies(Poly_Gen_Relation::subsumes())) { y_gs_red_in_x[i] = true; ++num_y_gs_red_in_x; } + } // Step 2: if no redundant generator has been identified, // then the union is not convex. CHECKME: why? - if (num_x_gs_red_in_y == 0 && num_y_gs_red_in_x == 0) + if (num_x_gs_red_in_y == 0 && num_y_gs_red_in_x == 0) { return false; + } // Step 2.1: while at it, also perform quick inclusion tests. - if (num_y_gs_red_in_x == y_gs_num_rows) + if (num_y_gs_red_in_x == y_gs_num_rows) { // `y' is included into `x': union is convex. return true; + } if (num_x_gs_red_in_y == x_gs_num_rows) { // `x' is included into `y': union is convex. *this = y; @@ -1976,25 +2109,29 @@ std::vector x_cs_red_in_y(x_cs_num_rows, false); for (dimension_type i = x_cs_num_rows; i-- > 0; ) { const Constraint& x_cs_i = x_cs[i]; - if (y.relation_with(x_cs_i).implies(Poly_Con_Relation::is_included())) + if (y.relation_with(x_cs_i).implies(Poly_Con_Relation::is_included())) { x_cs_red_in_y[i] = true; - else if (x_cs_i.is_equality()) + } + else if (x_cs_i.is_equality()) { // Step 3.1: `x' has an equality not satisfied by `y': // union is not convex (recall that `y' does not contain `x'). // NOTE: this would be false for NNC polyhedra. // Example: x = { A == 0 }, y = { 0 < A <= 1 }. return false; + } } const dimension_type y_cs_num_rows = y_cs.num_rows(); std::vector y_cs_red_in_x(y_cs_num_rows, false); for (dimension_type i = y_cs_num_rows; i-- > 0; ) { const Constraint& y_cs_i = y_cs[i]; - if (x.relation_with(y_cs_i).implies(Poly_Con_Relation::is_included())) + if (x.relation_with(y_cs_i).implies(Poly_Con_Relation::is_included())) { y_cs_red_in_x[i] = true; - else if (y_cs_i.is_equality()) + } + else if (y_cs_i.is_equality()) { // Step 3.1: `y' has an equality not satisfied by `x': // union is not convex (see explanation above). return false; + } } // Loop in steps 5-9: for each pair of non-redundant generators, @@ -2004,13 +2141,15 @@ Generator mid_g; for (dimension_type i = x_gs_num_rows; i-- > 0; ) { - if (x_gs_red_in_y[i]) + if (x_gs_red_in_y[i]) { continue; + } const Generator& x_g = x_gs[i]; const bool x_g_is_line = x_g.is_line_or_equality(); for (dimension_type j = y_gs_num_rows; j-- > 0; ) { - if (y_gs_red_in_x[j]) + if (y_gs_red_in_x[j]) { continue; + } const Generator& y_g = y_gs[j]; const bool y_g_is_line = y_g.is_line_or_equality(); @@ -2025,24 +2164,27 @@ // A zero ray cannot be generated from a line: this holds // because x_row (resp., y_row) is not subsumed by y (resp., x). PPL_ASSERT(!(illegal_ray && (x_g_is_line || y_g_is_line))); - if (illegal_ray) + if (illegal_ray) { continue; + } mid_g.expr.normalize(); if (x_g_is_line) { - if (y_g_is_line) + if (y_g_is_line) { // mid_row is a line too: sign normalization is needed. mid_g.sign_normalize(); - else + } + else { // mid_row is a ray/point. mid_g.set_is_ray_or_point_or_inequality(); + } } PPL_ASSERT(mid_g.OK()); // Step 7: check if mid_g is in the union of x and y. if (x.relation_with(mid_g) == Poly_Gen_Relation::nothing() - && y.relation_with(mid_g) == Poly_Gen_Relation::nothing()) + && y.relation_with(mid_g) == Poly_Gen_Relation::nothing()) { return false; - + } // If either x_g or y_g is a line, we should use its // negation to produce another generator to be tested too. // NOTE: exclusive-or is meant. @@ -2054,8 +2196,9 @@ PPL_ASSERT(mid_g.OK()); // Step 7.1: check if mid_g is in the union of x and y. if (x.relation_with(mid_g) == Poly_Gen_Relation::nothing() - && y.relation_with(mid_g) == Poly_Gen_Relation::nothing()) + && y.relation_with(mid_g) == Poly_Gen_Relation::nothing()) { return false; + } } else if (x_g_is_line && !y_g_is_line) { // Step 6.1: (re-)compute mid_row = - x_row + y_row. @@ -2065,8 +2208,9 @@ PPL_ASSERT(mid_g.OK()); // Step 7.1: check if mid_g is in the union of x and y. if (x.relation_with(mid_g) == Poly_Gen_Relation::nothing() - && y.relation_with(mid_g) == Poly_Gen_Relation::nothing()) + && y.relation_with(mid_g) == Poly_Gen_Relation::nothing()) { return false; + } } } } @@ -2076,8 +2220,9 @@ // constraints/generators to improve the convex-hull computation. // Using generators allows for exploiting incrementality. for (dimension_type j = 0; j < y_gs_num_rows; ++j) { - if (!y_gs_red_in_x[j]) + if (!y_gs_red_in_x[j]) { add_generator(y_gs[j]); + } } PPL_ASSERT_HEAVY(OK()); return true; @@ -2087,12 +2232,14 @@ PPL::Polyhedron::drop_some_non_integer_points(const Variables_Set* vars_p, Complexity_Class complexity) { // There is nothing to do for an empty set of variables. - if (vars_p != 0 && vars_p->empty()) + if (vars_p != 0 && vars_p->empty()) { return; + } // Any empty polyhedron does not contain integer points. - if (marked_empty()) + if (marked_empty()) { return; + } // A zero-dimensional, universe polyhedron has, by convention, an // integer point. @@ -2104,25 +2251,31 @@ // The constraints (possibly with pending rows) are required. if (has_pending_generators()) { // Processing of pending generators is exponential in the worst case. - if (complexity != ANY_COMPLEXITY) + if (complexity != ANY_COMPLEXITY) { return; - else + } + else { process_pending_generators(); + } } if (!constraints_are_up_to_date()) { // Constraints update is exponential in the worst case. - if (complexity != ANY_COMPLEXITY) + if (complexity != ANY_COMPLEXITY) { return; - else + } + else { update_constraints(); + } } // For NNC polyhedra we need to process any pending constraints. if (!is_necessarily_closed() && has_pending_constraints()) { - if (complexity != ANY_COMPLEXITY) + if (complexity != ANY_COMPLEXITY) { return; - else if (!process_pending_constraints()) + } + else if (!process_pending_constraints()) { // We just discovered the polyhedron is empty. return; + } } PPL_ASSERT(!has_pending_generators() && constraints_are_up_to_date()); @@ -2137,21 +2290,23 @@ if (vars_p != 0) { // Compute the complement of `*vars_p'. for (dimension_type i = 0; i < space_dim; ++i) { - if (vars_p->find(i) == vars_p->end()) + if (vars_p->find(i) == vars_p->end()) { other_vars.insert(Variable(i)); + } } } for (dimension_type j = con_sys.sys.rows.size(); j-- > 0; ) { Constraint& c = con_sys.sys.rows[j]; - if (c.is_tautological()) + if (c.is_tautological()) { continue; - + } if (!other_vars.empty()) { // Skip constraints having a nonzero coefficient for a variable // that does not occurr in the input set. - if (!c.expression().all_zeroes(other_vars)) + if (!c.expression().all_zeroes(other_vars)) { continue; + } } if (!is_necessarily_closed()) { @@ -2188,8 +2343,9 @@ c_0 = c.expr.inhomogeneous_term(); const int c_0_sign = sgn(c_0); c_0 /= gcd; - if (c_0_sign < 0) + if (c_0_sign < 0) { --c_0; + } c.expr.set_inhomogeneous_term(c_0); PPL_ASSERT(c.OK()); changed = true; @@ -2200,11 +2356,12 @@ PPL_ASSERT(con_sys.sys.OK()); if (changed) { - if (is_necessarily_closed()) + if (is_necessarily_closed()) { con_sys.insert(Constraint::zero_dim_positivity()); - else + } + else { con_sys.insert(Constraint::epsilon_leq_one()); - + } // After changing the system of constraints, the generators // are no longer up-to-date and the constraints are no longer // minimized. @@ -2221,13 +2378,15 @@ Polyhedron& x = *this; // Dimension-compatibility checks. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("positive_time_elapse_assign(y)", "y", y); + } // Dealing with the zero-dimensional case. if (x.space_dim == 0) { - if (y.marked_empty()) + if (y.marked_empty()) { x.set_empty(); + } return; } @@ -2262,7 +2421,7 @@ Generator &g = new_gs.sys.rows[i]; if (g.is_point()) { x_points_gs.insert(g); - num_rows--; + --num_rows; swap(g, new_gs.sys.rows[num_rows]); } } @@ -2289,8 +2448,6 @@ } PPL_ASSERT(gs->OK()); - //gs->ascii_dump(std::cout); - //IO_Operators::operator<<(std::cout, *gs); const dimension_type gs_num_rows = gs->num_rows(); @@ -2320,19 +2477,19 @@ } new_g.expr.normalize(); PPL_ASSERT(new_g.OK()); - new_gs.insert(new_g); + new_gs.insert(new_g); } break; case Generator::CLOSURE_POINT: // If g is not the origin, insert g into new_gs, as a ray. if (!g.expr.all_homogeneous_terms_are_zero()) { - // Turn a copy of g into a ray. - Generator g_as_a_ray = g; - g_as_a_ray.expr.set_inhomogeneous_term(0); - g_as_a_ray.expr.normalize(); - PPL_ASSERT(g_as_a_ray.OK()); - // Insert the ray. - new_gs.insert(g_as_a_ray); + // Turn a copy of g into a ray. + Generator g_as_a_ray = g; + g_as_a_ray.expr.set_inhomogeneous_term(0); + g_as_a_ray.expr.normalize(); + PPL_ASSERT(g_as_a_ray.OK()); + // Insert the ray. + new_gs.insert(g_as_a_ray); } break; case Generator::RAY: @@ -2370,10 +2527,12 @@ const char* reason) const { std::ostringstream s; s << "PPL::"; - if (is_necessarily_closed()) + if (is_necessarily_closed()) { s << "C_"; - else + } + else { s << "NNC_"; + } s << "Polyhedron::" << method << ":" << std::endl << reason << "."; throw std::invalid_argument(s.str()); @@ -2385,16 +2544,20 @@ const Polyhedron& ph) const { std::ostringstream s; s << "PPL::"; - if (is_necessarily_closed()) + if (is_necessarily_closed()) { s << "C_"; - else + } + else { s << "NNC_"; + } s << "Polyhedron::" << method << ":" << std::endl << ph_name << " is a "; - if (ph.is_necessarily_closed()) + if (ph.is_necessarily_closed()) { s << "C_"; - else + } + else { s << "NNC_"; + } s << "Polyhedron." << std::endl; throw std::invalid_argument(s.str()); } @@ -2520,10 +2683,12 @@ const Variable var) const { std::ostringstream s; s << "PPL::"; - if (is_necessarily_closed()) + if (is_necessarily_closed()) { s << "C_"; - else + } + else { s << "NNC_"; + } s << "Polyhedron::" << method << ":" << std::endl << "this->space_dimension() == " << space_dimension() << ", " << var_name << ".space_dimension() == " << var.space_dimension() << "."; @@ -2536,10 +2701,12 @@ dimension_type required_space_dim) const { std::ostringstream s; s << "PPL::"; - if (is_necessarily_closed()) + if (is_necessarily_closed()) { s << "C_"; - else + } + else { s << "NNC_"; + } s << "Polyhedron::" << method << ":" << std::endl << "this->space_dimension() == " << space_dimension() << ", required space dimension == " << required_space_dim << "."; @@ -2571,10 +2738,12 @@ const char* g_name) const { std::ostringstream s; s << "PPL::"; - if (is_necessarily_closed()) + if (is_necessarily_closed()) { s << "C_"; - else + } + else { s << "NNC_"; + } s << "Polyhedron::" << method << ":" << std::endl << "*this is an empty polyhedron and " << g_name << " is not a point."; @@ -2586,10 +2755,12 @@ const char* gs_name) const { std::ostringstream s; s << "PPL::"; - if (is_necessarily_closed()) + if (is_necessarily_closed()) { s << "C_"; - else + } + else { s << "NNC_"; + } s << "Polyhedron::" << method << ":" << std::endl << "*this is an empty polyhedron and" << std::endl << "the non-empty generator system " << gs_name << " contains no points."; diff -Nru ppl-1.1/src/Polyhedron_public.cc ppl-1.2/src/Polyhedron_public.cc --- ppl-1.1/src/Polyhedron_public.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_public.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Polyhedron class implementation (non-inline public functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -29,7 +29,7 @@ #include "Scalar_Products_inlines.hh" #include "MIP_Problem_defs.hh" #include "wrap_assign.hh" -#include "assert.hh" +#include "assertions.hh" #include #include @@ -59,15 +59,18 @@ PPL::dimension_type PPL::Polyhedron::affine_dimension() const { - if (is_empty()) + if (is_empty()) { return 0; + } const Constraint_System& cs = minimized_constraints(); dimension_type d = space_dim; for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) - if (i->is_equality()) + cs_end = cs.end(); i != cs_end; ++i) { + if (i->is_equality()) { --d; + } + } return d; } @@ -101,10 +104,12 @@ // If the polyhedron has pending generators, we process them to obtain // the constraints. No processing is needed if the polyhedron has // pending constraints. - if (has_pending_generators()) + if (has_pending_generators()) { process_pending_generators(); - else if (!constraints_are_up_to_date()) + } + else if (!constraints_are_up_to_date()) { update_constraints(); + } // TODO: reconsider whether to really sort constraints at this stage. #if ENSURE_SORTEDNESS @@ -120,10 +125,12 @@ PPL::Polyhedron::minimized_constraints() const { // `minimize()' or `strongly_minimize_constraints()' // will process any pending constraints or generators. - if (is_necessarily_closed()) + if (is_necessarily_closed()) { minimize(); - else + } + else { strongly_minimize_constraints(); + } return constraints(); } @@ -175,8 +182,9 @@ // return a sorted system of generators: this is needed so that the // const_iterator could correctly filter out the matched closure points. if (!is_necessarily_closed() - && generators_are_minimized() && !has_pending_generators()) + && generators_are_minimized() && !has_pending_generators()) { obtain_sorted_generators(); + } #endif return gen_sys; } @@ -185,10 +193,12 @@ PPL::Polyhedron::minimized_generators() const { // `minimize()' or `strongly_minimize_generators()' // will process any pending constraints or generators. - if (is_necessarily_closed()) + if (is_necessarily_closed()) { minimize(); - else + } + else { strongly_minimize_generators(); + } // Note: calling generators() on a strongly minimized NNC generator // system will also ensure sortedness, which is required to correctly // filter away the matched closure points. @@ -198,63 +208,73 @@ PPL::Poly_Con_Relation PPL::Polyhedron::relation_with(const Constraint& c) const { // Dimension-compatibility check. - if (space_dim < c.space_dimension()) + if (space_dim < c.space_dimension()) { throw_dimension_incompatible("relation_with(c)", "c", c); + } - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); - + } if (space_dim == 0) { - if (c.is_inconsistent()) - if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) + if (c.is_inconsistent()) { + if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) { // The constraint 0 > 0 implicitly defines the hyperplane 0 = 0; // thus, the zero-dimensional point also saturates it. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::is_disjoint(); - else if (c.is_equality() || c.inhomogeneous_term() == 0) + } + } + else if (c.is_equality() || c.inhomogeneous_term() == 0) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); - else + } + else { // The zero-dimensional point saturates // neither the positivity constraint 1 >= 0, // nor the strict positivity constraint 1 > 0. return Poly_Con_Relation::is_included(); + } } if ((has_pending_constraints() && !process_pending_constraints()) - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { // The polyhedron is empty. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); - + } return gen_sys.relation_with(c); } PPL::Poly_Gen_Relation PPL::Polyhedron::relation_with(const Generator& g) const { // Dimension-compatibility check. - if (space_dim < g.space_dimension()) + if (space_dim < g.space_dimension()) { throw_dimension_incompatible("relation_with(g)", "g", g); + } // The empty polyhedron cannot subsume a generator. - if (marked_empty()) + if (marked_empty()) { return Poly_Gen_Relation::nothing(); + } // A universe polyhedron in a zero-dimensional space subsumes // all the generators of a zero-dimensional space. - if (space_dim == 0) + if (space_dim == 0) { return Poly_Gen_Relation::subsumes(); + } - if (has_pending_generators()) + if (has_pending_generators()) { process_pending_generators(); - else if (!constraints_are_up_to_date()) + } + else if (!constraints_are_up_to_date()) { update_constraints(); - + } return con_sys.satisfies_all_constraints(g) ? Poly_Gen_Relation::subsumes() @@ -265,34 +285,38 @@ PPL::Polyhedron::relation_with(const Congruence& cg) const { const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (space_dim < cg_space_dim) + if (space_dim < cg_space_dim) { throw_dimension_incompatible("relation_with(cg)", "cg", cg); + } if (cg.is_equality()) { const Constraint c(cg); return relation_with(c); } - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } } if ((has_pending_constraints() && !process_pending_constraints()) - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { // The polyhedron is empty. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); - + } // Build the equality corresponding to the congruence (ignoring the modulus). Linear_Expression expr(cg.expression()); const Constraint c(expr == 0); @@ -320,13 +344,14 @@ const Coefficient& modulus = cg.modulus(); PPL_DIRTY_TEMP_COEFFICIENT(signed_distance); signed_distance = sp_point % modulus; - if (signed_distance == 0) + if (signed_distance == 0) { // The point is lying on the hyperplane. return relation_with(expr == 0); - else + } + else { // The point is not lying on the hyperplane. expr += signed_distance; - + } // Build first halfspace constraint. const bool positive = (signed_distance > 0); const Constraint first_halfspace = positive ? (expr >= 0) : (expr <= 0); @@ -334,22 +359,26 @@ const Poly_Con_Relation first_rels = relation_with(first_halfspace); PPL_ASSERT(!first_rels.implies(Poly_Con_Relation::saturates()) && !first_rels.implies(Poly_Con_Relation::is_disjoint())); - if (first_rels.implies(Poly_Con_Relation::strictly_intersects())) + if (first_rels.implies(Poly_Con_Relation::strictly_intersects())) { return Poly_Con_Relation::strictly_intersects(); + } // Build second halfspace. - if (positive) + if (positive) { expr -= modulus; - else + } + else { expr += modulus; + } const Constraint second_halfspace = positive ? (expr <= 0) : (expr >= 0); PPL_ASSERT(first_rels == Poly_Con_Relation::is_included()); const Poly_Con_Relation second_rels = relation_with(second_halfspace); PPL_ASSERT(!second_rels.implies(Poly_Con_Relation::saturates()) && !second_rels.implies(Poly_Con_Relation::is_disjoint())); - if (second_rels.implies(Poly_Con_Relation::strictly_intersects())) + if (second_rels.implies(Poly_Con_Relation::strictly_intersects())) { return Poly_Con_Relation::strictly_intersects(); + } PPL_ASSERT(second_rels == Poly_Con_Relation::is_included()); return Poly_Con_Relation::is_disjoint(); @@ -357,17 +386,20 @@ bool PPL::Polyhedron::is_universe() const { - if (marked_empty()) + if (marked_empty()) { return false; + } - if (space_dim == 0) + if (space_dim == 0) { return true; - + } if (!has_pending_generators() && constraints_are_up_to_date()) { // Search for a constraint that is not a tautology. - for (dimension_type i = con_sys.num_rows(); i-- > 0; ) - if (!con_sys[i].is_tautological()) + for (dimension_type i = con_sys.num_rows(); i-- > 0; ) { + if (!con_sys[i].is_tautological()) { return false; + } + } // All the constraints are tautologies. return true; } @@ -378,7 +410,7 @@ dimension_type num_lines = 0; dimension_type num_rays = 0; const dimension_type first_pending = gen_sys.first_pending_row(); - for (dimension_type i = first_pending; i-- > 0; ) + for (dimension_type i = first_pending; i-- > 0; ) { switch (gen_sys[i].type()) { case Generator::RAY: ++num_rays; @@ -389,6 +421,7 @@ default: break; } + } if (has_pending_generators()) { // The non-pending part of `gen_sys' was minimized: @@ -403,7 +436,7 @@ dimension_type num_pending_lines = 0; dimension_type num_pending_rays = 0; const dimension_type gs_num_rows = gen_sys.num_rows(); - for (dimension_type i = first_pending; i < gs_num_rows; ++i) + for (dimension_type i = first_pending; i < gs_num_rows; ++i) { switch (gen_sys[i].type()) { case Generator::RAY: ++num_pending_rays; @@ -414,10 +447,12 @@ default: break; } + } // If no pending rays and lines were found, // then it is not the universe polyhedron. - if (num_pending_rays == 0 && num_pending_lines == 0) + if (num_pending_rays == 0 && num_pending_lines == 0) { return false; + } // Factor away the lines already seen (to be on the safe side, // we assume they are all linearly independent). if (num_lines + num_pending_lines < space_dim) { @@ -425,8 +460,9 @@ = space_dim - (num_lines + num_pending_lines); // In order to span an n dimensional space (where n = num_dims_missing), // at least n+1 rays are needed. - if (num_rays + num_pending_rays <= num_dims_missing) + if (num_rays + num_pending_rays <= num_dims_missing) { return false; + } } } else { @@ -436,29 +472,35 @@ PPL_ASSERT(num_rays == 0 || num_lines < space_dim); return num_lines == space_dim; } - else + else { // Only the fast-fail test can be computed: in order to span // an n dimensional space (where n = space_dim - num_lines), // at least n+1 rays are needed. - if (num_lines < space_dim && num_lines + num_rays <= space_dim) + if (num_lines < space_dim && num_lines + num_rays <= space_dim) { return false; + } + } } // We need the polyhedron in minimal form. - if (has_pending_generators()) + if (has_pending_generators()) { process_pending_generators(); - else if (!constraints_are_minimized()) + } + else if (!constraints_are_minimized()) { minimize(); - if (is_necessarily_closed()) + } + if (is_necessarily_closed()) { return con_sys.num_rows() == 1 && con_sys[0].is_inequality() && con_sys[0].is_tautological(); + } else { // NNC polyhedron. if (con_sys.num_rows() != 2 || con_sys[0].is_equality() - || con_sys[1].is_equality()) + || con_sys[1].is_equality()) { return false; + } else { // If the system of constraints contains two rows that // are not equalities, we are sure that they are @@ -486,14 +528,17 @@ if (space_dim == 0 || marked_empty() || (has_pending_constraints() && !process_pending_constraints()) - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { return true; + } // If the system of generators contains any line or a ray, // then the polyhedron is unbounded. - for (dimension_type i = gen_sys.num_rows(); i-- > 0; ) - if (gen_sys[i].is_line_or_ray()) + for (dimension_type i = gen_sys.num_rows(); i-- > 0; ) { + if (gen_sys[i].is_line_or_ray()) { return false; + } + } // The system of generators is composed only by // points and closure points: the polyhedron is bounded. @@ -503,13 +548,15 @@ bool PPL::Polyhedron::is_topologically_closed() const { // Necessarily closed polyhedra are trivially closed. - if (is_necessarily_closed()) + if (is_necessarily_closed()) { return true; + } // Any empty or zero-dimensional polyhedron is closed. if (marked_empty() || space_dim == 0 - || (has_something_pending() && !process_pending())) + || (has_something_pending() && !process_pending())) { return true; + } // At this point there are no pending constraints or generators. PPL_ASSERT(!has_something_pending()); @@ -532,8 +579,9 @@ break; } } - if (gen_sys_i_has_no_matching_point) + if (gen_sys_i_has_no_matching_point) { return false; + } } } // All closure points are matched. @@ -549,27 +597,31 @@ bool PPL::Polyhedron::contains_integer_point() const { // Any empty polyhedron does not contain integer points. - if (marked_empty()) + if (marked_empty()) { return false; - + } // A zero-dimensional, universe polyhedron has, by convention, an // integer point. - if (space_dim == 0) + if (space_dim == 0) { return true; + } // CHECKME: do we really want to call conversion to check for emptiness? - if (has_pending_constraints() && !process_pending()) + if (has_pending_constraints() && !process_pending()) { // Empty again. return false; + } // FIXME: do also exploit info regarding rays and lines, if possible. // Is any integer point already available? PPL_ASSERT(!has_pending_constraints()); - if (generators_are_up_to_date()) - for (dimension_type i = gen_sys.num_rows(); i-- > 0; ) - if (gen_sys[i].is_point() && gen_sys[i].divisor() == 1) + if (generators_are_up_to_date()) { + for (dimension_type i = gen_sys.num_rows(); i-- > 0; ) { + if (gen_sys[i].is_point() && gen_sys[i].divisor() == 1) { return true; - + } + } + } const Constraint_System& cs = constraints(); #if 0 // TEMPORARILY DISABLED. MIP_Problem mip(space_dim, @@ -603,21 +655,24 @@ return false; } Linear_Expression le(c.expression()); - if (homogeneous_gcd != 1) + if (homogeneous_gcd != 1) { le /= homogeneous_gcd; + } // Further tighten the constraint if the inhomogeneous term // was integer, i.e., if `homogeneous_gcd' divides `inhomogeneous'. gcd_assign(gcd, homogeneous_gcd, inhomogeneous); - if (gcd == homogeneous_gcd) + if (gcd == homogeneous_gcd) { le -= 1; + } mip.add_constraint(le >= 0); } else { // Equality or non-strict inequality. // If possible, avoid useless gcd computations. - if (inhomogeneous == 0) + if (inhomogeneous == 0) { // The inhomogeneous term cannot be tightened. mip.add_constraint(c); + } else { // Compute the GCD of the coefficients of c // (disregarding the inhomogeneous term) @@ -629,10 +684,11 @@ PPL_ASSERT(c.is_inconsistent()); return false; } - else if (homogeneous_gcd == 1) + else if (homogeneous_gcd == 1) { // The normalized inhomogeneous term is integer: // add the constraint as-is. mip.add_constraint(c); + } else { PPL_ASSERT(homogeneous_gcd > 1); // Here the normalized inhomogeneous term is rational: @@ -643,8 +699,9 @@ gcd_assign(gcd, homogeneous_gcd, inhomogeneous); PPL_ASSERT(gcd == 1); #endif - if (c.type() == Constraint::EQUALITY) + if (c.type() == Constraint::EQUALITY) { return false; + } // Extract the homogeneous part of the constraint. Linear_Expression le(c.expression()); le -= inhomogeneous; @@ -672,22 +729,24 @@ PPL::Polyhedron::constrains(const Variable var) const { // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("constrains(v)", "v", var); + } // An empty polyhedron constrains all variables. - if (marked_empty()) + if (marked_empty()) { return true; + } if (generators_are_up_to_date() && !has_pending_constraints()) { // Since generators are up-to-date and there are no pending // constraints, the generator system (since it is well formed) // contains a point. Hence the polyhedron is not empty. - if (constraints_are_up_to_date() && !has_pending_generators()) + if (constraints_are_up_to_date() && !has_pending_generators()) { // Here a variable is constrained if and only if it is // syntactically constrained. goto syntactic_check; - + } if (generators_are_minimized()) { // Try a quick, incomplete check for the universe polyhedron: // a universe polyhedron constrains no variable. @@ -695,12 +754,15 @@ // (hence, linearly independent) lines. dimension_type num_lines = 0; const dimension_type first_pending = gen_sys.first_pending_row(); - for (dimension_type i = first_pending; i-- > 0; ) - if (gen_sys[i].is_line()) + for (dimension_type i = first_pending; i-- > 0; ) { + if (gen_sys[i].is_line()) { ++num_lines; + } + } - if (num_lines == space_dim) + if (num_lines == space_dim) { return false; + } } // Scan generators: perhaps we will find a generator equivalent to @@ -716,18 +778,24 @@ if (sign != 0) { if (gen_sys_i.expression().all_zeroes(1, var_id) && gen_sys_i.expression().all_zeroes(var_id + 1, space_dim + 1)) { - - if (gen_sys_i.is_line()) + + if (gen_sys_i.is_line()) { return true; - if (sign > 0) - if (have_negative_ray) + } + if (sign > 0) { + if (have_negative_ray) { return true; - else + } + else { have_positive_ray = true; - else if (have_positive_ray) + } + } + else if (have_positive_ray) { return true; - else + } + else { have_negative_ray = true; + } } } } @@ -737,21 +805,26 @@ // up-to-date and there are no pending constraints, then the // generator system (since it is well formed) contains a point. // Hence the polyhedron is not empty. - if (has_pending_generators()) + if (has_pending_generators()) { process_pending_generators(); - else if (!constraints_are_up_to_date()) + } + else if (!constraints_are_up_to_date()) { update_constraints(); + } goto syntactic_check; } // We must minimize to detect emptiness and obtain constraints. - if (!minimize()) + if (!minimize()) { return true; + } syntactic_check: - for (dimension_type i = con_sys.num_rows(); i-- > 0; ) - if (con_sys[i].coefficient(var) != 0) + for (dimension_type i = con_sys.num_rows(); i-- > 0; ) { + if (con_sys[i].coefficient(var) != 0) { return true; + } + } return false; } @@ -772,8 +845,9 @@ } // Check whether the status information is legal. - if (!status.OK()) + if (!status.OK()) { goto bomb; + } if (marked_empty()) { if (check_not_empty) { @@ -794,8 +868,9 @@ #endif goto bomb; } - if (con_sys.has_no_rows()) + if (con_sys.has_no_rows()) { return true; + } else { if (con_sys.space_dimension() != space_dim) { #ifndef NDEBUG @@ -876,7 +951,7 @@ #endif goto bomb; } - if (sat_c_is_up_to_date()) + if (sat_c_is_up_to_date()) { if (con_sys.first_pending_row() != sat_c.num_columns()) { #ifndef NDEBUG cerr << "Incompatible size! (con_sys and sat_c)" @@ -884,7 +959,8 @@ #endif goto bomb; } - if (sat_g_is_up_to_date()) + } + if (sat_g_is_up_to_date()) { if (con_sys.first_pending_row() != sat_g.num_rows()) { #ifndef NDEBUG cerr << "Incompatible size! (con_sys and sat_g)" @@ -892,7 +968,8 @@ #endif goto bomb; } - if (generators_are_up_to_date()) + } + if (generators_are_up_to_date()) { if (con_sys.space_dimension() != gen_sys.space_dimension()) { #ifndef NDEBUG cerr << "Incompatible size! (con_sys and gen_sys)" @@ -900,6 +977,7 @@ #endif goto bomb; } + } } if (generators_are_up_to_date()) { @@ -910,7 +988,7 @@ #endif goto bomb; } - if (sat_c_is_up_to_date()) + if (sat_c_is_up_to_date()) { if (gen_sys.first_pending_row() != sat_c.num_rows()) { #ifndef NDEBUG cerr << "Incompatible size! (gen_sys and sat_c)" @@ -918,7 +996,8 @@ #endif goto bomb; } - if (sat_g_is_up_to_date()) + } + if (sat_g_is_up_to_date()) { if (gen_sys.first_pending_row() != sat_g.num_columns()) { #ifndef NDEBUG cerr << "Incompatible size! (gen_sys and sat_g)" @@ -926,7 +1005,7 @@ #endif goto bomb; } - + } if (gen_sys.first_pending_row() == 0) { #ifndef NDEBUG cerr << "Up-to-date generator system with all rows pending!" @@ -961,12 +1040,16 @@ dimension_type num_points = 0; dimension_type num_closure_points = 0; dimension_type eps_index = gen_sys.space_dimension() + 1; - for (dimension_type i = gen_sys.num_rows(); i-- > 0; ) - if (!gen_sys[i].is_line_or_ray()) - if (gen_sys[i][eps_index] > 0) + for (dimension_type i = gen_sys.num_rows(); i-- > 0; ) { + if (!gen_sys[i].is_line_or_ray()) { + if (gen_sys[i][eps_index] > 0) { ++num_points; - else + } + else { ++num_closure_points; + } + } + } if (num_points > num_closure_points) { #ifndef NDEBUG cerr << "# POINTS > # CLOSURE_POINTS" << endl; @@ -1052,11 +1135,12 @@ // -* the positivity constraint, for necessarily closed polyhedra; // -* the epsilon <= 1 constraint, for NNC polyhedra. bool no_positivity_constraint = true; - for (dimension_type i = con_sys.num_rows(); i-- > 0; ) + for (dimension_type i = con_sys.num_rows(); i-- > 0; ) { if (con_sys[i].inhomogeneous_term() != 0) { no_positivity_constraint = false; break; } + } if (no_positivity_constraint) { #ifndef NDEBUG cerr << "Non-empty constraint system has no positivity constraint" @@ -1070,11 +1154,12 @@ // must also contain a (combination of) the constraint epsilon >= 0, // i.e., a constraint with a positive epsilon coefficient. bool no_epsilon_geq_zero = true; - for (dimension_type i = con_sys.num_rows(); i-- > 0; ) + for (dimension_type i = con_sys.num_rows(); i-- > 0; ) { if (con_sys[i].epsilon_coefficient() > 0) { no_epsilon_geq_zero = false; break; } + } if (no_epsilon_geq_zero) { #ifndef NDEBUG cerr << "Non-empty constraint system for NNC polyhedron " @@ -1147,7 +1232,7 @@ } } - if (sat_c_is_up_to_date()) + if (sat_c_is_up_to_date()) { for (dimension_type i = sat_c.num_rows(); i-- > 0; ) { const Generator tmp_gen = gen_sys[i]; const Bit_Row tmp_sat = sat_c[i]; @@ -1162,8 +1247,8 @@ } } } - - if (sat_g_is_up_to_date()) + } + if (sat_g_is_up_to_date()) { for (dimension_type i = sat_g.num_rows(); i-- > 0; ) { const Constraint tmp_con = con_sys[i]; const Bit_Row tmp_sat = sat_g[i]; @@ -1178,7 +1263,7 @@ } } } - + } if (has_pending_constraints()) { if (con_sys.num_pending_rows() == 0) { #ifndef NDEBUG @@ -1217,8 +1302,9 @@ // Topology-compatibility check. if (c.is_strict_inequality() && is_necessarily_closed()) { // Trivially true/false strict inequalities are legal. - if (c.is_tautological()) + if (c.is_tautological()) { return; + } if (c.is_inconsistent()) { set_empty(); return; @@ -1229,24 +1315,29 @@ // Dimension-compatibility check: // the dimension of `c' can not be greater than space_dim. - if (space_dim < c.space_dimension()) + if (space_dim < c.space_dimension()) { throw_dimension_incompatible("add_constraint(c)", "c", c); + } - if (!marked_empty()) + if (!marked_empty()) { refine_no_check(c); + } + } void PPL::Polyhedron::add_congruence(const Congruence& cg) { // Dimension-compatibility check: // the dimension of `cg' can not be greater than space_dim. - if (space_dim < cg.space_dimension()) + if (space_dim < cg.space_dimension()) { throw_dimension_incompatible("add_congruence(cg)", "cg", cg); + } // Handle the case of proper congruences first. if (cg.is_proper_congruence()) { - if (cg.is_tautological()) + if (cg.is_tautological()) { return; + } if (cg.is_inconsistent()) { set_empty(); return; @@ -1258,11 +1349,13 @@ PPL_ASSERT(cg.is_equality()); // Handle empty and 0-dim cases first. - if (marked_empty()) + if (marked_empty()) { return; + } if (space_dim == 0) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { set_empty(); + } return; } @@ -1275,24 +1368,27 @@ void PPL::Polyhedron::add_generator(const Generator& g) { // Topology-compatibility check. - if (g.is_closure_point() && is_necessarily_closed()) + if (g.is_closure_point() && is_necessarily_closed()) { throw_topology_incompatible("add_generator(g)", "g", g); + } // Dimension-compatibility check: // the dimension of `g' can not be greater than space_dim. const dimension_type g_space_dim = g.space_dimension(); - if (space_dim < g_space_dim) + if (space_dim < g_space_dim) { throw_dimension_incompatible("add_generator(g)", "g", g); - + } // Dealing with a zero-dimensional space polyhedron first. if (space_dim == 0) { // It is not possible to create 0-dim rays or lines. PPL_ASSERT(g.is_point() || g.is_closure_point()); // Closure points can only be inserted in non-empty polyhedra. if (marked_empty()) { - if (g.type() != Generator::POINT) + if (g.type() != Generator::POINT) { throw_invalid_generator("add_generator(g)", "g"); - else + } + else { set_zero_dim_univ(); + } } PPL_ASSERT_HEAVY(OK()); return; @@ -1303,8 +1399,9 @@ || (!generators_are_up_to_date() && !update_generators())) { // Here the polyhedron is empty: // the specification says we can only insert a point. - if (!g.is_point()) + if (!g.is_point()) { throw_invalid_generator("add_generator(g)", "g"); + } if (g.is_necessarily_closed() || !is_necessarily_closed()) { gen_sys.insert(g); // Since `gen_sys' was empty, after inserting `g' we have to resize @@ -1345,10 +1442,12 @@ if (g.is_necessarily_closed() || !is_necessarily_closed()) { // Since `gen_sys' is not empty, the topology and space dimension // of the inserted generator are automatically adjusted. - if (has_pending) + if (has_pending) { gen_sys.insert_pending(g); - else + } + else { gen_sys.insert(g); + } if (!is_necessarily_closed() && g.is_point()) { // In the NNC topology, each point has to be matched by // a corresponding closure point: @@ -1359,10 +1458,12 @@ PPL_ASSERT(gen_sys.sys.rows.back().OK()); PPL_ASSERT(gen_sys.sys.OK()); // Re-insert the point (which is already normalized). - if (has_pending) + if (has_pending) { gen_sys.insert_pending(g); - else + } + else { gen_sys.insert(g); + } } } else { @@ -1375,22 +1476,28 @@ const Linear_Expression nc_expr(g.expression()); switch (g.type()) { case Generator::LINE: - if (has_pending) + if (has_pending) { gen_sys.insert_pending(Generator::line(nc_expr)); - else + } + else { gen_sys.insert(Generator::line(nc_expr)); + } break; case Generator::RAY: - if (has_pending) + if (has_pending) { gen_sys.insert_pending(Generator::ray(nc_expr)); - else + } + else { gen_sys.insert(Generator::ray(nc_expr)); + } break; case Generator::POINT: - if (has_pending) + if (has_pending) { gen_sys.insert_pending(Generator::point(nc_expr, g.divisor())); - else + } + else { gen_sys.insert(Generator::point(nc_expr, g.divisor())); + } break; case Generator::CLOSURE_POINT: PPL_UNREACHABLE; @@ -1398,8 +1505,9 @@ } } - if (has_pending) + if (has_pending) { set_generators_pending(); + } else { // After adding the new generator, // constraints are no longer up-to-date. @@ -1419,9 +1527,10 @@ for (Constraint_System::const_iterator i = cs.begin(), i_end = cs.end(); i != i_end; ++i) { if (i->is_strict_inequality() - && !i->is_inconsistent()) + && !i->is_inconsistent()) { throw_topology_incompatible("add_recycled_constraints(cs)", "cs", cs); + } } // If we reach this point, all strict inequalities were inconsistent. set_empty(); @@ -1431,12 +1540,13 @@ // Dimension-compatibility check: // the dimension of `cs' can not be greater than space_dim. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_dimension_incompatible("add_recycled_constraints(cs)", "cs", cs); - + } // Adding no constraints is a no-op. - if (cs.has_no_rows()) + if (cs.has_no_rows()) { return; + } if (space_dim == 0) { // In a 0-dimensional space the constraints are @@ -1444,21 +1554,25 @@ // inconsistent (e.g., 1 == 0 or -1 >= 0 or 0 > 0). // In a system of constraints `begin()' and `end()' are equal // if and only if the system only contains tautologies. - if (cs.begin() != cs.end()) + if (cs.begin() != cs.end()) { // There is a constraint, it must be inconsistent, // the polyhedron is empty. status.set_empty(); + } return; } - if (marked_empty()) + if (marked_empty()) { return; + } // The constraints (possibly with pending rows) are required. - if (has_pending_generators()) + if (has_pending_generators()) { process_pending_generators(); - else if (!constraints_are_up_to_date()) + } + else if (!constraints_are_up_to_date()) { update_constraints(); + } // Adjust `cs' to the right topology and space dimension. // NOTE: we already checked for topology compatibility. @@ -1494,23 +1608,27 @@ void PPL::Polyhedron::add_recycled_generators(Generator_System& gs) { // Topology compatibility check. - if (is_necessarily_closed() && gs.has_closure_points()) + if (is_necessarily_closed() && gs.has_closure_points()) { throw_topology_incompatible("add_recycled_generators(gs)", "gs", gs); + } // Dimension-compatibility check: // the dimension of `gs' can not be greater than space_dim. const dimension_type gs_space_dim = gs.space_dimension(); - if (space_dim < gs_space_dim) + if (space_dim < gs_space_dim) { throw_dimension_incompatible("add_recycled_generators(gs)", "gs", gs); + } // Adding no generators is a no-op. - if (gs.has_no_rows()) + if (gs.has_no_rows()) { return; + } // Adding valid generators to a zero-dimensional polyhedron // transform it in the zero-dimensional universe polyhedron. if (space_dim == 0) { - if (marked_empty() && !gs.has_points()) + if (marked_empty() && !gs.has_points()) { throw_invalid_generators("add_recycled_generators(gs)", "gs"); + } set_zero_dim_univ(); PPL_ASSERT_HEAVY(OK(true)); return; @@ -1521,16 +1639,18 @@ gs.adjust_topology_and_space_dimension(topology(), space_dim); // For NNC polyhedra, each point must be matched by // the corresponding closure point. - if (!is_necessarily_closed()) + if (!is_necessarily_closed()) { gs.add_corresponding_closure_points(); + } // The generators (possibly with pending rows) are required. if ((has_pending_constraints() && !process_pending_constraints()) || (!generators_are_up_to_date() && !minimize())) { // We have just discovered that `*this' is empty. // So `gs' must contain at least one point. - if (!gs.has_points()) + if (!gs.has_points()) { throw_invalid_generators("add_recycled_generators(gs)", "gs"); + } // The polyhedron is no longer empty and generators are up-to-date. swap(gen_sys, gs); if (gen_sys.num_pending_rows() > 0) { @@ -1586,8 +1706,9 @@ void PPL::Polyhedron::add_congruences(const Congruence_System& cgs) { // Dimension-compatibility check. - if (space_dim < cgs.space_dimension()) + if (space_dim < cgs.space_dimension()) { throw_dimension_incompatible("add_congruences(cgs)", "cgs", cgs); + } Constraint_System cs; bool inserted = false; @@ -1608,40 +1729,47 @@ set_empty(); return; } - if (!cg.is_tautological()) + if (!cg.is_tautological()) { throw_invalid_argument("add_congruences(cgs)", "cgs has a non-trivial, proper congruence"); + } } } // Only add cs if it contains something. - if (inserted) + if (inserted) { add_recycled_constraints(cs); + } } void PPL::Polyhedron::refine_with_constraint(const Constraint& c) { // Dimension-compatibility check. - if (space_dim < c.space_dimension()) + if (space_dim < c.space_dimension()) { throw_dimension_incompatible("refine_with_constraint(c)", "c", c); + } // If the polyhedron is known to be empty, do nothing. - if (!marked_empty()) + if (!marked_empty()) { refine_no_check(c); + } } void PPL::Polyhedron::refine_with_congruence(const Congruence& cg) { // Dimension-compatibility check. - if (space_dim < cg.space_dimension()) + if (space_dim < cg.space_dimension()) { throw_dimension_incompatible("refine_with_congruence(cg)", "cg", cg); + } // If the polyhedron is known to be empty, do nothing. - if (marked_empty()) + if (marked_empty()) { return; + } // Dealing with a zero-dimensional space polyhedron first. if (space_dim == 0) { - if (!cg.is_tautological()) + if (!cg.is_tautological()) { set_empty(); + } return; } @@ -1658,13 +1786,14 @@ // Dimension-compatibility check. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_dimension_incompatible("refine_with_constraints(cs)a", "cs", cs); - + } // Adding no constraints is a no-op. - if (cs.has_no_rows()) + if (cs.has_no_rows()) { return; + } if (space_dim == 0) { // In a 0-dimensional space the constraints are @@ -1672,33 +1801,40 @@ // inconsistent (e.g., 1 == 0 or -1 >= 0 or 0 > 0). // In a system of constraints `begin()' and `end()' are equal // if and only if the system only contains tautologies. - if (cs.begin() != cs.end()) + if (cs.begin() != cs.end()) { // There is a constraint, it must be inconsistent, // the polyhedron is empty. status.set_empty(); + } return; } - if (marked_empty()) + if (marked_empty()) { return; + } // The constraints (possibly with pending rows) are required. - if (has_pending_generators()) + if (has_pending_generators()) { process_pending_generators(); - else if (!constraints_are_up_to_date()) + } + else if (!constraints_are_up_to_date()) { update_constraints(); + } const bool adding_pending = can_have_something_pending(); for (dimension_type i = cs.num_rows(); i-- > 0; ) { const Constraint& c = cs[i]; - if (c.is_necessarily_closed() || !is_necessarily_closed()) + if (c.is_necessarily_closed() || !is_necessarily_closed()) { // Since `con_sys' is not empty, the topology and space dimension // of the inserted constraint are automatically adjusted. - if (adding_pending) + if (adding_pending) { con_sys.insert_pending(c); - else + } + else { con_sys.insert(c); + } + } else { // Here we know that *this is necessarily closed so even if c is // topologically closed, by barely invoking `con_sys.insert(c)' we @@ -1706,21 +1842,28 @@ // wrong. Thus, we insert a topology closed and "topology // corrected" version of `c'. const Linear_Expression nc_expr(c.expression()); - if (c.is_equality()) - if (adding_pending) + if (c.is_equality()) { + if (adding_pending) { con_sys.insert_pending(nc_expr == 0); - else + } + else { con_sys.insert(nc_expr == 0); - else - if (adding_pending) + } + } + else { + if (adding_pending) { con_sys.insert_pending(nc_expr >= 0); - else + } + else { con_sys.insert(nc_expr >= 0); + } + } } } - if (adding_pending) + if (adding_pending) { set_constraints_pending(); + } else { // Constraints are not minimized and generators are not up-to-date. clear_constraints_minimized(); @@ -1735,8 +1878,9 @@ void PPL::Polyhedron::refine_with_congruences(const Congruence_System& cgs) { // Dimension-compatibility check. - if (space_dim < cgs.space_dimension()) + if (space_dim < cgs.space_dimension()) { throw_dimension_incompatible("refine_with_congruences(cgs)", "cgs", cgs); + } Constraint_System cs; bool inserted = false; @@ -1757,22 +1901,24 @@ } // Only add cgs if congruences were inserted into cgs, as the // dimension of cs must be at most that of the polyhedron. - if (inserted) + if (inserted) { add_recycled_constraints(cs); + } } void PPL::Polyhedron::unconstrain(const Variable var) { // Dimension-compatibility check. - if (space_dim < var.space_dimension()) + if (space_dim < var.space_dimension()) { throw_dimension_incompatible("unconstrain(var)", var.space_dimension()); - + } // Do something only if the polyhedron is non-empty. if (marked_empty() || (has_pending_constraints() && !process_pending_constraints()) - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { // Empty: do nothing. return; + } PPL_ASSERT(generators_are_up_to_date()); // Since `gen_sys' is not empty, the topology and space dimension @@ -1796,20 +1942,22 @@ // The cylindrification with respect to no dimensions is a no-op. // This case also captures the only legal cylindrification // of a polyhedron in a 0-dim space. - if (vars.empty()) + if (vars.empty()) { return; - + } // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dim < min_space_dim) + if (space_dim < min_space_dim) { throw_dimension_incompatible("unconstrain(vs)", min_space_dim); + } // Do something only if the polyhedron is non-empty. if (marked_empty() || (has_pending_constraints() && !process_pending_constraints()) - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { // Empty: do nothing. return; + } PPL_ASSERT(generators_are_up_to_date()); // Since `gen_sys' is not empty, the topology and space dimension @@ -1817,13 +1965,15 @@ Variables_Set::const_iterator vsi = vars.begin(); Variables_Set::const_iterator vsi_end = vars.end(); if (can_have_something_pending()) { - for ( ; vsi != vsi_end; ++vsi) + for ( ; vsi != vsi_end; ++vsi) { gen_sys.insert_pending(Generator::line(Variable(*vsi))); + } set_generators_pending(); } else { - for ( ; vsi != vsi_end; ++vsi) + for ( ; vsi != vsi_end; ++vsi) { gen_sys.insert(Generator::line(Variable(*vsi))); + } // After adding the new generators, // constraints are no longer up-to-date. clear_generators_minimized(); @@ -1836,15 +1986,17 @@ PPL::Polyhedron::intersection_assign(const Polyhedron& y) { Polyhedron& x = *this; // Topology compatibility check. - if (x.topology() != y.topology()) + if (x.topology() != y.topology()) { throw_topology_incompatible("intersection_assign(y)", "y", y); + } // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("intersection_assign(y)", "y", y); - + } // If one of the two polyhedra is empty, the intersection is empty. - if (x.marked_empty()) + if (x.marked_empty()) { return; + } if (y.marked_empty()) { x.set_empty(); return; @@ -1853,20 +2005,25 @@ // If both polyhedra are zero-dimensional, // then at this point they are necessarily non-empty, // so that their intersection is non-empty too. - if (x.space_dim == 0) + if (x.space_dim == 0) { return; + } // Both systems of constraints have to be up-to-date, // possibly having pending constraints. - if (x.has_pending_generators()) + if (x.has_pending_generators()) { x.process_pending_generators(); - else if (!x.constraints_are_up_to_date()) + } + else if (!x.constraints_are_up_to_date()) { x.update_constraints(); + } - if (y.has_pending_generators()) + if (y.has_pending_generators()) { y.process_pending_generators(); - else if (!y.constraints_are_up_to_date()) + } + else if (!y.constraints_are_up_to_date()) { y.update_constraints(); + } // Here both systems are up-to-date and possibly have pending constraints // (but they cannot have pending generators). @@ -1884,10 +2041,12 @@ // If both constraint systems are (fully) sorted, then we can // merge them; otherwise we simply add the second to the first. if (x.con_sys.is_sorted() - && y.con_sys.is_sorted() && !y.has_pending_constraints()) + && y.con_sys.is_sorted() && !y.has_pending_constraints()) { x.con_sys.merge_rows_assign(y.con_sys); - else + } + else { x.con_sys.insert(y.con_sys); + } // Generators are no longer up-to-date and constraints are no // longer minimized. x.clear_generators_up_to_date(); @@ -1935,13 +2094,15 @@ // Perform quick redundancy test based on the number of saturators. for (dimension_type i = num_rows; i-- > 0; ) { - if (sat[i].empty()) + if (sat[i].empty()) { // Masked equalities are redundant. ineqs_p[i] = 0; + } else { const dimension_type num_sat = num_cols_sat - sat[i].count_ones(); - if (num_sat < min_sat) + if (num_sat < min_sat) { ineqs_p[i] = 0; + } } } @@ -1957,9 +2118,10 @@ ineqs_p[i] = 0; break; } - else + else { // Here `sat[j] == sat[i]'. ineqs_p[j] = 0; + } } } } @@ -1977,9 +2139,10 @@ eq_sys.insert(eq); const PPL::dimension_type eq_sys_num_rows = eq_sys.num_rows(); const PPL::dimension_type rank = eq_sys.gauss(eq_sys_num_rows); - if (rank == eq_sys_num_rows) + if (rank == eq_sys_num_rows) { // eq is linearly independent from eq_sys. return true; + } else { // eq is not linearly independent from eq_sys. PPL_ASSERT(rank == eq_sys_num_rows - 1); @@ -1992,11 +2155,13 @@ PPL::Polyhedron::simplify_using_context_assign(const Polyhedron& y) { Polyhedron& x = *this; // Topology compatibility check. - if (x.topology() != y.topology()) + if (x.topology() != y.topology()) { throw_topology_incompatible("simplify_using_context_assign(y)", "y", y); + } // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("simplify_using_context_assign(y)", "y", y); + } // Filter away the zero-dimensional case. if (x.space_dim == 0) { @@ -2004,8 +2169,9 @@ x.set_zero_dim_univ(); return false; } - else + else { return !x.is_empty(); + } } // If `y' is empty, the biggest enlargement for `x' is the universe. @@ -2060,11 +2226,12 @@ // redundancies found. std::vector redundant_by_y(x_cs_num_rows, false); dimension_type num_redundant_by_y = 0; - for (dimension_type i = 0; i < x_cs_num_rows; ++i) + for (dimension_type i = 0; i < x_cs_num_rows; ++i) { if (y_gs.satisfied_by_all_generators(x_cs[i])) { redundant_by_y[i] = true; ++num_redundant_by_y; } + } Constraint_System result_cs; @@ -2075,21 +2242,23 @@ // Compute into `z' the minimized intersection of `x' and `y'. const bool x_first = (x_cs_num_rows > y_cs_num_rows); Polyhedron z(x_first ? x : y); - if (x_first) + if (x_first) { z.add_constraints(y_cs); + } else { // Only copy (and then recycle) the non-redundant constraints. Constraint_System tmp_cs; for (dimension_type i = 0; i < x_cs_num_rows; ++i) { - if (!redundant_by_y[i]) + if (!redundant_by_y[i]) { tmp_cs.insert(x_cs[i]); + } } z.add_recycled_constraints(tmp_cs); } if (!z.minimize()) { - // The objective function is the default, zero. - // We do not care about minimization or maximization, since - // we are only interested in satisfiability. + // For necessarily closed polyhedra, the objective function is + // the default, zero. Moreover, the default maximization mode is + // OK, since we are only interested in satisfiability. MIP_Problem lp; if (x.is_necessarily_closed()) { lp.add_space_dimensions_and_embed(x.space_dim); @@ -2110,6 +2279,11 @@ const_cast(y_cs).mark_as_not_necessarily_closed(); throw; } + // For not necessarily closed polyhedra, we maximize the + // epsilon dimension as we want to rule out the possibility + // that all solutions have epsilon = 0. We are in this case + // if and only if the maximal value for epsilon is 0. + lp.set_objective_function(Variable(x.space_dim)); } // We apply the following heuristics here: constraints of `x' that // are not made redundant by `y' are added to `lp' depending on @@ -2130,45 +2304,53 @@ if (x.is_necessarily_closed()) { if (g.is_line()) { // Lines must saturate the constraint. - if (sp_sign != 0) + if (sp_sign != 0) { goto ruled_out; + } } else { // `g' is either a ray, a point or a closure point. if (c.is_inequality()) { // `c' is a non-strict inequality. - if (sp_sign < 0) + if (sp_sign < 0) { goto ruled_out; + } } - else + else { // `c' is an equality. - if (sp_sign != 0) + if (sp_sign != 0) { goto ruled_out; + } + } } } - else + else { // The topology is not necessarily closed. switch (g.type()) { case Generator::LINE: // Lines must saturate the constraint. - if (sp_sign != 0) + if (sp_sign != 0) { goto ruled_out; + } break; case Generator::POINT: // Have to perform the special test when dealing with // a strict inequality. switch (c.type()) { case Constraint::EQUALITY: - if (sp_sign != 0) + if (sp_sign != 0) { goto ruled_out; + } break; case Constraint::NONSTRICT_INEQUALITY: - if (sp_sign < 0) + if (sp_sign < 0) { goto ruled_out; + } break; case Constraint::STRICT_INEQUALITY: - if (sp_sign <= 0) + if (sp_sign <= 0) { goto ruled_out; + } break; } break; @@ -2178,16 +2360,19 @@ if (c.is_inequality()) { // Constraint `c' is either a strict or a non-strict // inequality. - if (sp_sign < 0) + if (sp_sign < 0) { goto ruled_out; + } } - else + else { // Constraint `c' is an equality. - if (sp_sign != 0) + if (sp_sign != 0) { goto ruled_out; + } + } break; } - + } // If we reach this point, `g' satisfies `c'. continue; ruled_out: @@ -2208,15 +2393,50 @@ ++j) { const Constraint& c = x_cs[j->constraint_index]; result_cs.insert(c); - lp.add_constraint(c); + if (x.is_necessarily_closed()) { + lp.add_constraint(c); + } + else { + // KLUDGE: temporarily mark `c' as if it was necessarily + // closed, so that we can interpret the epsilon dimension as a + // standard dimension. Be careful to reset the topology of `c' + // also on exceptional execution paths. + const_cast(c).mark_as_necessarily_closed(); + try { + lp.add_constraint(c); + const_cast(c).mark_as_not_necessarily_closed(); + } + catch (...) { + const_cast(c).mark_as_not_necessarily_closed(); + throw; + } + } const MIP_Problem_Status status = lp.solve(); - if (status == UNFEASIBLE_MIP_PROBLEM) { - Polyhedron result_ph(x.topology(), x.space_dim, UNIVERSE); - result_ph.add_constraints(result_cs); - swap(x, result_ph); - PPL_ASSERT_HEAVY(x.OK()); - return false; + switch (status) { + case UNFEASIBLE_MIP_PROBLEM: + break; + case OPTIMIZED_MIP_PROBLEM: + if (x.is_necessarily_closed()) { + continue; + } + else { + Coefficient num; + Coefficient den; + lp.optimal_value(num, den); + if (num != 0) { + continue; + } + } + break; + default: + PPL_UNREACHABLE; + break; } + Polyhedron result_ph(x.topology(), x.space_dim, UNIVERSE); + result_ph.add_constraints(result_cs); + swap(x, result_ph); + PPL_ASSERT_HEAVY(x.OK()); + return false; } // Cannot exit from here. PPL_UNREACHABLE; @@ -2233,14 +2453,17 @@ // Compute the number of equalities in x_cs, y_cs and z_cs // (exploiting minimal form knowledge). dimension_type x_cs_num_eq = 0; - while (x_cs[x_cs_num_eq].is_equality()) + while (x_cs[x_cs_num_eq].is_equality()) { ++x_cs_num_eq; + } dimension_type y_cs_num_eq = 0; - while (y_cs[y_cs_num_eq].is_equality()) + while (y_cs[y_cs_num_eq].is_equality()) { ++y_cs_num_eq; + } dimension_type z_cs_num_eq = 0; - while (z_cs[z_cs_num_eq].is_equality()) + while (z_cs[z_cs_num_eq].is_equality()) { ++z_cs_num_eq; + } PPL_ASSERT(x_cs_num_eq <= z_cs_num_eq && y_cs_num_eq <= z_cs_num_eq); // Identify non-redundant equalities. @@ -2250,8 +2473,9 @@ Constraint_System eqs(x.topology()); if (needed_non_redundant_eq > 0) { // Populate eqs with the equalities from y. - for (dimension_type i = 0; i < y_cs_num_eq; ++i) + for (dimension_type i = 0; i < y_cs_num_eq; ++i) { eqs.insert(y_cs[i]); + } // Try to find another `needed_non_redundant_eq' linear independent // equalities among those from x. for (dimension_type i = 0; i < x_cs_num_eq; ++i) { @@ -2260,9 +2484,10 @@ // x_cs_i is linear independent. non_redundant_eq.insert(x_cs_i); ++num_non_redundant_eq; - if (num_non_redundant_eq == needed_non_redundant_eq) + if (num_non_redundant_eq == needed_non_redundant_eq) { // Already found all the needed equalities. break; + } } } // NOTE: if num_non_redundant_eq < needed_non_redundant_eq @@ -2280,13 +2505,15 @@ std::vector non_redundant_ineq_p; // Fill non_redundant_ineq_p with (pointers to) inequalities // from y_cs ... - for (dimension_type i = y_cs_num_eq; i < y_cs_num_rows; ++i) + for (dimension_type i = y_cs_num_eq; i < y_cs_num_rows; ++i) { non_redundant_ineq_p.push_back(&y_cs[i]); + } // ... and (pointers to) non-redundant inequalities from x_cs. - for (dimension_type i = x_cs_num_eq; i < x_cs_num_rows; ++i) - if (!redundant_by_y[i]) + for (dimension_type i = x_cs_num_eq; i < x_cs_num_rows; ++i) { + if (!redundant_by_y[i]) { non_redundant_ineq_p.push_back(&x_cs[i]); - + } + } const dimension_type non_redundant_ineq_p_size = non_redundant_ineq_p.size(); const dimension_type y_cs_num_ineq = y_cs_num_rows - y_cs_num_eq; @@ -2297,9 +2524,11 @@ for (dimension_type i = sat_num_rows; i-- > 0; ) { const Constraint& non_redundant_ineq_i = *(non_redundant_ineq_p[i]); Bit_Row& sat_i = sat[i]; - for (dimension_type j = z_gs_num_rows; j-- > 0; ) - if (Scalar_Products::sign(non_redundant_ineq_i, z_gs[j]) != 0) + for (dimension_type j = z_gs_num_rows; j-- > 0; ) { + if (Scalar_Products::sign(non_redundant_ineq_i, z_gs[j]) != 0) { sat_i.set(j); + } + } if (sat_i.empty() && num_non_redundant_eq < needed_non_redundant_eq) { // `non_redundant_ineq_i' is actually masking an equality // and we are still looking for some masked inequalities. @@ -2328,9 +2557,11 @@ // i.e., those having indices no smaller than y_cs_num_ineq. for (dimension_type i = y_cs_num_ineq; i < non_redundant_ineq_p_size; - ++i) - if (non_redundant_ineq_p[i] != 0) + ++i) { + if (non_redundant_ineq_p[i] != 0) { result_cs.insert(*non_redundant_ineq_p[i]); + } + } } } @@ -2345,15 +2576,18 @@ PPL::Polyhedron::poly_hull_assign(const Polyhedron& y) { Polyhedron& x = *this; // Topology compatibility check. - if (x.topology() != y.topology()) + if (x.topology() != y.topology()) { throw_topology_incompatible("poly_hull_assign(y)", "y", y); + } // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("poly_hull_assign(y)", "y", y); + } // The poly-hull of a polyhedron `p' with an empty polyhedron is `p'. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } if (x.marked_empty()) { x = y; return; @@ -2362,8 +2596,9 @@ // If both polyhedra are zero-dimensional, // then at this point they are necessarily universe polyhedra, // so that their poly-hull is the universe polyhedron too. - if (x.space_dim == 0) + if (x.space_dim == 0) { return; + } // Both systems of generators have to be up-to-date, // possibly having pending generators. @@ -2374,10 +2609,10 @@ return; } if ((y.has_pending_constraints() && !y.process_pending_constraints()) - || (!y.generators_are_up_to_date() && !y.update_generators())) + || (!y.generators_are_up_to_date() && !y.update_generators())) { // Discovered `y' empty when updating generators. return; - + } // Here both systems are up-to-date and possibly have pending generators // (but they cannot have pending constraints). PPL_ASSERT(!x.has_pending_constraints() && x.generators_are_up_to_date()); @@ -2394,10 +2629,12 @@ // If both generator systems are (fully) sorted, then we can merge // them; otherwise we simply add the second to the first. if (x.gen_sys.is_sorted() - && y.gen_sys.is_sorted() && !y.has_pending_generators()) + && y.gen_sys.is_sorted() && !y.has_pending_generators()) { x.gen_sys.merge_rows_assign(y.gen_sys); - else + } + else { x.gen_sys.insert(y.gen_sys); + } // Constraints are no longer up-to-date // and generators are no longer minimized. x.clear_constraints_up_to_date(); @@ -2411,18 +2648,22 @@ PPL::Polyhedron::poly_difference_assign(const Polyhedron& y) { Polyhedron& x = *this; // Topology compatibility check. - if (x.topology() != y.topology()) + if (x.topology() != y.topology()) { throw_topology_incompatible("poly_difference_assign(y)", "y", y); // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + } + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("poly_difference_assign(y)", "y", y); + } // The difference of a polyhedron `p' and an empty polyhedron is `p'. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } // The difference of an empty polyhedron and of a polyhedron `p' is empty. - if (x.marked_empty()) + if (x.marked_empty()) { return; + } // If both polyhedra are zero-dimensional, // then at this point they are necessarily universe polyhedra, @@ -2442,8 +2683,9 @@ // Being lazy here is only harmful. // `minimize()' will process any pending constraints or generators. - if (!y.minimize()) + if (!y.minimize()) { return; + } x.minimize(); Polyhedron new_polyhedron(topology(), x.space_dim, EMPTY); @@ -2460,25 +2702,29 @@ // on C-polyhedra and `c' is a non-strict inequality, c _must_ be // skipped for otherwise we would obtain a result that is less // precise than the poly-difference. - if (x.relation_with(c).implies(Poly_Con_Relation::is_included())) + if (x.relation_with(c).implies(Poly_Con_Relation::is_included())) { continue; + } Polyhedron z = x; const Linear_Expression e(c.expression()); switch (c.type()) { case Constraint::NONSTRICT_INEQUALITY: - if (is_necessarily_closed()) + if (is_necessarily_closed()) { z.refine_no_check(e <= 0); - else + } + else { z.refine_no_check(e < 0); + } break; case Constraint::STRICT_INEQUALITY: z.refine_no_check(e <= 0); break; case Constraint::EQUALITY: - if (is_necessarily_closed()) + if (is_necessarily_closed()) { // We have already filtered out the case // when `x' is included in `y': the result is `x'. return; + } else { Polyhedron w = x; w.refine_no_check(e < 0); @@ -2500,21 +2746,23 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_image(v, e, d)", "d == 0"); - + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("affine_image(v, e, d)", "e", expr); // `var' should be one of the dimensions of the polyhedron. + } const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "v", var); - - if (marked_empty()) + } + if (marked_empty()) { return; + } if (expr.coefficient(var) != 0) { // The transformation is invertible: @@ -2523,10 +2771,12 @@ if (generators_are_up_to_date()) { // Generator_System::affine_image() requires the third argument // to be a positive Coefficient. - if (denominator > 0) + if (denominator > 0) { gen_sys.affine_image(var, expr, denominator); - else + } + else { gen_sys.affine_image(var, -expr, -denominator); + } } if (constraints_are_up_to_date()) { // To build the inverse transformation, @@ -2552,17 +2802,21 @@ else { // The transformation is not invertible. // We need an up-to-date system of generators. - if (has_something_pending()) + if (has_something_pending()) { remove_pending_to_obtain_generators(); - else if (!generators_are_up_to_date()) + } + else if (!generators_are_up_to_date()) { minimize(); + } if (!marked_empty()) { // Generator_System::affine_image() requires the third argument // to be a positive Coefficient. - if (denominator > 0) + if (denominator > 0) { gen_sys.affine_image(var, expr, denominator); - else + } + else { gen_sys.affine_image(var, -expr, -denominator); + } clear_constraints_up_to_date(); clear_generators_minimized(); @@ -2580,21 +2834,25 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_preimage(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr); // `var' should be one of the dimensions of the polyhedron. + } const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "v", var); + } - if (marked_empty()) + if (marked_empty()) { return; + } if (expr.coefficient(var) != 0) { // The transformation is invertible: @@ -2602,10 +2860,12 @@ if (constraints_are_up_to_date()) { // Constraint_System::affine_preimage() requires the third argument // to be a positive Coefficient. - if (denominator > 0) + if (denominator > 0) { con_sys.affine_preimage(var, expr, denominator); - else + } + else { con_sys.affine_preimage(var, -expr, -denominator); + } } if (generators_are_up_to_date()) { // To build the inverse transformation, @@ -2631,16 +2891,20 @@ else { // The transformation is not invertible. // We need an up-to-date system of constraints. - if (has_something_pending()) + if (has_something_pending()) { remove_pending_to_obtain_constraints(); - else if (!constraints_are_up_to_date()) + } + else if (!constraints_are_up_to_date()) { minimize(); + } // Constraint_System::affine_preimage() requires the third argument // to be a positive Coefficient. - if (denominator > 0) + if (denominator > 0) { con_sys.affine_preimage(var, expr, denominator); - else + } + else { con_sys.affine_preimage(var, -expr, -denominator); + } // Generators, minimality and saturators are no longer valid. clear_generators_up_to_date(); clear_constraints_minimized(); @@ -2657,29 +2921,34 @@ const Linear_Expression& ub_expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0"); + } // Dimension-compatibility checks. // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "v", var); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "ub", ub_expr); + } // Any image of an empty polyhedron is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // Check whether `var' occurs in `lb_expr' and/or `ub_expr'. if (lb_expr.coefficient(var) == 0) { @@ -2688,10 +2957,12 @@ LESS_OR_EQUAL, ub_expr, denominator); - if (denominator > 0) + if (denominator > 0) { refine_no_check(lb_expr <= denominator*var); - else + } + else { refine_no_check(denominator*var <= lb_expr); + } } else if (ub_expr.coefficient(var) == 0) { // Here `var' only occurs in `lb_expr'. @@ -2699,10 +2970,12 @@ GREATER_OR_EQUAL, lb_expr, denominator); - if (denominator > 0) + if (denominator > 0) { refine_no_check(denominator*var <= ub_expr); - else + } + else { refine_no_check(ub_expr <= denominator*var); + } } else { // Here `var' occurs in both `lb_expr' and `ub_expr'. @@ -2716,9 +2989,10 @@ GREATER_OR_EQUAL, lb_expr, denominator); - if (!marked_empty()) + if (!marked_empty()) { // Now apply the affine upper bound, as recorded in `new_var'. refine_no_check(new_var >= var); + } // Remove the temporarily added dimension. remove_higher_space_dimensions(space_dim-1); } @@ -2732,29 +3006,34 @@ const Linear_Expression& ub_expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0"); + } // Dimension-compatibility checks. // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "v", var); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "ub", ub_expr); + } // Any preimage of an empty polyhedron is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // Check whether `var' occurs in neither `lb_expr' nor `ub_expr'. if (lb_expr.coefficient(var) == 0 && ub_expr.coefficient(var) == 0) { @@ -2775,10 +3054,12 @@ add_space_dimensions_and_embed(1); // Swap dimensions `var' and `new_var'. - if (constraints_are_up_to_date()) + if (constraints_are_up_to_date()) { con_sys.swap_space_dimensions(var, new_var); - if (generators_are_up_to_date()) + } + if (generators_are_up_to_date()) { gen_sys.swap_space_dimensions(var, new_var); + } // Constrain the new dimension as dictated by `lb_expr' and `ub_expr'. // (we force minimization because we will need the generators). @@ -2803,42 +3084,48 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "e", expr); + } // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "v", var); + } // Strict relation symbols are only admitted for NNC polyhedra. if (is_necessarily_closed() - && (relsym == LESS_THAN || relsym == GREATER_THAN)) + && (relsym == LESS_THAN || relsym == GREATER_THAN)) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is the disequality relation symbol"); + } // First compute the affine image. affine_image(var, expr, denominator); - if (relsym == EQUAL) + if (relsym == EQUAL) { // The affine relation is indeed an affine function. return; - + } // Any image of an empty polyhedron is empty. // Note: DO check for emptiness here, as we will later add a ray. - if (is_empty()) + if (is_empty()) { return; + } switch (relsym) { case LESS_OR_EQUAL: @@ -2877,10 +3164,12 @@ old_gen.expr.normalize(); PPL_ASSERT(old_gen.OK()); // Displace `new_gen' by `var' (i.e., along the new ray). - if (relsym == GREATER_THAN) + if (relsym == GREATER_THAN) { new_gen.expr += var; - else + } + else { new_gen.expr -= var; + } new_gen.expr.normalize(); PPL_ASSERT(new_gen.OK()); } @@ -2911,31 +3200,36 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", "e", expr); + } // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", "v", var); + } // Strict relation symbols are only admitted for NNC polyhedra. if (is_necessarily_closed() - && (relsym == LESS_THAN || relsym == GREATER_THAN)) + && (relsym == LESS_THAN || relsym == GREATER_THAN)) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is the disequality relation symbol"); + } // Check whether the affine relation is indeed an affine function. if (relsym == EQUAL) { @@ -3016,29 +3310,33 @@ // The dimension of `lhs' should not be greater than the dimension // of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e1", lhs); + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e2", rhs); + } // Strict relation symbols are only admitted for NNC polyhedra. if (is_necessarily_closed() - && (relsym == LESS_THAN || relsym == GREATER_THAN)) + && (relsym == LESS_THAN || relsym == GREATER_THAN)) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is the disequality relation symbol"); - + } // Any image of an empty polyhedron is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // Compute the actual space dimension of `lhs', // i.e., the highest dimension having a non-zero coefficient in `lhs'. @@ -3077,8 +3375,9 @@ // occurring in both `lhs' and `rhs'. Generator_System new_lines; for (Linear_Expression::const_iterator - i = lhs.begin(), i_end = lhs.end(); i != i_end; ++i) + i = lhs.begin(), i_end = lhs.end(); i != i_end; ++i) { new_lines.insert(line(i.variable())); + } const dimension_type num_common_dims = std::min(lhs.space_dimension(), rhs.space_dimension()); @@ -3129,8 +3428,9 @@ // Any image of an empty polyhedron is empty. // Note: DO check for emptiness here, as we will add lines. - if (is_empty()) + if (is_empty()) { return; + } // Existentially quantify the variables in the left hand side. add_recycled_generators(new_lines); @@ -3170,29 +3470,33 @@ // The dimension of `lhs' should not be greater than the dimension // of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)", "e1", lhs); + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)", "e2", rhs); + } // Strict relation symbols are only admitted for NNC polyhedra. if (is_necessarily_closed() - && (relsym == LESS_THAN || relsym == GREATER_THAN)) + && (relsym == LESS_THAN || relsym == GREATER_THAN)) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2)", "r is the disequality relation symbol"); - + } // Any preimage of an empty polyhedron is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // Compute the actual space dimension of `lhs', // i.e., the highest dimension having a non-zero coefficient in `lhs'. @@ -3211,8 +3515,9 @@ // occurring in both `lhs' and `rhs'. Generator_System new_lines; for (Linear_Expression::const_iterator - i = lhs.begin(), i_end = lhs.end(); i != i_end; ++i) + i = lhs.begin(), i_end = lhs.end(); i != i_end; ++i) { new_lines.insert(line(i.variable())); + } const dimension_type num_common_dims = std::min(lhs.space_dimension(), rhs.space_dimension()); @@ -3285,8 +3590,9 @@ } // Any image of an empty polyhedron is empty. // Note: DO check for emptiness here, as we will add lines. - if (is_empty()) + if (is_empty()) { return; + } // Existentially quantify all the variables occurring in `lhs'. add_recycled_generators(new_lines); } @@ -3297,16 +3603,19 @@ PPL::Polyhedron::time_elapse_assign(const Polyhedron& y) { Polyhedron& x = *this; // Topology compatibility check. - if (x.topology() != y.topology()) + if (x.topology() != y.topology()) { throw_topology_incompatible("time_elapse_assign(y)", "y", y); + } // Dimension-compatibility checks. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("time_elapse_assign(y)", "y", y); + } // Dealing with the zero-dimensional case. if (x.space_dim == 0) { - if (y.marked_empty()) + if (y.marked_empty()) { x.set_empty(); + } return; } @@ -3395,9 +3704,9 @@ // Namely, this happens when `y' was the singleton polyhedron // having the origin as the one and only point. // In such a case, the resulting polyhedron is equal to `x'. - if (gs_num_rows == 0) + if (gs_num_rows == 0) { return; - + } // If the polyhedron can have something pending, we add `gs' // to `gen_sys' as pending rows if (x.can_have_something_pending()) { @@ -3407,8 +3716,9 @@ // Otherwise, the two systems are merged. // `Linear_System::merge_rows_assign()' requires both systems to be sorted. else { - if (!x.gen_sys.is_sorted()) + if (!x.gen_sys.is_sorted()) { x.gen_sys.sort_rows(); + } gs.sort_rows(); x.gen_sys.merge_rows_assign(gs); // Only the system of generators is up-to-date. @@ -3423,8 +3733,9 @@ Coefficient& freq_n, Coefficient& freq_d, Coefficient& val_n, Coefficient& val_d) const { // The dimension of `expr' must be at most the dimension of *this. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("frequency(e, ...)", "e", expr); + } // If the `expr' has a constant value, then the frequency // `freq_n' is 0. Otherwise the values for \p expr are not discrete @@ -3433,8 +3744,9 @@ // Space dimension is 0: if empty, then return false; // otherwise the frequency is 1 and the value is 0. if (space_dim == 0) { - if (is_empty()) + if (is_empty()) { return false; + } freq_n = 0; freq_d = 1; val_n = expr.inhomogeneous_term(); @@ -3445,8 +3757,9 @@ // For an empty polyhedron, we simply return false. if (marked_empty() || (has_pending_constraints() && !process_pending_constraints()) - || (!generators_are_up_to_date() && !update_generators())) + || (!generators_are_up_to_date() && !update_generators())) { return false; + } // The polyhedron has updated, possibly pending generators. // The following loop will iterate through the generator @@ -3464,9 +3777,10 @@ // Lines and rays in `*this' can cause `expr' to be non-constant. if (gen_sys_i.is_line_or_ray()) { const int sp_sign = sgn(sp); - if (sp_sign != 0) + if (sp_sign != 0) { // `expr' is unbounded in `*this'. return false; + } } else { // We have a point or a closure point. @@ -3481,8 +3795,9 @@ first_candidate = false; value = candidate; } - else if (candidate != value) + else if (candidate != value) { return false; + } } } @@ -3490,15 +3805,8 @@ PPL_DIRTY_TEMP(mpz_class, n); assign_r(n, expr.inhomogeneous_term(), ROUND_NOT_NEEDED); value += n; - // FIXME: avoid these temporaries, if possible. - // This can be done adding an `assign' function working on native - // and checked or an operator= that have on one side a checked and - // on the other a native or checked. - // The reason why now we can't use operator= is the fact that we - // still can have Coefficient defined to mpz_class (and not - // Checked_Number). - val_n = Coefficient(value.get_num()); - val_d = Coefficient(value.get_den()); + val_n = value.get_num(); + val_d = value.get_den(); freq_n = 0; freq_d = 1; @@ -3508,11 +3816,13 @@ void PPL::Polyhedron::topological_closure_assign() { // Necessarily closed polyhedra are trivially closed. - if (is_necessarily_closed()) + if (is_necessarily_closed()) { return; + } // Any empty or zero-dimensional polyhedron is closed. - if (marked_empty() || space_dim == 0) + if (marked_empty() || space_dim == 0) { return; + } // The computation can be done using constraints or generators. // If we use constraints, we will change them, so that having pending @@ -3520,8 +3830,9 @@ // so that having pending generators still makes sense. // Process any pending constraints. - if (has_pending_constraints() && !process_pending_constraints()) + if (has_pending_constraints() && !process_pending_constraints()) { return; + } // Use constraints only if they are available and // there are no pending generators. @@ -3557,8 +3868,9 @@ PPL_ASSERT(generators_are_up_to_date()); // Add the corresponding point to each closure point. gen_sys.add_corresponding_points(); - if (can_have_something_pending()) + if (can_have_something_pending()) { set_generators_pending(); + } else { // We cannot have pending generators; this also implies // that generators may have lost their sortedness. @@ -3577,31 +3889,37 @@ PPL::operator==(const Polyhedron& x, const Polyhedron& y) { // If the two polyhedra are topology-incompatible or dimension-incompatible, // then they cannot be the same polyhedron. - if (x.topology() != y.topology() || x.space_dim != y.space_dim) + if (x.topology() != y.topology() || x.space_dim != y.space_dim) { return false; + } - if (x.marked_empty()) + if (x.marked_empty()) { return y.is_empty(); - else if (y.marked_empty()) + } + else if (y.marked_empty()) { return x.is_empty(); - else if (x.space_dim == 0) + } + else if (x.space_dim == 0) { return true; + } switch (x.quick_equivalence_test(y)) { case Polyhedron::TVB_TRUE: return true; - case Polyhedron::TVB_FALSE: return false; - default: - if (x.is_included_in(y)) - if (x.marked_empty()) + if (x.is_included_in(y)) { + if (x.marked_empty()) { return y.is_empty(); - else + } + else { return y.is_included_in(x); - else + } + } + else { return false; + } } } @@ -3610,23 +3928,30 @@ const Polyhedron& x = *this; // Topology compatibility check. - if (x.topology() != y.topology()) + if (x.topology() != y.topology()) { throw_topology_incompatible("contains(y)", "y", y); + } // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("contains(y)", "y", y); + } - if (y.marked_empty()) + if (y.marked_empty()) { return true; - else if (x.marked_empty()) + } + else if (x.marked_empty()) { return y.is_empty(); - else if (y.space_dim == 0) + } + else if (y.space_dim == 0) { return true; - else if (x.quick_equivalence_test(y) == Polyhedron::TVB_TRUE) + } + else if (x.quick_equivalence_test(y) == Polyhedron::TVB_TRUE) { return true; - else + } + else { return y.is_included_in(x); + } } bool @@ -3663,44 +3988,57 @@ PPL::Polyhedron::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "space_dim") + if (!(s >> str) || str != "space_dim") { return false; + } - if (!(s >> space_dim)) + if (!(s >> space_dim)) { return false; + } - if (!status.ascii_load(s)) + if (!status.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "con_sys") + if (!(s >> str) || str != "con_sys") { return false; + } - if (!(s >> str) || (str != "(not_up-to-date)" && str != "(up-to-date)")) + if (!(s >> str) || (str != "(not_up-to-date)" && str != "(up-to-date)")) { return false; + } - if (!con_sys.ascii_load(s)) + if (!con_sys.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "gen_sys") + if (!(s >> str) || str != "gen_sys") { return false; + } - if (!(s >> str) || (str != "(not_up-to-date)" && str != "(up-to-date)")) + if (!(s >> str) || (str != "(not_up-to-date)" && str != "(up-to-date)")) { return false; + } - if (!gen_sys.ascii_load(s)) + if (!gen_sys.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "sat_c") + if (!(s >> str) || str != "sat_c") { return false; + } - if (!sat_c.ascii_load(s)) + if (!sat_c.ascii_load(s)) { return false; + } - if (!(s >> str) || str != "sat_g") + if (!(s >> str) || str != "sat_g") { return false; + } - if (!sat_g.ascii_load(s)) + if (!sat_g.ascii_load(s)) { return false; + } // Check invariants. PPL_ASSERT_HEAVY(OK()); @@ -3724,24 +4062,28 @@ const Constraint_System* cs_p, unsigned complexity_threshold, bool wrap_individually) { - if (is_necessarily_closed()) + if (is_necessarily_closed()) { Implementation::wrap_assign(static_cast(*this), vars, w, r, o, cs_p, complexity_threshold, wrap_individually, "C_Polyhedron"); - else + } + else { Implementation::wrap_assign(static_cast(*this), vars, w, r, o, cs_p, complexity_threshold, wrap_individually, "NNC_Polyhedron"); + } } /*! \relates Parma_Polyhedra_Library::Polyhedron */ std::ostream& PPL::IO_Operators::operator<<(std::ostream& s, const Polyhedron& ph) { - if (ph.is_empty()) + if (ph.is_empty()) { s << "false"; - else + } + else { s << ph.minimized_constraints(); + } return s; } diff -Nru ppl-1.1/src/Polyhedron_simplify_templates.hh ppl-1.2/src/Polyhedron_simplify_templates.hh --- ppl-1.1/src/Polyhedron_simplify_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_simplify_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Polyhedron class implementation: simplify(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -82,9 +82,6 @@ template dimension_type Polyhedron::simplify(Linear_System1& sys, Bit_Matrix& sat) { - - typedef typename Linear_System1::row_type sys_row_type; - dimension_type num_rows = sys.num_rows(); const dimension_type num_cols_sat = sat.num_columns(); @@ -93,8 +90,9 @@ // Looking for the first inequality in `sys'. dimension_type num_lines_or_equalities = 0; while (num_lines_or_equalities < num_rows - && sys[num_lines_or_equalities].is_line_or_equality()) + && sys[num_lines_or_equalities].is_line_or_equality()) { ++num_lines_or_equalities; + } // `num_saturators[i]' will contain the number of generators // that saturate the constraint `sys[i]'. @@ -134,11 +132,12 @@ // `sys' is no longer sorted. sys_sorted = false; } - else + else { // There exists a generator which does not saturate `sys[i]', // so that `sys[i]' is indeed an inequality. // We store the number of its saturators. num_saturators[i] = num_cols_sat - sat[i].count_ones(); + } } sys.set_sorted(sys_sorted); @@ -241,8 +240,9 @@ swap(sat[i], sat[num_rows]); swap(num_saturators[i], num_saturators[num_rows]); } - else + else { ++i; + } } // Now we check the independence rule. @@ -255,9 +255,10 @@ // than `i' and also doing the test `strict_subset(sat[i], // sat[k])'. for (dimension_type j = num_lines_or_equalities; j < num_rows; ) { - if (i == j) + if (i == j) { // We want to compare different rows of `sys'. ++j; + } else { // Let us recall that each generator lies on a facet of the // polyhedron (see the Introduction). @@ -268,7 +269,7 @@ // on the latter but not on the former, then `c_2' is more // restrictive than `c_1', i.e., `c_1' is redundant. bool strict_subset; - if (subset_or_equal(sat[j], sat[i], strict_subset)) + if (subset_or_equal(sat[j], sat[i], strict_subset)) { if (strict_subset) { // All the saturators of the inequality `sys[i]' are // saturators of the inequality `sys[j]' too, @@ -289,11 +290,13 @@ swap(sat[j], sat[num_rows]); swap(num_saturators[j], num_saturators[num_rows]); } - else + } + else { // If we reach this point then we know that `sat[i]' does // not contain (and is different from) `sat[j]', so that // `sys[i]' is not made redundant by inequality `sys[j]'. ++j; + } } } if (redundant) { @@ -304,9 +307,10 @@ swap(sat[i], sat[num_rows]); swap(num_saturators[i], num_saturators[num_rows]); } - else + else { // The inequality `sys[i]' is not redundant. ++i; + } } // Here we physically remove the `sat' rows corresponding to the redundant @@ -319,8 +323,9 @@ // `num_rows' - 1) represent the irredundant inequalities. #ifndef NDEBUG // Check if the flag is set (that of the equalities is already set). - for (dimension_type i = num_lines_or_equalities; i < num_rows; ++i) + for (dimension_type i = num_lines_or_equalities; i < num_rows; ++i) { PPL_ASSERT(sys[i].is_ray_or_point_or_inequality()); + } #endif // Finally, since now the sub-system (of `sys') of the irredundant diff -Nru ppl-1.1/src/Polyhedron_templates.hh ppl-1.2/src/Polyhedron_templates.hh --- ppl-1.1/src/Polyhedron_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Polyhedron class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -84,12 +84,14 @@ con_sys.insert(l_d * v_k == l_n); } else { - if (l_bounded) + if (l_bounded) { // Add the constraint `l_d*v_k >= l_n'. con_sys.insert(l_d * v_k >= l_n); - if (u_bounded) + } + if (u_bounded) { // Add the constraint `u_d*v_k <= u_n'. con_sys.insert(u_d * v_k <= u_n); + } } } } @@ -114,21 +116,25 @@ else { // Check if a lower bound constraint is required. if (l_bounded) { - if (l_closed) + if (l_closed) { // Add the constraint `l_d*v_k >= l_n'. con_sys.insert(l_d * v_k >= l_n); - else + } + else { // Add the constraint `l_d*v_k > l_n'. con_sys.insert(l_d * v_k > l_n); + } } // Check if an upper bound constraint is required. if (u_bounded) { - if (u_closed) + if (u_closed) { // Add the constraint `u_d*v_k <= u_n'. con_sys.insert(u_d * v_k <= u_n); - else + } + else { // Add the constraint `u_d*v_k < u_n'. con_sys.insert(u_d * v_k < u_n); + } } } } @@ -145,9 +151,9 @@ template void Polyhedron::map_space_dimensions(const Partial_Function& pfunc) { - if (space_dim == 0) + if (space_dim == 0) { return; - + } if (pfunc.has_empty_codomain()) { // All dimensions vanish: the polyhedron becomes zero_dimensional. if (marked_empty() @@ -158,9 +164,10 @@ space_dim = 0; con_sys.clear(); } - else + else { // Removing all dimensions from a non-empty polyhedron. set_zero_dim_univ(); + } PPL_ASSERT_HEAVY(OK()); return; @@ -181,19 +188,22 @@ std::deque visited(space_dim); for (dimension_type i = space_dim; i-- > 0; ) { - if (visited[i]) + if (visited[i]) { continue; + } dimension_type j = i; do { visited[j] = true; // The following initialization is only to make the compiler happy. dimension_type k = 0; - if (!pfunc.maps(j, k)) + if (!pfunc.maps(j, k)) { throw_invalid_argument("map_space_dimensions(pfunc)", " pfunc is inconsistent"); - if (k == j) + } + if (k == j) { break; + } cycle.push_back(Variable(j)); // Go along the cycle. @@ -205,11 +215,13 @@ // Permute all that is up-to-date. Notice that the contents of // the saturation matrices is unaffected by the permutation of // columns: they remain valid, if they were so. - if (constraints_are_up_to_date()) + if (constraints_are_up_to_date()) { con_sys.permute_space_dimensions(cycle); + } - if (generators_are_up_to_date()) + if (generators_are_up_to_date()) { gen_sys.permute_space_dimensions(cycle); + } cycle.clear(); } @@ -236,8 +248,9 @@ std::vector pfunc_maps(space_dim, not_a_dimension()); for (dimension_type j = space_dim; j-- > 0; ) { dimension_type pfunc_j; - if (pfunc.maps(j, pfunc_j)) + if (pfunc.maps(j, pfunc_j)) { pfunc_maps[j] = pfunc_j; + } } Generator_System new_gensys; @@ -258,12 +271,14 @@ } switch (old_g.type()) { case Generator::LINE: - if (!all_zeroes) + if (!all_zeroes) { new_gensys.insert(line(expr)); + } break; case Generator::RAY: - if (!all_zeroes) + if (!all_zeroes) { new_gensys.insert(ray(expr)); + } break; case Generator::POINT: // A point in the origin has all zero homogeneous coefficients. @@ -296,14 +311,16 @@ // The dimensions of left and right should not be greater than the // dimension of *this. const dimension_type left_space_dim = left.space_dimension(); - if (space_dim < left_space_dim) + if (space_dim < left_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(l1, l2, s)", "l1", left); + } const dimension_type right_space_dim = right.space_dimension(); - if (space_dim < right_space_dim) + if (space_dim < right_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(l1, l2, s)", "l2", right); + } // We assume that the analyzer will not refine an unreachable test. PPL_ASSERT(!marked_empty()); @@ -312,36 +329,42 @@ typedef Linear_Form FP_Linear_Form; if (Floating_Point_Expression:: - overflows(left)) + overflows(left)) { return; + } if (Floating_Point_Expression:: - overflows(right)) + overflows(right)) { return; + } // Overapproximate left - right. FP_Linear_Form left_minus_right(left); left_minus_right -= right; if (Floating_Point_Expression:: - overflows(left_minus_right)) + overflows(left_minus_right)) { return; + } dimension_type lf_space_dim = left_minus_right.space_dimension(); FP_Linear_Form lf_approx; overapproximate_linear_form(left_minus_right, lf_space_dim, lf_approx); if (Floating_Point_Expression:: - overflows(lf_approx)) + overflows(lf_approx)) { return; + } // Normalize left - right. Linear_Expression lf_approx_le; convert_to_integer_expression(lf_approx, lf_space_dim, lf_approx_le); // Finally, do the refinement. - if (!is_strict || is_necessarily_closed()) + if (!is_strict || is_necessarily_closed()) { refine_with_constraint(lf_approx_le <= 0); - else + } + else { refine_with_constraint(lf_approx_le < 0); + } } template @@ -357,13 +380,15 @@ // Dimension compatibility checks. // The dimension of lf should not be greater than the dimension of *this. const dimension_type lf_space_dim = lf.space_dimension(); - if (space_dim < lf_space_dim) + if (space_dim < lf_space_dim) { throw_dimension_incompatible("affine_form_image(v, l, s)", "l", lf); + } // `var' should be one of the dimensions of the polyhedron. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("affine_form_image(v, l, s)", "v", var); + } // We assume that the analyzer will not perform an unreachable assignment. PPL_ASSERT(!marked_empty()); @@ -402,10 +427,10 @@ template void -Polyhedron::overapproximate_linear_form -(const Linear_Form >& lf, - const dimension_type lf_dimension, - Linear_Form >& result) { +Polyhedron +::overapproximate_linear_form(const Linear_Form >& lf, + const dimension_type lf_dimension, + Linear_Form >& result) { // Check that FP_Format is indeed a floating point type. PPL_COMPILE_TIME_CHECK(!std::numeric_limits::is_exact, @@ -466,14 +491,16 @@ // FIXME: are these checks numerator[i] != 0 really necessary? numer_denom(b.lower(), numerators[lf_dimension], denominators[lf_dimension]); - if (numerators[lf_dimension] != 0) + if (numerators[lf_dimension] != 0) { lcm_assign(lcm, lcm, denominators[lf_dimension]); + } for (dimension_type i = 0; i < lf_dimension; ++i) { const FP_Interval_Type& curr_int = lf.coefficient(Variable(i)); numer_denom(curr_int.lower(), numerators[i], denominators[i]); - if (numerators[i] != 0) + if (numerators[i] != 0) { lcm_assign(lcm, lcm, denominators[i]); + } } for (dimension_type i = 0; i < lf_dimension; ++i) { @@ -512,19 +539,22 @@ const FP_Interval_Type& b = lf.inhomogeneous_term(); numer_denom(b.lower(), numerators[lf_dimension], denominators[lf_dimension]); // FIXME: are these checks numerator[i] != 0 really necessary? - if (numerators[lf_dimension] != 0) + if (numerators[lf_dimension] != 0) { lcm_assign(lcm, lcm, denominators[lf_dimension]); + } numer_denom(b.upper(), numerators[lf_dimension+1], denominators[lf_dimension+1]); - if (numerators[lf_dimension+1] != 0) + if (numerators[lf_dimension+1] != 0) { lcm_assign(lcm, lcm, denominators[lf_dimension+1]); + } for (dimension_type i = 0; i < lf_dimension; ++i) { const FP_Interval_Type& curr_int = lf.coefficient(Variable(i)); numer_denom(curr_int.lower(), numerators[i], denominators[i]); - if (numerators[i] != 0) + if (numerators[i] != 0) { lcm_assign(lcm, lcm, denominators[i]); + } } for (dimension_type i = 0; i < lf_dimension; ++i) { @@ -541,8 +571,9 @@ numerators[lf_dimension] *= denominators[lf_dimension]; res_low_coeff = numerators[lf_dimension]; } - else - res_low_coeff = Coefficient(0); + else { + res_low_coeff = 0; + } if (numerators[lf_dimension+1] != 0) { exact_div_assign(denominators[lf_dimension+1], @@ -550,8 +581,9 @@ numerators[lf_dimension+1] *= denominators[lf_dimension+1]; res_hi_coeff = numerators[lf_dimension+1]; } - else - res_hi_coeff = Coefficient(0); + else { + res_hi_coeff = 0; + } } template diff -Nru ppl-1.1/src/Polyhedron_types.hh ppl-1.2/src/Polyhedron_types.hh --- ppl-1.1/src/Polyhedron_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Polyhedron_widenings.cc ppl-1.2/src/Polyhedron_widenings.cc --- ppl-1.1/src/Polyhedron_widenings.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Polyhedron_widenings.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Polyhedron class implementation (non-inline widening-related member functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,7 +28,7 @@ #include "Rational_Box.hh" #include "Scalar_Products_defs.hh" #include "Scalar_Products_inlines.hh" -#include "assert.hh" +#include "assertions.hh" #include #include #include @@ -57,8 +57,9 @@ // the ordering of the chosen constraints. for (dimension_type i = 0, end = y.con_sys.num_rows(); i < end; ++i) { const Constraint& c = y.con_sys[i]; - if (gen_sys.satisfied_by_all_generators(c)) + if (gen_sys.satisfied_by_all_generators(c)) { cs_selection.insert(c); + } } } @@ -90,8 +91,9 @@ } // Obtain a sorted copy of `y.sat_g'. - if (!y.sat_g_is_up_to_date()) + if (!y.sat_g_is_up_to_date()) { y.update_sat_g(); + } Bit_Matrix tmp_sat_g = y.sat_g; // Remove from `tmp_sat_g' the rows corresponding to tautologies // (i.e., the positivity or epsilon-bounding constraints): @@ -100,12 +102,13 @@ const Constraint_System& y_cs = y.con_sys; const dimension_type old_num_rows = y_cs.num_rows(); dimension_type num_rows = old_num_rows; - for (dimension_type i = 0; i < num_rows; ++i) + for (dimension_type i = 0; i < num_rows; ++i) { if (y_cs[i].is_tautological()) { using std::swap; --num_rows; swap(tmp_sat_g[i], tmp_sat_g[num_rows]); } + } tmp_sat_g.remove_trailing_rows(old_num_rows - num_rows); tmp_sat_g.sort_rows(); @@ -143,15 +146,18 @@ || (!is_necessarily_closed() && ci.is_strict_inequality() && y.gen_sys[j].is_point())); - if (sp_sgn > 0) + if (sp_sgn > 0) { buffer.set(j); + } } // We check whether `buffer' is a row of `tmp_sat_g', // exploiting its sortedness in order to have faster comparisons. - if (tmp_sat_g.sorted_contains(buffer)) + if (tmp_sat_g.sorted_contains(buffer)) { cs_selected.insert(ci); - else + } + else { cs_not_selected.insert(ci); + } } } @@ -160,26 +166,29 @@ Polyhedron& x = *this; // Topology compatibility check. const Topology topol = x.topology(); - if (topol != y.topology()) + if (topol != y.topology()) { throw_topology_incompatible("H79_widening_assign(y)", "y", y); // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + } + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("H79_widening_assign(y)", "y", y); - + } // Assume `y' is contained in or equal to `x'. PPL_EXPECT_HEAVY(copy_contains(x, y)); // If any argument is zero-dimensional or empty, // the H79-widening behaves as the identity function. - if (x.space_dim == 0 || x.marked_empty() || y.marked_empty()) + if (x.space_dim == 0 || x.marked_empty() || y.marked_empty()) { return; + } // `y.gen_sys' should be in minimal form and // `y.sat_g' should be up-to-date. if (y.is_necessarily_closed()) { - if (!y.minimize()) + if (!y.minimize()) { // `y' is empty: the result is `x'. return; + } } else { // Dealing with a NNC polyhedron. @@ -191,9 +200,10 @@ // this is obtained by intersecting the two eps-representations. Polyhedron& yy = const_cast(y); yy.intersection_assign(x); - if (yy.is_empty()) + if (yy.is_empty()) { // The result is `x'. return; + } } // If we only have the generators of `x' and the dimensions of @@ -222,12 +232,14 @@ if (tp != 0 && *tp > 0) { // There are tokens available. If `CH78' is not a subset of `x', // then it is less precise and we use one of the available tokens. - if (!x.contains(CH78)) + if (!x.contains(CH78)) { --(*tp); + } } - else + else { // No tokens. x.m_swap(CH78); + } PPL_ASSERT_HEAVY(x.OK(true)); return; } @@ -242,21 +254,23 @@ // - redundant constraints in `x.con_sys' do not affect the result // of the widening, because if they are selected they will be // redundant even in the result. - if (has_pending_generators()) + if (has_pending_generators()) { process_pending_generators(); - else if (!x.constraints_are_up_to_date()) + } + else if (!x.constraints_are_up_to_date()) { x.update_constraints(); - + } // Copy into `H79_cs' the constraints of `x' that are common to `y', // according to the definition of the H79 widening. Constraint_System H79_cs(topol); Constraint_System x_minus_H79_cs(topol); x.select_H79_constraints(y, H79_cs, x_minus_H79_cs); - if (x_minus_H79_cs.has_no_rows()) + if (x_minus_H79_cs.has_no_rows()) { // We selected all of the constraints of `x', // thus the result of the widening is `x'. return; + } else { // We selected a strict subset of the constraints of `x'. // NOTE: as `x.con_sys' was not necessarily in minimal form, @@ -270,12 +284,14 @@ if (tp != 0 && *tp > 0) { // There are tokens available. If `H79' is not a subset of `x', // then it is less precise and we use one of the available tokens. - if (!x.contains(H79)) + if (!x.contains(H79)) { --(*tp); + } } - else + else { // No tokens. x.m_swap(H79); + } PPL_ASSERT_HEAVY(x.OK(true)); } } @@ -295,52 +311,59 @@ // Topology compatibility check. if (x.is_necessarily_closed()) { - if (!y.is_necessarily_closed()) + if (!y.is_necessarily_closed()) { throw_topology_incompatible("limited_H79_extrapolation_assign(y, cs)", "y", y); - if (cs.has_strict_inequalities()) + } + if (cs.has_strict_inequalities()) { throw_topology_incompatible("limited_H79_extrapolation_assign(y, cs)", "cs", cs); + } } - else if (y.is_necessarily_closed()) + else if (y.is_necessarily_closed()) { throw_topology_incompatible("limited_H79_extrapolation_assign(y, cs)", "y", y); - + } // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("limited_H79_extrapolation_assign(y, cs)", "y", y); + } // `cs' must be dimension-compatible with the two polyhedra. const dimension_type cs_space_dim = cs.space_dimension(); - if (x.space_dim < cs_space_dim) + if (x.space_dim < cs_space_dim) { throw_dimension_incompatible("limited_H79_extrapolation_assign(y, cs)", "cs", cs); - + } // Assume `y' is contained in or equal to `x'. PPL_EXPECT_HEAVY(copy_contains(x, y)); - if (y.marked_empty()) + if (y.marked_empty()) { return; - if (x.marked_empty()) + } + if (x.marked_empty()) { return; - + } // The limited H79-widening between two polyhedra in a // zero-dimensional space is a polyhedron in a zero-dimensional // space, too. - if (x.space_dim == 0) + if (x.space_dim == 0) { return; + } - if (!y.minimize()) + if (!y.minimize()) { // We have just discovered that `y' is empty. return; + } // Update the generators of `x': these are used to select, // from the constraints in `cs', those that must be added // to the resulting polyhedron. if ((x.has_pending_constraints() && !x.process_pending_constraints()) - || (!x.generators_are_up_to_date() && !x.update_generators())) + || (!x.generators_are_up_to_date() && !x.update_generators())) { // We have just discovered that `x' is empty. return; + } Constraint_System new_cs; // The constraints to be added must be satisfied by all the @@ -350,8 +373,9 @@ // Not really an issue: just aesthetics. for (dimension_type i = 0; i < cs_num_rows; ++i) { const Constraint& c = cs[i]; - if (x_gen_sys.satisfied_by_all_generators(c)) + if (x_gen_sys.satisfied_by_all_generators(c)) { new_cs.insert(c); + } } x.H79_widening_assign(y, tp); x.add_recycled_constraints(new_cs); @@ -399,8 +423,9 @@ // There is no point in applying this technique when `x_minus_H79_cs' // has one constraint at most (no ``new'' constraint can be computed). const dimension_type x_minus_H79_cs_num_rows = x_minus_H79_cs.num_rows(); - if (x_minus_H79_cs_num_rows <= 1) + if (x_minus_H79_cs_num_rows <= 1) { return false; + } const Topology topol = x.topology(); Constraint_System combining_cs(topol); @@ -424,37 +449,43 @@ break; } } - if (lies_on_the_boundary_of_H79) + if (lies_on_the_boundary_of_H79) { continue; + } // Consider all the constraints in `x_minus_H79_cs' // that are saturated by the point `g'. combining_cs.clear(); for (dimension_type j = x_minus_H79_cs_num_rows; j-- > 0; ) { const Constraint& c = x_minus_H79_cs[j]; - if (Scalar_Products::sign(c, g) == 0) + if (Scalar_Products::sign(c, g) == 0) { combining_cs.insert(c); + } } // Build a new constraint by combining all the chosen constraints. const dimension_type combining_cs_num_rows = combining_cs.num_rows(); if (combining_cs_num_rows > 0) { - if (combining_cs_num_rows == 1) + if (combining_cs_num_rows == 1) { // No combination is needed. new_cs.insert(combining_cs[0]); + } else { Linear_Expression e(0); bool strict_inequality = false; for (dimension_type h = combining_cs_num_rows; h-- > 0; ) { - if (combining_cs[h].is_strict_inequality()) + if (combining_cs[h].is_strict_inequality()) { strict_inequality = true; + } e += Linear_Expression(combining_cs[h].expression()); } if (!e.all_homogeneous_terms_are_zero()) { - if (strict_inequality) + if (strict_inequality) { new_cs.insert(e > 0); - else + } + else { new_cs.insert(e >= 0); + } } } } @@ -465,13 +496,15 @@ // then the technique was unsuccessful. bool improves_upon_H79 = false; const Poly_Con_Relation si = Poly_Con_Relation::strictly_intersects(); - for (dimension_type i = new_cs.num_rows(); i-- > 0; ) + for (dimension_type i = new_cs.num_rows(); i-- > 0; ) { if (H79.relation_with(new_cs[i]) == si) { improves_upon_H79 = true; break; } - if (!improves_upon_H79) + } + if (!improves_upon_H79) { return false; + } // The resulting polyhedron is obtained by adding the constraints // in `new_cs' to polyhedron `H79'. @@ -488,9 +521,10 @@ PPL_ASSERT_HEAVY(x.OK(true)); return true; } - else + else { // The technique was unsuccessful. return false; + } } bool @@ -558,9 +592,10 @@ PPL_ASSERT_HEAVY(x.OK(true)); return true; } - else + else { // The technique was unsuccessful. return false; + } } void @@ -572,17 +607,21 @@ Linear_Expression::const_iterator x_end = x.end(); Linear_Expression::const_iterator y_end = y.end(); Linear_Expression::const_iterator y_k = y.begin(); - for (Linear_Expression::const_iterator x_k = x.begin(); x_k != x_end; ++x_k) { + for (Linear_Expression::const_iterator x_k = x.begin(); + x_k != x_end; ++x_k) { const Variable k_var = x_k.variable(); const dimension_type k = k_var.id(); - if (considered[k]) + if (considered[k]) { continue; + } - while (y_k != y_end && y_k.variable().id() < k) + while (y_k != y_end && y_k.variable().id() < k) { ++y_k; + } - if (y_k == y_end) + if (y_k == y_end) { break; + } const Variable y_k_var = y_k.variable(); @@ -594,18 +633,22 @@ ++x_h; for ( ; x_h != x_end; ++x_h) { const dimension_type h = x_h.variable().id(); - if (considered[h]) + if (considered[h]) { continue; + } - while (y_h != y_end && y_h.variable().id() < h) + while (y_h != y_end && y_h.variable().id() < h) { ++y_h; + } // Note that y_h may be y_end, and y_h.variable().id() may not be k. - if (y_h != y_end && y_h.variable().id() == h) + if (y_h != y_end && y_h.variable().id() == h) { tmp = (*x_k) * (*y_h); - else + } + else { tmp = 0; + } if (y_k_var.id() == k) { // The following line optimizes the computation of @@ -673,8 +716,9 @@ } // If there are no candidate rays, we cannot obtain stabilization. - if (candidate_rays.has_no_rows()) + if (candidate_rays.has_no_rows()) { return false; + } // Be non-intrusive. Polyhedron result = x; @@ -690,33 +734,38 @@ PPL_ASSERT_HEAVY(x.OK(true)); return true; } - else + else { // The technique was unsuccessful. return false; + } } void PPL::Polyhedron::BHRZ03_widening_assign(const Polyhedron& y, unsigned* tp) { Polyhedron& x = *this; // Topology compatibility check. - if (x.topology() != y.topology()) + if (x.topology() != y.topology()) { throw_topology_incompatible("BHRZ03_widening_assign(y)", "y", y); + } // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("BHRZ03_widening_assign(y)", "y", y); + } // Assume `y' is contained in or equal to `x'. PPL_EXPECT_HEAVY(copy_contains(x, y)); // If any argument is zero-dimensional or empty, // the BHRZ03-widening behaves as the identity function. - if (x.space_dim == 0 || x.marked_empty() || y.marked_empty()) + if (x.space_dim == 0 || x.marked_empty() || y.marked_empty()) { return; + } // `y.con_sys' and `y.gen_sys' should be in minimal form. - if (!y.minimize()) + if (!y.minimize()) { // `y' is empty: the result is `x'. return; + } // `x.con_sys' and `x.gen_sys' should be in minimal form. x.minimize(); @@ -760,18 +809,21 @@ // NOTE: none of the following widening heuristics is intrusive: // they will modify `x' only when returning successfully. - if (x.BHRZ03_combining_constraints(y, y_cert, H79, x_minus_H79_cs)) + if (x.BHRZ03_combining_constraints(y, y_cert, H79, x_minus_H79_cs)) { return; + } PPL_ASSERT_HEAVY(H79.OK() && x.OK() && y.OK()); - if (x.BHRZ03_evolving_points(y, y_cert, H79)) + if (x.BHRZ03_evolving_points(y, y_cert, H79)) { return; + } PPL_ASSERT_HEAVY(H79.OK() && x.OK() && y.OK()); - if (x.BHRZ03_evolving_rays(y, y_cert, H79)) + if (x.BHRZ03_evolving_rays(y, y_cert, H79)) { return; + } PPL_ASSERT_HEAVY(H79.OK() && x.OK() && y.OK()); @@ -798,52 +850,61 @@ // Topology compatibility check. if (x.is_necessarily_closed()) { - if (!y.is_necessarily_closed()) + if (!y.is_necessarily_closed()) { throw_topology_incompatible("limited_BHRZ03_extrapolation_assign(y, cs)", "y", y); - if (cs.has_strict_inequalities()) + } + if (cs.has_strict_inequalities()) { throw_topology_incompatible("limited_BHRZ03_extrapolation_assign(y, cs)", "cs", cs); + } } - else if (y.is_necessarily_closed()) + else if (y.is_necessarily_closed()) { throw_topology_incompatible("limited_BHRZ03_extrapolation_assign(y, cs)", "y", y); - + } // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { throw_dimension_incompatible("limited_BHRZ03_extrapolation_assign(y, cs)", "y", y); + } // `cs' must be dimension-compatible with the two polyhedra. const dimension_type cs_space_dim = cs.space_dimension(); - if (x.space_dim < cs_space_dim) + if (x.space_dim < cs_space_dim) { throw_dimension_incompatible("limited_BHRZ03_extrapolation_assign(y, cs)", "cs", cs); + } // Assume `y' is contained in or equal to `x'. PPL_EXPECT_HEAVY(copy_contains(x, y)); - if (y.marked_empty()) + if (y.marked_empty()) { return; - if (x.marked_empty()) + } + if (x.marked_empty()) { return; + } // The limited BHRZ03-widening between two polyhedra in a // zero-dimensional space is a polyhedron in a zero-dimensional // space, too. - if (x.space_dim == 0) + if (x.space_dim == 0) { return; + } - if (!y.minimize()) + if (!y.minimize()) { // We have just discovered that `y' is empty. return; + } // Update the generators of `x': these are used to select, // from the constraints in `cs', those that must be added // to the resulting polyhedron. if ((x.has_pending_constraints() && !x.process_pending_constraints()) - || (!x.generators_are_up_to_date() && !x.update_generators())) + || (!x.generators_are_up_to_date() && !x.update_generators())) { // We have just discovered that `x' is empty. return; + } Constraint_System new_cs; // The constraints to be added must be satisfied by all the @@ -853,8 +914,9 @@ // Not really an issue: just aesthetics. for (dimension_type i = 0; i < cs_num_rows; ++i) { const Constraint& c = cs[i]; - if (x_gen_sys.satisfied_by_all_generators(c)) + if (x_gen_sys.satisfied_by_all_generators(c)) { new_cs.insert(c); + } } x.BHRZ03_widening_assign(y, tp); x.add_recycled_constraints(new_cs); diff -Nru ppl-1.1/src/Powerset_defs.hh ppl-1.2/src/Powerset_defs.hh --- ppl-1.1/src/Powerset_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Powerset_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Powerset class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Powerset_inlines.hh ppl-1.2/src/Powerset_inlines.hh --- ppl-1.1/src/Powerset_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Powerset_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Powerset class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,8 +24,8 @@ #ifndef PPL_Powerset_inlines_hh #define PPL_Powerset_inlines_hh 1 +#include "assertions.hh" #include -#include "assert.hh" namespace Parma_Polyhedra_Library { @@ -124,9 +124,8 @@ template inline void Powerset::m_swap(Powerset& y) { - using std::swap; - swap(sequence, y.sequence); - swap(reduced, y.reduced); + std::swap(sequence, y.sequence); + std::swap(reduced, y.reduced); } template @@ -190,8 +189,9 @@ template inline void Powerset::collapse() { - if (!empty()) + if (!empty()) { collapse(sequence.begin()); + } } template diff -Nru ppl-1.1/src/Powerset_templates.hh ppl-1.2/src/Powerset_templates.hh --- ppl-1.1/src/Powerset_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Powerset_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Powerset class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -25,9 +25,9 @@ #define PPL_Powerset_templates_hh 1 #include "globals_defs.hh" -#include -#include "assert.hh" +#include "assertions.hh" #include +#include namespace Parma_Polyhedra_Library { @@ -40,17 +40,21 @@ iterator next_x_sink = x_sink; ++next_x_sink; iterator x_end = end(); - for (const_iterator xi = next_x_sink; xi != x_end; ++xi) + for (const_iterator xi = next_x_sink; xi != x_end; ++xi) { d.upper_bound_assign(*xi); + } // Drop the surplus disjuncts. drop_disjuncts(next_x_sink, x_end); // Ensure omega-reduction. - for (iterator xi = begin(); xi != x_sink; ) - if (xi->definitely_entails(d)) + for (iterator xi = begin(); xi != x_sink; ) { + if (xi->definitely_entails(d)) { xi = drop_disjunct(xi); - else + } + else { ++xi; + } + } PPL_ASSERT_HEAVY(OK()); } @@ -58,38 +62,47 @@ template void Powerset::omega_reduce() const { - if (reduced) + if (reduced) { return; - + } Powerset& x = const_cast(*this); // First remove all bottom elements. - for (iterator xi = x.begin(), x_end = x.end(); xi != x_end; ) - if (xi->is_bottom()) + for (iterator xi = x.begin(), x_end = x.end(); xi != x_end; ) { + if (xi->is_bottom()) { xi = x.drop_disjunct(xi); - else + } + else { ++xi; + } + } // Then remove non-maximal elements. for (iterator xi = x.begin(); xi != x.end(); ) { const D& xv = *xi; bool dropping_xi = false; - for (iterator yi = x.begin(); yi != x.end(); ) - if (xi == yi) + for (iterator yi = x.begin(); yi != x.end(); ) { + if (xi == yi) { ++yi; + } else { const D& yv = *yi; - if (yv.definitely_entails(xv)) + if (yv.definitely_entails(xv)) { yi = x.drop_disjunct(yi); + } else if (xv.definitely_entails(yv)) { dropping_xi = true; break; } - else + else { ++yi; + } } - if (dropping_xi) + } + if (dropping_xi) { xi = x.drop_disjunct(xi); - else + } + else { ++xi; + } if (abandon_expensive_computations != 0 && xi != x.end()) { // Hurry up! x.collapse(xi.base); @@ -125,14 +138,17 @@ for (const_iterator x_begin = begin(), x_end = end(), xi = x_begin; xi != x_end; ++xi) { const D& xv = *xi; - if (xv.is_bottom()) + if (xv.is_bottom()) { return false; + } for (const_iterator yi = x_begin; yi != x_end; ++yi) { - if (xi == yi) + if (xi == yi) { continue; + } const D& yv = *yi; - if (xv.definitely_entails(yv) || yv.definitely_entails(xv)) + if (xv.definitely_entails(yv) || yv.definitely_entails(xv)) { return false; + } } } return true; @@ -141,8 +157,9 @@ template bool Powerset::is_omega_reduced() const { - if (!reduced && check_omega_reduced()) + if (!reduced && check_omega_reduced()) { reduced = true; + } return reduced; } @@ -154,15 +171,18 @@ PPL_ASSERT_HEAVY(!d.is_bottom()); for (iterator xi = first; xi != last; ) { const D& xv = *xi; - if (d.definitely_entails(xv)) + if (d.definitely_entails(xv)) { return first; + } else if (xv.definitely_entails(d)) { - if (xi == first) + if (xi == first) { ++first; + } xi = drop_disjunct(xi); } - else + else { ++xi; + } } sequence.push_back(d); PPL_ASSERT_HEAVY(OK()); @@ -178,8 +198,9 @@ x_end = x.end(); found && xi != x_end; ++xi) { found = false; for (const_iterator yi = y.begin(), - y_end = y.end(); !found && yi != y_end; ++yi) + y_end = y.end(); !found && yi != y_end; ++yi) { found = (*xi).definitely_entails(*yi); + } } return found; } @@ -190,8 +211,9 @@ operator==(const Powerset& x, const Powerset& y) { x.omega_reduce(); y.omega_reduce(); - if (x.size() != y.size()) + if (x.size() != y.size()) { return false; + } // Take a copy of `y' and work with it. Powerset z = y; for (typename Powerset::const_iterator xi = x.begin(), @@ -199,10 +221,12 @@ typename Powerset::iterator zi = z.begin(); typename Powerset::iterator z_end = z.end(); zi = std::find(zi, z_end, *xi); - if (zi == z_end) + if (zi == z_end) { return false; - else + } + else { z.drop_disjunct(zi); + } } return true; } @@ -217,16 +241,17 @@ y.omega_reduce(); Sequence new_sequence; for (const_iterator xi = begin(), x_end = end(), - y_begin = y.begin(), y_end = y.end(); xi != x_end; ++xi) + y_begin = y.begin(), y_end = y.end(); xi != x_end; ++xi) { for (const_iterator yi = y_begin; yi != y_end; ++yi) { D zi = *xi; op_assign(zi, *yi); - if (!zi.is_bottom()) + if (!zi.is_bottom()) { new_sequence.push_back(zi); + } } + } // Put the new sequence in place. - using std::swap; - swap(sequence, new_sequence); + std::swap(sequence, new_sequence); reduced = false; PPL_ASSERT_HEAVY(OK()); } @@ -239,10 +264,11 @@ y.omega_reduce(); iterator old_begin = begin(); iterator old_end = end(); - for (const_iterator i = y.begin(), y_end = y.end(); i != y_end; ++i) + for (const_iterator i = y.begin(), y_end = y.end(); i != y_end; ++i) { old_begin = add_non_bottom_disjunct_preserve_reduction(*i, old_begin, old_end); + } PPL_ASSERT_HEAVY(OK()); } @@ -252,18 +278,22 @@ template std::ostream& operator<<(std::ostream& s, const Powerset& x) { - if (x.is_bottom()) + if (x.is_bottom()) { s << "false"; - else if (x.is_top()) + } + else if (x.is_top()) { s << "true"; - else + } + else { for (typename Powerset::const_iterator i = x.begin(), x_end = x.end(); i != x_end; ) { s << "{ " << *i << " }"; ++i; - if (i != x_end) + if (i != x_end) { s << ", "; + } } + } return s; } @@ -287,8 +317,9 @@ bool Powerset::OK(const bool disallow_bottom) const { for (const_iterator xi = begin(), x_end = end(); xi != x_end; ++xi) { - if (!xi->OK()) + if (!xi->OK()) { return false; + } if (disallow_bottom && xi->is_bottom()) { #ifndef NDEBUG std::cerr << "Bottom element in powerset!" diff -Nru ppl-1.1/src/Powerset_types.hh ppl-1.2/src/Powerset_types.hh --- ppl-1.1/src/Powerset_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Powerset_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/ppl-config.cc.in ppl-1.2/src/ppl-config.cc.in --- ppl-1.1/src/ppl-config.cc.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/ppl-config.cc.in 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* A program to enquire about the configuration of the PPL -*- C++ -*- and of the applications using it. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/ppl_header.hh ppl-1.2/src/ppl_header.hh --- ppl-1.1/src/ppl_header.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/ppl_header.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* This is the header file of the Parma Polyhedra Library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -112,7 +112,7 @@ // Must include again in order to make the latest changes to // NDEBUG effective. #include -#include "assert.hh" +#include "assertions.hh" #ifdef PPL_NO_AUTOMATIC_INITIALIZATION #undef PPL_NO_AUTOMATIC_INITIALIZATION diff -Nru ppl-1.1/src/ppl.hh.dist ppl-1.2/src/ppl.hh.dist --- ppl-1.1/src/ppl.hh.dist 2013-10-28 12:47:20.000000000 +0000 +++ ppl-1.2/src/ppl.hh.dist 2016-02-11 12:40:41.000000000 +0000 @@ -1,6 +1,6 @@ /* This is the header file of the Parma Polyhedra Library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -63,6 +63,9 @@ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ +/* Defined if the C++compiler supports C++11 features. */ +/* #undef PPL_HAVE_CXX11 */ + /* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ #define PPL_HAVE_DECL_FFS 1 @@ -245,7 +248,7 @@ #define PPL_PACKAGE_NAME "the Parma Polyhedra Library" /* Define to the full name and version of this package. */ -#define PPL_PACKAGE_STRING "the Parma Polyhedra Library 1.1" +#define PPL_PACKAGE_STRING "the Parma Polyhedra Library 1.2" /* Define to the one symbol short name of this package. */ #define PPL_PACKAGE_TARNAME "ppl" @@ -254,7 +257,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PPL_PACKAGE_VERSION "1.1" +#define PPL_PACKAGE_VERSION "1.2" /* ABI-breaking extra assertions are enabled when this is defined. */ /* #undef PPL_ABI_BREAKING_EXTRA_DEBUG */ @@ -458,7 +461,7 @@ //! The minor number of the PPL version. /*! \ingroup PPL_CXX_interface */ -#define PPL_VERSION_MINOR 1 +#define PPL_VERSION_MINOR 2 //! The revision number of the PPL version. /*! \ingroup PPL_CXX_interface */ @@ -483,7 +486,7 @@ PPL_VERSION_BETA is zero, M "." m "." r "pre" b if neither PPL_VERSION_REVISION nor PPL_VERSION_BETA are zero. */ -#define PPL_VERSION "1.1" +#define PPL_VERSION "1.2" namespace Parma_Polyhedra_Library { @@ -743,9 +746,6 @@ */ -#include -#include -#include /* Automatically generated from PPL source file ../src/mp_std_bits_defs.hh line 1. */ /* Declarations of specializations of std:: objects for multi-precision types. @@ -1304,8 +1304,20 @@ //! Pointer to the next item in the free list. Temp_Item* next; + class Free_List { + public: + Free_List(); + ~Free_List(); + Temp_Item* head_ptr; + private: + Free_List(const Free_List&); // Not implemented. + Free_List& operator=(const Free_List&); // Not implemented. + }; // class Free_List + + friend class Free_List; + //! Head of the free list. - static Temp_Item* free_list_head; + static Temp_Item*& free_list_ref(); //! Default constructor. Temp_Item(); @@ -1412,22 +1424,36 @@ } template +inline +Temp_Item::Free_List::Free_List() + : head_ptr(0) { +} + +template +inline Temp_Item*& +Temp_Item::free_list_ref() { + static Free_List free_list; + return free_list.head_ptr; +} + +template inline Temp_Item& Temp_Item::obtain() { - if (free_list_head != 0) { - Temp_Item* const p = free_list_head; - free_list_head = free_list_head->next; + Temp_Item* const p = free_list_ref(); + if (p != 0) { + free_list_ref() = p->next; return *p; } - else + else { return *new Temp_Item(); + } } template inline void Temp_Item::release(Temp_Item& p) { - p.next = free_list_head; - free_list_head = &p; + p.next = free_list_ref(); + free_list_ref() = &p; } template @@ -1473,11 +1499,17 @@ namespace Parma_Polyhedra_Library { template -Temp_Item* Temp_Item::free_list_head = 0; +Temp_Item::Free_List::~Free_List() { + while (head_ptr != 0) { + Temp_Item* const p = head_ptr; + head_ptr = head_ptr->next; + delete p; + } +} } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Temp_defs.hh line 142. */ +/* Automatically generated from PPL source file ../src/Temp_defs.hh line 154. */ /* Automatically generated from PPL source file ../src/Rounding_Dir_defs.hh line 1. */ /* Declaration of Rounding_Dir and related functions. @@ -1660,7 +1692,7 @@ */ -/* Automatically generated from PPL source file ../src/assert.hh line 1. */ +/* Automatically generated from PPL source file ../src/assertions.hh line 1. */ /* Implementation of PPL assert-like macros. */ @@ -1936,7 +1968,7 @@ #define PPL_UNINITIALIZED(type, name) \ PPL_U(type) PPL_U(name) \ - = Suppress_Uninitialized_Warnings_Type::synonym () + = Suppress_Uninitialized_Warnings_Type::synonym() #else #define PPL_UNINITIALIZED(type, name) \ PPL_U(type) name @@ -1966,17 +1998,20 @@ w >>= 2; r -= 2; } - if ((w & 0x2U) != 0) + if ((w & 0x2U) != 0) { r -= 1; + } return r; } inline unsigned int clz64(uint64_t w) { - if ((w & 0xffffffff00000000ULL) == 0) + if ((w & 0xffffffff00000000ULL) == 0) { return clz32(static_cast(w)) + 32; - else + } + else { return clz32(static_cast(w >> 32)); + } } inline unsigned int @@ -1991,10 +2026,12 @@ inline unsigned int ctz64(uint64_t w) { - if ((w & 0x00000000ffffffffULL) == 0) + if ((w & 0x00000000ffffffffULL) == 0) { return ctz32(static_cast(w >> 32)) + 32; - else + } + else { return ctz32(static_cast(w)); + } } #endif @@ -2292,8 +2329,9 @@ // NOTE: on entry to this function the current rounding mode // has to be the default one. extern bool have_sse_unit; - if (have_sse_unit) + if (have_sse_unit) { sse_set_control(PPL_SSE_CONTROL_DEFAULT); + } #endif } @@ -2304,21 +2342,24 @@ #endif #ifdef PPL_FPMATH_MAY_USE_SSE extern bool have_sse_unit; - if (have_sse_unit) + if (have_sse_unit) { sse_set_control(PPL_SSE_CONTROL_DEFAULT); + } #endif } inline int fpu_check_inexact() { #ifdef PPL_FPMATH_MAY_USE_387 - if (fpu_get_status() & FPU_INEXACT) + if (fpu_get_status() & FPU_INEXACT) { return 1; + } #endif #ifdef PPL_FPMATH_MAY_USE_SSE extern bool have_sse_unit; - if (have_sse_unit && (sse_get_control() & SSE_INEXACT)) + if (have_sse_unit && (sse_get_control() & SSE_INEXACT)) { return 1; + } #endif return 0; } @@ -2416,10 +2457,11 @@ const int old = fegetround(); if (fesetround(PPL_FPU_DOWNWARD) != 0 || fesetround(PPL_FPU_UPWARD) != 0 - || fesetround(old) != 0) + || fesetround(old) != 0) { throw std::logic_error("PPL configuration error:" " PPL_CAN_CONTROL_FPU evaluates to true," " but fesetround() returns nonzero."); + } } inline fpu_rounding_direction_type @@ -3069,7 +3111,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Float_defs.hh line 34. */ +/* Automatically generated from PPL source file ../src/Float_defs.hh line 33. */ #include #include #include @@ -3561,7 +3603,6 @@ */ -#include /* Automatically generated from PPL source file ../src/Variable_defs.hh line 1. */ /* Variable class declaration. */ @@ -3983,12 +4024,15 @@ ? DISCARDED : VALID; ++stat[i].samples; - if (stat[i].count == 0) + if (stat[i].count == 0) { stat[i].min = stat[i].max = elapsed1; - else if (stat[i].min > elapsed1) + } + else if (stat[i].min > elapsed1) { stat[i].min = elapsed1; - else if (stat[i].max < elapsed1) + } + else if (stat[i].max < elapsed1) { stat[i].max = elapsed1; + } stat[i].sum += elapsed; stat[i].squares_sum += elapsed * elapsed1; stat[i].count += factor; @@ -4096,14 +4140,16 @@ #define WEIGHT_ADD(delta) \ do { \ - if (!In_Assert::asserting()) \ + if (!In_Assert::asserting()) { \ Weightwatch_Traits::weight += delta; \ + } \ } while (false) #define WEIGHT_ADD_MUL(delta, factor) \ do { \ - if (!In_Assert::asserting()) \ + if (!In_Assert::asserting()) { \ Weightwatch_Traits::weight += delta * factor; \ + } \ } while (false) #endif // !defined(NDEBUG) @@ -4617,10 +4663,11 @@ inline Weightwatch_Traits::Delta Weightwatch_Traits::compute_delta(unsigned long unscaled, unsigned scale) { - if ((std::numeric_limits::max() >> scale) < unscaled) + if ((std::numeric_limits::max() >> scale) < unscaled) { throw std::invalid_argument("PPL::Weightwatch_Traits::" "compute_delta(u, s):\n" "values of u and s cause wrap around."); + } return static_cast(unscaled) << scale; } @@ -4629,20 +4676,19 @@ threshold = weight + delta; } -inline -Throwable::~Throwable() { -} - inline void maybe_abandon() { #ifndef NDEBUG - if (In_Assert::asserting()) + if (In_Assert::asserting()) { return; + } #endif - if (Weightwatch_Traits::check_function != 0) + if (Weightwatch_Traits::check_function != 0) { Weightwatch_Traits::check_function(); - if (const Throwable* const p = abandon_expensive_computations) + } + if (const Throwable* const p = abandon_expensive_computations) { p->throw_me(); + } } inline dimension_type @@ -4697,17 +4743,20 @@ inline void ascii_dump(std::ostream& s, Representation r) { - if (r == DENSE) + if (r == DENSE) { s << "DENSE"; - else + } + else { s << "SPARSE"; + } } inline bool ascii_load(std::istream& is, Representation& r) { std::string s; - if (!(is >> s)) + if (!(is >> s)) { return false; + } if (s == "DENSE") { r = DENSE; @@ -4746,7 +4795,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/globals_defs.hh line 568. */ +/* Automatically generated from PPL source file ../src/globals_defs.hh line 570. */ /* Automatically generated from PPL source file ../src/Variable_inlines.hh line 28. */ #include @@ -5386,8 +5435,9 @@ template inline const C& Linear_Form::coefficient(Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { return zero; + } return vec[v.id()+1]; } @@ -5507,13 +5557,15 @@ Linear_Form::ascii_load(std::istream& s) { using namespace IO_Operators; dimension_type new_dim; - if (!(s >> new_dim)) + if (!(s >> new_dim)) { return false; + } vec.resize(new_dim + 1, zero); for (dimension_type i = 0; i <= new_dim; ++i) { - if (!(s >> vec[i])) + if (!(s >> vec[i])) { return false; + } } PPL_ASSERT(OK()); @@ -5524,12 +5576,13 @@ template inline bool Linear_Form::overflows() const { - if (!inhomogeneous_term().is_bounded()) + if (!inhomogeneous_term().is_bounded()) { return true; - + } for (dimension_type i = space_dimension(); i-- > 0; ) { - if (!coefficient(Variable(i)).is_bounded()) + if (!coefficient(Variable(i)).is_bounded()) { return true; + } } return false; @@ -5548,15 +5601,18 @@ // Linear_Form_templates.hh is not included here on purpose. /* Automatically generated from PPL source file ../src/Float_inlines.hh line 30. */ +#include namespace Parma_Polyhedra_Library { inline int float_ieee754_half::inf_sign() const { - if (word == NEG_INF) + if (word == NEG_INF) { return -1; - if (word == POS_INF) + } + if (word == POS_INF) { return 1; + } return 0; } @@ -5567,10 +5623,12 @@ inline int float_ieee754_half::zero_sign() const { - if (word == NEG_ZERO) + if (word == NEG_ZERO) { return -1; - if (word == POS_ZERO) + } + if (word == POS_ZERO) { return 1; + } return 0; } @@ -5597,16 +5655,18 @@ inline void float_ieee754_half::set_max(bool negative) { word = WRD_MAX; - if (negative) + if (negative) { word |= SGN_MASK; + } } inline void float_ieee754_half::build(bool negative, mpz_t mantissa, int exponent) { word = static_cast(mpz_get_ui(mantissa) & ((1UL << MANTISSA_BITS) - 1)); - if (negative) + if (negative) { word |= SGN_MASK; + } const int exponent_repr = exponent + EXPONENT_BIAS; PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS)); word |= static_cast(exponent_repr) << MANTISSA_BITS; @@ -5614,10 +5674,12 @@ inline int float_ieee754_single::inf_sign() const { - if (word == NEG_INF) + if (word == NEG_INF) { return -1; - if (word == POS_INF) + } + if (word == POS_INF) { return 1; + } return 0; } @@ -5628,10 +5690,12 @@ inline int float_ieee754_single::zero_sign() const { - if (word == NEG_ZERO) + if (word == NEG_ZERO) { return -1; - if (word == POS_ZERO) + } + if (word == POS_ZERO) { return 1; + } return 0; } @@ -5658,16 +5722,18 @@ inline void float_ieee754_single::set_max(bool negative) { word = WRD_MAX; - if (negative) + if (negative) { word |= SGN_MASK; + } } inline void float_ieee754_single::build(bool negative, mpz_t mantissa, int exponent) { word = static_cast(mpz_get_ui(mantissa) & ((1UL << MANTISSA_BITS) - 1)); - if (negative) + if (negative) { word |= SGN_MASK; + } const int exponent_repr = exponent + EXPONENT_BIAS; PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS)); word |= static_cast(exponent_repr) << MANTISSA_BITS; @@ -5675,12 +5741,15 @@ inline int float_ieee754_double::inf_sign() const { - if (lsp != LSP_INF) + if (lsp != LSP_INF) { return 0; - if (msp == MSP_NEG_INF) + } + if (msp == MSP_NEG_INF) { return -1; - if (msp == MSP_POS_INF) + } + if (msp == MSP_POS_INF) { return 1; + } return 0; } @@ -5692,12 +5761,15 @@ inline int float_ieee754_double::zero_sign() const { - if (lsp != LSP_ZERO) + if (lsp != LSP_ZERO) { return 0; - if (msp == MSP_NEG_ZERO) + } + if (msp == MSP_NEG_ZERO) { return -1; - if (msp == MSP_POS_ZERO) + } + if (msp == MSP_POS_ZERO) { return 1; + } return 0; } @@ -5717,8 +5789,9 @@ --msp; lsp = LSP_MAX; } - else + else { --lsp; + } } inline void @@ -5727,16 +5800,18 @@ ++msp; lsp = 0; } - else + else { ++lsp; + } } inline void float_ieee754_double::set_max(bool negative) { msp = MSP_MAX; lsp = LSP_MAX; - if (negative) + if (negative) { msp |= MSP_SGN_MASK; + } } inline void @@ -5752,8 +5827,9 @@ m >>= 32; #endif msp = static_cast(m & ((1UL << (MANTISSA_BITS - 32)) - 1)); - if (negative) + if (negative) { msp |= MSP_SGN_MASK; + } const int exponent_repr = exponent + EXPONENT_BIAS; PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS)); msp |= static_cast(exponent_repr) << (MANTISSA_BITS - 32); @@ -5761,10 +5837,12 @@ inline int float_ibm_single::inf_sign() const { - if (word == NEG_INF) + if (word == NEG_INF) { return -1; - if (word == POS_INF) + } + if (word == POS_INF) { return 1; + } return 0; } @@ -5775,10 +5853,12 @@ inline int float_ibm_single::zero_sign() const { - if (word == NEG_ZERO) + if (word == NEG_ZERO) { return -1; - if (word == POS_ZERO) + } + if (word == POS_ZERO) { return 1; + } return 0; } @@ -5805,16 +5885,18 @@ inline void float_ibm_single::set_max(bool negative) { word = WRD_MAX; - if (negative) + if (negative) { word |= SGN_MASK; + } } inline void float_ibm_single::build(bool negative, mpz_t mantissa, int exponent) { word = static_cast(mpz_get_ui(mantissa) & ((1UL << MANTISSA_BITS) - 1)); - if (negative) + if (negative) { word |= SGN_MASK; + } const int exponent_repr = exponent + EXPONENT_BIAS; PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS)); word |= static_cast(exponent_repr) << MANTISSA_BITS; @@ -5822,13 +5904,16 @@ inline int float_intel_double_extended::inf_sign() const { - if (lsp != LSP_INF) + if (lsp != LSP_INF) { return 0; + } const uint32_t a = msp & MSP_NEG_INF; - if (a == MSP_NEG_INF) + if (a == MSP_NEG_INF) { return -1; - if (a == MSP_POS_INF) + } + if (a == MSP_POS_INF) { return 1; + } return 0; } @@ -5840,13 +5925,16 @@ inline int float_intel_double_extended::zero_sign() const { - if (lsp != LSP_ZERO) + if (lsp != LSP_ZERO) { return 0; + } const uint32_t a = msp & MSP_NEG_INF; - if (a == MSP_NEG_ZERO) + if (a == MSP_NEG_ZERO) { return -1; - if (a == MSP_POS_ZERO) + } + if (a == MSP_POS_ZERO) { return 1; + } return 0; } @@ -5866,8 +5954,9 @@ --msp; lsp = ((msp & MSP_NEG_INF) == 0) ? LSP_DMAX : LSP_NMAX; } - else + else { --lsp; + } } inline void @@ -5876,16 +5965,18 @@ ++msp; lsp = LSP_DMAX + 1; } - else + else { ++lsp; + } } inline void float_intel_double_extended::set_max(bool negative) { msp = MSP_MAX; lsp = LSP_NMAX; - if (negative) + if (negative) { msp |= MSP_SGN_MASK; + } } inline void @@ -5904,12 +5995,15 @@ inline int float_ieee754_quad::inf_sign() const { - if (lsp != LSP_INF) + if (lsp != LSP_INF) { return 0; - if (msp == MSP_NEG_INF) + } + if (msp == MSP_NEG_INF) { return -1; - if (msp == MSP_POS_INF) + } + if (msp == MSP_POS_INF) { return 1; + } return 0; } @@ -5921,12 +6015,15 @@ inline int float_ieee754_quad::zero_sign() const { - if (lsp != LSP_ZERO) + if (lsp != LSP_ZERO) { return 0; - if (msp == MSP_NEG_ZERO) + } + if (msp == MSP_NEG_ZERO) { return -1; - if (msp == MSP_POS_ZERO) + } + if (msp == MSP_POS_ZERO) { return 1; + } return 0; } @@ -5946,8 +6043,9 @@ --msp; lsp = LSP_MAX; } - else + else { --lsp; + } } inline void @@ -5956,16 +6054,18 @@ ++msp; lsp = 0; } - else + else { ++lsp; + } } inline void float_ieee754_quad::set_max(bool negative) { msp = MSP_MAX; lsp = LSP_MAX; - if (negative) + if (negative) { msp |= MSP_SGN_MASK; + } } inline void @@ -5975,8 +6075,9 @@ lsp = parts[0]; msp = parts[1]; msp &= ((static_cast(1) << (MANTISSA_BITS - 64)) - 1); - if (negative) + if (negative) { msp |= MSP_SGN_MASK; + } const int exponent_repr = exponent + EXPONENT_BIAS; PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS)); msp |= static_cast(exponent_repr) << (MANTISSA_BITS - 64); @@ -6087,17 +6188,18 @@ unsigned int f_mantissa_bits; switch (analyzed_format) { case IEEE754_HALF: - if (ieee754_half_result != ZERO_INTERVAL) + if (ieee754_half_result != ZERO_INTERVAL) { return ieee754_half_result; - + } to_compute = &ieee754_half_result; f_base = float_ieee754_half::BASE; f_exponent_bias = float_ieee754_half::EXPONENT_BIAS; f_mantissa_bits = float_ieee754_half::MANTISSA_BITS; break; case IEEE754_SINGLE: - if (ieee754_single_result != ZERO_INTERVAL) + if (ieee754_single_result != ZERO_INTERVAL) { return ieee754_single_result; + } to_compute = &ieee754_single_result; f_base = float_ieee754_single::BASE; @@ -6105,8 +6207,9 @@ f_mantissa_bits = float_ieee754_single::MANTISSA_BITS; break; case IEEE754_DOUBLE: - if (ieee754_double_result != ZERO_INTERVAL) + if (ieee754_double_result != ZERO_INTERVAL) { return ieee754_double_result; + } to_compute = &ieee754_double_result; f_base = float_ieee754_double::BASE; @@ -6114,8 +6217,9 @@ f_mantissa_bits = float_ieee754_double::MANTISSA_BITS; break; case IBM_SINGLE: - if (ibm_single_result != ZERO_INTERVAL) + if (ibm_single_result != ZERO_INTERVAL) { return ibm_single_result; + } to_compute = &ibm_single_result; f_base = float_ibm_single::BASE; @@ -6123,8 +6227,9 @@ f_mantissa_bits = float_ibm_single::MANTISSA_BITS; break; case IEEE754_QUAD: - if (ieee754_quad_result != ZERO_INTERVAL) + if (ieee754_quad_result != ZERO_INTERVAL) { return ieee754_quad_result; + } to_compute = &ieee754_quad_result; f_base = float_ieee754_quad::BASE; @@ -6132,8 +6237,9 @@ f_mantissa_bits = float_ieee754_quad::MANTISSA_BITS; break; case INTEL_DOUBLE_EXTENDED: - if (intel_double_extended_result != ZERO_INTERVAL) + if (intel_double_extended_result != ZERO_INTERVAL) { return intel_double_extended_result; + } to_compute = &intel_double_extended_result; f_base = float_intel_double_extended::BASE; @@ -6167,10 +6273,12 @@ typedef Linear_Form FP_Linear_Form; typedef typename std::map::iterator Iter; for (Iter i = lf_store.begin(); i != lf_store.end(); ) { - if((i->second).coefficient(var) != 0) + if ((i->second).coefficient(var) != 0) { i = lf_store.erase(i); - else + } + else { ++i; + } } } @@ -6189,18 +6297,23 @@ Const_Iter i2_end = ls2.end(); for (Iter i1 = ls1.begin(), i1_end = ls1.end(); i1 != i1_end; ) { Const_Iter i2 = ls2.find(i1->first); - if ((i2 == i2_end) || (i1->second != i2->second)) + if ((i2 == i2_end) || (i1->second != i2->second)) { i1 = ls1.erase(i1); - else + } + else { ++i1; + } } } } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Float_defs.hh line 522. */ +/* Automatically generated from PPL source file ../src/Float_defs.hh line 521. */ -/* Automatically generated from PPL source file ../src/checked_defs.hh line 35. */ +/* Automatically generated from PPL source file ../src/checked_defs.hh line 32. */ +#include +#include +#include namespace Parma_Polyhedra_Library { @@ -7093,7 +7206,7 @@ template struct PPL_FUNCTION_CLASS(construct) { static inline Result function(Type& to, const Type& from, Rounding_Dir) { - new (&to) Type(from); + new(&to) Type(from); return V_EQ; } }; @@ -7101,7 +7214,7 @@ template struct PPL_FUNCTION_CLASS(construct) { static inline Result function(To& to, const From& from, Rounding_Dir dir) { - new (&to) To(); + new(&to) To(); return assign(to, from, dir); } }; @@ -7109,7 +7222,7 @@ template struct PPL_FUNCTION_CLASS(construct_special) { static inline Result function(To& to, Result_Class r, Rounding_Dir dir) { - new (&to) To(); + new(&to) To(); return assign_special(to, r, dir); } }; @@ -7130,10 +7243,12 @@ template inline Result abs_generic(To& to, const From& from, Rounding_Dir dir) { - if (from < 0) + if (from < 0) { return neg(to, from, dir); - else + } + else { return assign(to, from, dir); + } } template (to, x, dir); } @@ -7197,13 +7314,15 @@ Result r; r = abs(to, x, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } From2 a_y; r = abs(a_y, y, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } // If PPL_MATCH_GMP_GCDEXT is defined then s is favored when the absolute // values of the given numbers are equal. For instance if x and y @@ -7211,8 +7330,9 @@ // way round. This is to match the behavior of GMP. #define PPL_MATCH_GMP_GCDEXT 1 #ifdef PPL_MATCH_GMP_GCDEXT - if (to == a_y) + if (to == a_y) { goto sign_check; + } #endif { @@ -7228,8 +7348,9 @@ s = v1; t = v2; to = v3; - if (t3 == 0) + if (t3 == 0) { break; + } v1 = t1; v2 = t2; v3 = t3; @@ -7241,11 +7362,13 @@ #endif if (negative_x) { r = neg(s, s, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } } - if (negative_y) + if (negative_y) { return neg(t, t, dir); + } return V_EQ; #undef PPL_MATCH_GMP_GCDEXT } @@ -7262,11 +7385,13 @@ To a_y; Result r; r = abs(a_x, x, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } r = abs(a_y, y, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } To gcd; gcd_exact_no_abs(gcd, a_x, a_y); // The following is derived from the assumption that a_x / gcd(a_x, a_y) @@ -7279,10 +7404,12 @@ template inline Result_Relation sgn_generic(const Type& x) { - if (x > 0) + if (x > 0) { return VR_GT; - if (x == 0) + } + if (x == 0) { return VR_EQ; + } return VR_LT; } @@ -7394,8 +7521,9 @@ lt(const T1& x, const T2& y) { PPL_DIRTY_TEMP(T1, tmp); Result r = assign_r(tmp, y, ROUND_UP); - if (!result_representable(r)) + if (!result_representable(r)) { return true; + } switch (result_relation(r)) { case VR_EQ: case VR_LT: @@ -7419,8 +7547,9 @@ // code this in checked_float_inlines.hh, probably it's faster also // if fpu supports inexact check. PPL_ASSERT(r != V_LE && r != V_GE && r != V_LGE); - if (!result_representable(r)) + if (!result_representable(r)) { return true; + } switch (result_relation(r)) { case VR_EQ: return x <= tmp; @@ -7462,10 +7591,12 @@ typename Type1, typename Type2> inline Result_Relation cmp_generic(const Type1& x, const Type2& y) { - if (lt(y, x)) + if (lt(y, x)) { return VR_GT; - if (lt(x, y)) + } + if (lt(x, y)) { return VR_LT; + } return VR_EQ; } @@ -7677,21 +7808,27 @@ classify_int(const Type v, bool nan, bool inf, bool sign) { if (Policy::has_nan && (nan || sign) - && v == Extended_Int::not_a_number) + && v == Extended_Int::not_a_number) { return V_NAN; - if (!inf && !sign) + } + if (!inf && !sign) { return V_LGE; + } if (Policy::has_infinity) { - if (v == Extended_Int::minus_infinity) + if (v == Extended_Int::minus_infinity) { return inf ? V_EQ_MINUS_INFINITY : V_LT; - if (v == Extended_Int::plus_infinity) + } + if (v == Extended_Int::plus_infinity) { return inf ? V_EQ_PLUS_INFINITY : V_GT; + } } if (sign) { - if (v < 0) + if (v < 0) { return V_LT; - if (v > 0) + } + if (v > 0) { return V_GT; + } return V_EQ; } return V_LGE; @@ -7837,16 +7974,18 @@ assign_signed_int_signed_int(To& to, const From from, Rounding_Dir dir) { if (sizeof(To) < sizeof(From) || (sizeof(To) == sizeof(From) - && (Extended_Int::min > Extended_Int::min - || Extended_Int::max < Extended_Int::max))) { + && (Extended_Int::min > Extended_Int::min + || Extended_Int::max < Extended_Int::max))) { if (CHECK_P(To_Policy::check_overflow, PPL_LT_SILENT(from, - static_cast(Extended_Int::min)))) + static_cast(Extended_Int::min)))) { return set_neg_overflow_int(to, dir); + } if (CHECK_P(To_Policy::check_overflow, PPL_GT_SILENT(from, - static_cast(Extended_Int::max)))) + static_cast(Extended_Int::max)))) { return set_pos_overflow_int(to, dir); + } } to = static_cast(from); return V_EQ; @@ -7857,8 +7996,9 @@ assign_signed_int_unsigned_int(To& to, const From from, Rounding_Dir dir) { if (sizeof(To) <= sizeof(From)) { if (CHECK_P(To_Policy::check_overflow, - from > static_cast(Extended_Int::max))) + from > static_cast(Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } } to = static_cast(from); return V_EQ; @@ -7867,12 +8007,14 @@ template inline Result assign_unsigned_int_signed_int(To& to, const From from, Rounding_Dir dir) { - if (CHECK_P(To_Policy::check_overflow, from < 0)) + if (CHECK_P(To_Policy::check_overflow, from < 0)) { return set_neg_overflow_int(to, dir); + } if (sizeof(To) < sizeof(From)) { if (CHECK_P(To_Policy::check_overflow, - from > static_cast(Extended_Int::max))) + from > static_cast(Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } } to = static_cast(from); return V_EQ; @@ -7883,11 +8025,12 @@ assign_unsigned_int_unsigned_int(To& to, const From from, Rounding_Dir dir) { if (sizeof(To) < sizeof(From) || (sizeof(To) == sizeof(From) - && Extended_Int::max < Extended_Int::max)) { + && Extended_Int::max < Extended_Int::max)) { if (CHECK_P(To_Policy::check_overflow, PPL_GT_SILENT(from, - static_cast(Extended_Int::max)))) + static_cast(Extended_Int::max)))) { return set_pos_overflow_int(to, dir); + } } to = static_cast(from); return V_EQ; @@ -8008,25 +8151,36 @@ template inline Result assign_int_float(To& to, const From from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } #if 0 // FIXME: this is correct but it is inefficient and breaks the build // for the missing definition of static const members (a problem present // also in other areas of the PPL). - if (CHECK_P(To_Policy::check_overflow, lt(from, Extended_Int::min))) + if (CHECK_P(To_Policy::check_overflow, + lt(from, Extended_Int::min))) { return set_neg_overflow_int(to, dir); - if (CHECK_P(To_Policy::check_overflow, !le(from, Extended_Int::max))) + } + if (CHECK_P(To_Policy::check_overflow, + !le(from, Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } #else - if (CHECK_P(To_Policy::check_overflow, (from < Extended_Int::min))) + if (CHECK_P(To_Policy::check_overflow, + (from < Extended_Int::min))) { return set_neg_overflow_int(to, dir); - if (CHECK_P(To_Policy::check_overflow, (from > Extended_Int::max))) + } + if (CHECK_P(To_Policy::check_overflow, + (from > Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } #endif if (round_not_requested(dir)) { to = from; @@ -8034,14 +8188,18 @@ } From i_from = rint(from); to = i_from; - if (from == i_from) + if (from == i_from) { return V_EQ; - if (round_direct(ROUND_UP)) + } + if (round_direct(ROUND_UP)) { return round_lt_int(to, dir); - if (round_direct(ROUND_DOWN)) + } + if (round_direct(ROUND_DOWN)) { return round_gt_int(to, dir); - if (from < i_from) + } + if (from < i_from) { return round_lt_int(to, dir); + } PPL_ASSERT(from > i_from); return round_gt_int(to, dir); } @@ -8099,10 +8257,12 @@ } if (from.fits_slong_p()) { signed long v = from.get_si(); - if (PPL_LT_SILENT(v, (Extended_Int::min))) + if (PPL_LT_SILENT(v, (Extended_Int::min))) { return set_neg_overflow_int(to, dir); - if (PPL_GT_SILENT(v, (Extended_Int::max))) + } + if (PPL_GT_SILENT(v, (Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } to = v; return V_EQ; } @@ -8118,8 +8278,9 @@ To v; mpz_export(&v, 0, -1, sizeof(To), 0, 0, m); if (v >= 0) { - if (::sgn(from) < 0) + if (::sgn(from) < 0) { return neg(to, v, dir); + } to = v; return V_EQ; } @@ -8142,8 +8303,9 @@ template inline Result assign_unsigned_int_mpz(To& to, const mpz_class& from, Rounding_Dir dir) { - if (CHECK_P(To_Policy::check_overflow, ::sgn(from) < 0)) + if (CHECK_P(To_Policy::check_overflow, ::sgn(from) < 0)) { return set_neg_overflow_int(to, dir); + } if (sizeof(To) <= sizeof(unsigned long)) { if (!To_Policy::check_overflow) { to = static_cast(from.get_ui()); @@ -8151,8 +8313,9 @@ } if (from.fits_ulong_p()) { const unsigned long v = from.get_ui(); - if (PPL_GT_SILENT(v, (Extended_Int::max))) + if (PPL_GT_SILENT(v, (Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } to = static_cast(v); return V_EQ; } @@ -8161,10 +8324,12 @@ const mpz_srcptr m = from.get_mpz_t(); const size_t sz = mpz_size(m); if (sz <= sizeof(To) / sizeof(mp_limb_t)) { - if (sz == 0) + if (sz == 0) { to = 0; - else + } + else { mpz_export(&to, 0, -1, sizeof(To), 0, 0, m); + } return V_EQ; } } @@ -8190,8 +8355,9 @@ if (round_not_requested(dir)) { mpz_tdiv_q(q_z, n, d); Result r = assign(to, q, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } return V_LGE; } mpz_t rem; @@ -8201,8 +8367,9 @@ sign = mpz_sgn(rem); mpz_clear(rem); Result r = assign(to, q, dir); - if (r != V_EQ) + if (r != V_EQ) { return r; + } switch (sign) { case -1: return round_lt_int(to, dir); @@ -8441,11 +8608,13 @@ template inline Result neg_signed_int(Type& to, const Type from, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_neg) + if (To_Policy::check_overflow && Larger::use_for_neg) { return neg_int_larger(to, from, dir); + } if (CHECK_P(To_Policy::check_overflow, - (from < -Extended_Int::max))) + (from < -Extended_Int::max))) { return set_pos_overflow_int(to, dir); + } to = -from; return V_EQ; } @@ -8453,10 +8622,12 @@ template inline Result neg_unsigned_int(Type& to, const Type from, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_neg) + if (To_Policy::check_overflow && Larger::use_for_neg) { return neg_int_larger(to, from, dir); - if (CHECK_P(To_Policy::check_overflow, from != 0)) + } + if (CHECK_P(To_Policy::check_overflow, from != 0)) { return set_neg_overflow_int(to, dir); + } to = from; return V_EQ; } @@ -8465,15 +8636,18 @@ typename Type> inline Result add_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_add) + if (To_Policy::check_overflow && Larger::use_for_add) { return add_int_larger(to, x, y, dir); + } if (To_Policy::check_overflow) { if (y >= 0) { - if (x > Extended_Int::max - y) + if (x > Extended_Int::max - y) { return set_pos_overflow_int(to, dir); + } } - else if (x < Extended_Int::min - y) + else if (x < Extended_Int::min - y) { return set_neg_overflow_int(to, dir); + } } to = x + y; return V_EQ; @@ -8483,11 +8657,13 @@ typename Type> inline Result add_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_add) + if (To_Policy::check_overflow && Larger::use_for_add) { return add_int_larger(to, x, y, dir); + } if (CHECK_P(To_Policy::check_overflow, - (x > Extended_Int::max - y))) + (x > Extended_Int::max - y))) { return set_pos_overflow_int(to, dir); + } to = x + y; return V_EQ; } @@ -8496,15 +8672,18 @@ typename Type> inline Result sub_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_sub) + if (To_Policy::check_overflow && Larger::use_for_sub) { return sub_int_larger(to, x, y, dir); + } if (To_Policy::check_overflow) { if (y >= 0) { - if (x < Extended_Int::min + y) + if (x < Extended_Int::min + y) { return set_neg_overflow_int(to, dir); + } } - else if (x > Extended_Int::max + y) + else if (x > Extended_Int::max + y) { return set_pos_overflow_int(to, dir); + } } to = x - y; return V_EQ; @@ -8514,11 +8693,13 @@ typename Type> inline Result sub_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_sub) + if (To_Policy::check_overflow && Larger::use_for_sub) { return sub_int_larger(to, x, y, dir); + } if (CHECK_P(To_Policy::check_overflow, - (x < Extended_Int::min + y))) + (x < Extended_Int::min + y))) { return set_neg_overflow_int(to, dir); + } to = x - y; return V_EQ; } @@ -8527,8 +8708,9 @@ typename Type> inline Result mul_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_mul) + if (To_Policy::check_overflow && Larger::use_for_mul) { return mul_int_larger(to, x, y, dir); + } if (!To_Policy::check_overflow) { to = x * y; return V_EQ; @@ -8537,26 +8719,31 @@ to = 0; return V_EQ; } - if (y == -1) + if (y == -1) { return neg_signed_int(to, x, dir); + } if (x >= 0) { if (y > 0) { - if (x > Extended_Int::max / y) + if (x > Extended_Int::max / y) { return set_pos_overflow_int(to, dir); + } } else { - if (x > Extended_Int::min / y) + if (x > Extended_Int::min / y) { return set_neg_overflow_int(to, dir); + } } } else { if (y < 0) { - if (x < Extended_Int::max / y) + if (x < Extended_Int::max / y) { return set_pos_overflow_int(to, dir); + } } else { - if (x < Extended_Int::min / y) + if (x < Extended_Int::min / y) { return set_neg_overflow_int(to, dir); + } } } to = x * y; @@ -8567,8 +8754,9 @@ typename Type> inline Result mul_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir dir) { - if (To_Policy::check_overflow && Larger::use_for_mul) + if (To_Policy::check_overflow && Larger::use_for_mul) { return mul_int_larger(to, x, y, dir); + } if (!To_Policy::check_overflow) { to = x * y; return V_EQ; @@ -8577,8 +8765,9 @@ to = 0; return V_EQ; } - if (x > Extended_Int::max / y) + if (x > Extended_Int::max / y) { return set_pos_overflow_int(to, dir); + } to = x * y; return V_EQ; } @@ -8590,20 +8779,26 @@ if (CHECK_P(To_Policy::check_div_zero, y == 0)) { return assign_nan(to, V_DIV_ZERO); } - if (To_Policy::check_overflow && y == -1) + if (To_Policy::check_overflow && y == -1) { return neg_signed_int(to, x, dir); + } to = x / y; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_LGE; - if (y == -1) + } + if (y == -1) { return V_EQ; + } Type m = x % y; - if (m < 0) + if (m < 0) { return round_lt_int_no_overflow(to, dir); - else if (m > 0) + } + else if (m > 0) { return round_gt_int_no_overflow(to, dir); - else + } + else { return V_EQ; + } } template (to, V_DIV_ZERO); } to = x / y; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; + } Type m = x % y; - if (m == 0) + if (m == 0) { return V_EQ; + } return round_gt_int(to, dir); } @@ -8629,8 +8826,9 @@ if (CHECK_P(To_Policy::check_div_zero, y == 0)) { return assign_nan(to, V_DIV_ZERO); } - if (To_Policy::check_overflow && y == -1) + if (To_Policy::check_overflow && y == -1) { return neg_signed_int(to, x, dir); + } to = x / y; return V_EQ; } @@ -8674,19 +8872,24 @@ Rounding_Dir dir) { if (exp >= sizeof_to_bits(sizeof(Type))) { to = 0; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; - if (x == 0) + } + if (x == 0) { return V_EQ; + } return round_gt_int_no_overflow(to, dir); } to = x >> exp; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; - if (x & ((Type(1) << exp) - 1)) + } + if (x & ((Type(1) << exp) - 1)) { return round_gt_int_no_overflow(to, dir); - else + } + else { return V_EQ; + } } template @@ -8696,36 +8899,44 @@ if (x < 0) { if (exp >= sizeof_to_bits(sizeof(Type))) { to = 0; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_LE; + } return round_lt_int_no_overflow(to, dir); } typedef typename C_Integer::other_type UType; UType ux = x; ux = -ux; to = ~Type(~-(ux >> exp)); - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_LE; - if (ux & ((UType(1) << exp) -1)) + } + if (ux & ((UType(1) << exp) -1)) { return round_lt_int_no_overflow(to, dir); + } return V_EQ; } else { if (exp >= sizeof_to_bits(sizeof(Type)) - 1) { to = 0; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; - if (x == 0) + } + if (x == 0) { return V_EQ; + } return round_gt_int_no_overflow(to, dir); } to = x >> exp; - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; - if (x & ((Type(1) << exp) - 1)) + } + if (x & ((Type(1) << exp) - 1)) { return round_gt_int_no_overflow(to, dir); - else + } + else { return V_EQ; + } } } @@ -8737,8 +8948,9 @@ to = x + (Type(1) << exp); return V_EQ; } - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { return set_pos_overflow_int(to, dir); + } Type n = Type(1) << exp; return add_unsigned_int(to, x, n, dir); } @@ -8751,8 +8963,9 @@ to = x + (Type(1) << exp); return V_EQ; } - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { return set_pos_overflow_int(to, dir); + } if (exp == sizeof_to_bits(sizeof(Type)) - 1) { Type n = -2 * (Type(1) << (exp - 1)); return sub_signed_int(to, x, n, dir); @@ -8771,8 +8984,9 @@ to = x - (Type(1) << exp); return V_EQ; } - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { return set_neg_overflow_int(to, dir); + } Type n = Type(1) << exp; return sub_unsigned_int(to, x, n, dir); } @@ -8785,8 +8999,9 @@ to = x - (Type(1) << exp); return V_EQ; } - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { return set_neg_overflow_int(to, dir); + } if (exp == sizeof_to_bits(sizeof(Type)) - 1) { Type n = -2 * (Type(1) << (exp - 1)); return add_signed_int(to, x, n, dir); @@ -8812,8 +9027,9 @@ } return set_pos_overflow_int(to, dir); } - if (x > Extended_Int::max >> exp) + if (x > Extended_Int::max >> exp) { return set_pos_overflow_int(to, dir); + } to = x << exp; return V_EQ; } @@ -8827,17 +9043,20 @@ to = x * (Type(1) << exp); return V_EQ; } - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { return set_neg_overflow_int(to, dir); + } typedef typename C_Integer::other_type UType; UType mask = UType(-1) << (sizeof_to_bits(sizeof(Type)) - exp - 1); UType ux = x; - if ((ux & mask) != mask) + if ((ux & mask) != mask) { return set_neg_overflow_int(to, dir); + } ux <<= exp; Type n = ~(Type(~ux)); - if (PPL_LT_SILENT(n, (Extended_Int::min))) + if (PPL_LT_SILENT(n, (Extended_Int::min))) { return set_neg_overflow_int(to, dir); + } to = n; } else { @@ -8852,8 +9071,9 @@ } return set_pos_overflow_int(to, dir); } - if (x > Extended_Int::max >> exp) + if (x > Extended_Int::max >> exp) { return set_pos_overflow_int(to, dir); + } to = x << exp; } return V_EQ; @@ -8863,14 +9083,17 @@ inline Result smod_2exp_unsigned_int(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (exp > sizeof_to_bits(sizeof(Type))) + if (exp > sizeof_to_bits(sizeof(Type))) { to = x; + } else { Type v = (exp == sizeof_to_bits(sizeof(Type)) ? x : (x & ((Type(1) << exp) - 1))); - if (v >= (Type(1) << (exp - 1))) + if (v >= (Type(1) << (exp - 1))) { return set_neg_overflow_int(to, dir); - else + } + else { to = v; + } } return V_EQ; } @@ -8879,8 +9102,9 @@ inline Result smod_2exp_signed_int(Type& to, const Type x, unsigned int exp, Rounding_Dir) { - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { to = x; + } else { Type m = Type(1) << (exp - 1); to = (x & (m - 1)) - (x & m); @@ -8892,10 +9116,12 @@ inline Result umod_2exp_unsigned_int(Type& to, const Type x, unsigned int exp, Rounding_Dir) { - if (exp >= sizeof_to_bits(sizeof(Type))) + if (exp >= sizeof_to_bits(sizeof(Type))) { to = x; - else + } + else { to = x & ((Type(1) << exp) - 1); + } return V_EQ; } @@ -8904,12 +9130,14 @@ umod_2exp_signed_int(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { if (exp >= sizeof_to_bits(sizeof(Type))) { - if (x < 0) + if (x < 0) { return set_pos_overflow_int(to, dir); + } to = x; } - else + else { to = x & ((Type(1) << exp) - 1); + } return V_EQ; } @@ -8934,10 +9162,12 @@ sqrt_unsigned_int(Type& to, const Type from, Rounding_Dir dir) { Type rem; isqrt_rem(to, rem, from); - if (round_not_requested(dir)) + if (round_not_requested(dir)) { return V_GE; - if (rem == 0) + } + if (rem == 0) { return V_EQ; + } return round_gt_int(to, dir); } @@ -8960,12 +9190,14 @@ case 0: return add(to, to, z, dir); case -1: - if (to <= 0) + if (to <= 0) { return set_neg_overflow_int(to, dir); + } return assign_nan(to, V_UNKNOWN_NEG_OVERFLOW); case 1: - if (to >= 0) + if (to >= 0) { return set_pos_overflow_int(to, dir); + } return assign_nan(to, V_UNKNOWN_POS_OVERFLOW); default: PPL_UNREACHABLE; @@ -8983,12 +9215,14 @@ case 0: return sub(to, to, z, dir); case -1: - if (to >= 0) + if (to >= 0) { return set_pos_overflow_int(to, dir); + } return assign_nan(to, V_UNKNOWN_NEG_OVERFLOW); case 1: - if (to <= 0) + if (to <= 0) { return set_neg_overflow_int(to, dir); + } return assign_nan(to, V_UNKNOWN_POS_OVERFLOW); default: PPL_UNREACHABLE; @@ -9329,17 +9563,39 @@ PPL_SPECIALIZE_GCD(gcd_exact, unsigned long, unsigned long, unsigned long) PPL_SPECIALIZE_GCD(gcd_exact, unsigned long long, unsigned long long, unsigned long long) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, char, char, char, char, char) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, signed char, signed char, signed char, signed char, signed char) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, signed short, signed short, signed short, signed short, signed short) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, signed int, signed int, signed int, signed int, signed int) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, signed long, signed long, signed long, signed long, signed long) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, signed long long, signed long long, signed long long, signed long long, signed long long) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) -PPL_SPECIALIZE_GCDEXT(gcdext_exact, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + char, char, char, char, char) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + signed char, signed char, signed char, + signed char, signed char) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + signed short, signed short, signed short, + signed short, signed short) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + signed int, signed int, signed int, + signed int, signed int) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + signed long, signed long, signed long, + signed long, signed long) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + signed long long, signed long long, signed long long, + signed long long, signed long long) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + unsigned char, unsigned char, unsigned char, + unsigned char, unsigned char) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + unsigned short, unsigned short, unsigned short, + unsigned short, unsigned short) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + unsigned long, unsigned long, unsigned long, + unsigned long, unsigned long) +PPL_SPECIALIZE_GCDEXT(gcdext_exact, + unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long) PPL_SPECIALIZE_LCM(lcm_gcd_exact, char, char, char) PPL_SPECIALIZE_LCM(lcm_gcd_exact, signed char, signed char, signed char) @@ -9558,24 +9814,30 @@ inline Result classify_float(const T v, bool nan, bool inf, bool sign) { Float f(v); - if ((nan || sign) && CHECK_P(Policy::has_nan, f.u.binary.is_nan())) + if ((nan || sign) && CHECK_P(Policy::has_nan, f.u.binary.is_nan())) { return V_NAN; + } if (inf) { if (Policy::has_infinity) { int sign_inf = f.u.binary.inf_sign(); - if (sign_inf < 0) + if (sign_inf < 0) { return V_EQ_MINUS_INFINITY; - if (sign_inf > 0) + } + if (sign_inf > 0) { return V_EQ_PLUS_INFINITY; + } } - else + else { PPL_ASSERT(f.u.binary.inf_sign() == 0); + } } if (sign) { - if (v < 0) + if (v < 0) { return V_LT; - if (v > 0) + } + if (v > 0) { return V_GT; + } return V_EQ; } return V_LGE; @@ -9698,8 +9960,9 @@ inline void prepare_inexact(Rounding_Dir dir) { if (Policy::fpu_check_inexact - && !round_not_needed(dir) && round_strict_relation(dir)) + && !round_not_needed(dir) && round_strict_relation(dir)) { fpu_reset_inexact(); + } } template @@ -9740,8 +10003,9 @@ template inline Result assign_float_float_exact(To& to, const From from, Rounding_Dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } to = from; return V_EQ; } @@ -9749,11 +10013,13 @@ template inline Result assign_float_float_inexact(To& to, const From from, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = from; + } else if (fpu_inverse_rounding(dir)) { From tmp = -from; to = tmp; @@ -9774,19 +10040,23 @@ template inline Result assign_float_float(To& to, const From from, Rounding_Dir dir) { - if (sizeof(From) > sizeof(To)) + if (sizeof(From) > sizeof(To)) { return assign_float_float_inexact(to, from, dir); - else + } + else { return assign_float_float_exact(to, from, dir); + } } template inline Result floor_float(Type& to, const Type from, Rounding_Dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - if (fpu_direct_rounding(ROUND_DOWN)) + } + if (fpu_direct_rounding(ROUND_DOWN)) { to = round_to_integer(from); + } else if (fpu_inverse_rounding(ROUND_DOWN)) { to = round_to_integer(-from); limit_precision(to); @@ -9806,10 +10076,12 @@ template inline Result ceil_float(Type& to, const Type from, Rounding_Dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - if (fpu_direct_rounding(ROUND_UP)) + } + if (fpu_direct_rounding(ROUND_UP)) { to = round_to_integer(from); + } else if (fpu_inverse_rounding(ROUND_UP)) { to = round_to_integer(-from); limit_precision(to); @@ -9829,19 +10101,23 @@ template inline Result trunc_float(Type& to, const Type from, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - if (from >= 0) + } + if (from >= 0) { return floor(to, from, dir); - else + } + else { return ceil(to, from, dir); + } } template inline Result neg_float(Type& to, const Type from, Rounding_Dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } to = -from; return V_EQ; } @@ -9855,8 +10131,9 @@ return assign_nan(to, V_INF_ADD_INF); } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = x + y; + } else if (fpu_inverse_rounding(dir)) { to = -x - y; limit_precision(to); @@ -9871,8 +10148,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -9885,8 +10163,9 @@ return assign_nan(to, V_INF_SUB_INF); } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = x - y; + } else if (fpu_inverse_rounding(dir)) { to = y - x; limit_precision(to); @@ -9901,8 +10180,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -9917,8 +10197,9 @@ return assign_nan(to, V_INF_MUL_ZERO); } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = x * y; + } else if (fpu_inverse_rounding(dir)) { to = x * -y; limit_precision(to); @@ -9933,8 +10214,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -9950,8 +10232,9 @@ return assign_nan(to, V_DIV_ZERO); } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = x / y; + } else if (fpu_inverse_rounding(dir)) { to = x / -y; limit_precision(to); @@ -9966,8 +10249,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -9985,8 +10269,9 @@ } Result r1 = trunc(to, temp, ROUND_NOT_NEEDED); PPL_ASSERT(r1 == V_EQ); - if (r == V_EQ || to != temp) + if (r == V_EQ || to != temp) { return r1; + } // FIXME: Prove that it is impossible to return a strict relation return (dir == ROUND_UP) ? V_LE : V_GE; } @@ -10002,8 +10287,9 @@ return assign_nan(to, V_MOD_ZERO); } to = std::fmod(x, y); - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return V_EQ; } @@ -10015,8 +10301,9 @@ template inline Result add_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } PPL_ASSERT(exp < sizeof_to_bits(sizeof(unsigned long long))); return add(to, @@ -10028,8 +10315,9 @@ template inline Result sub_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } PPL_ASSERT(exp < sizeof_to_bits(sizeof(unsigned long long))); return sub(to, @@ -10041,8 +10329,9 @@ template inline Result mul_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } PPL_ASSERT(exp < sizeof_to_bits(sizeof(unsigned long long))); return mul(to, @@ -10054,8 +10343,9 @@ template inline Result div_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } PPL_ASSERT(exp < sizeof_to_bits(sizeof(unsigned long long))); return div(to, @@ -10067,8 +10357,9 @@ template inline Result smod_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (To_Policy::check_inf_mod && is_inf_float(x)) { return assign_nan(to, V_INF_MOD); } @@ -10076,34 +10367,39 @@ Type m = 1ULL << exp; rem_float(to, x, m, ROUND_IGNORE); Type m2 = m / 2; - if (to < -m2) + if (to < -m2) { return add_float(to, to, m, dir); - else if (to >= m2) + } + else if (to >= m2) { return sub_float(to, to, m, dir); + } return V_EQ; } template inline Result umod_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(x)) + if (To_Policy::fpu_check_nan_result && is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (To_Policy::check_inf_mod && is_inf_float(x)) { return assign_nan(to, V_INF_MOD); } PPL_ASSERT(exp < sizeof_to_bits(sizeof(unsigned long long))); Type m = 1ULL << exp; rem_float(to, x, m, ROUND_IGNORE); - if (to < 0) + if (to < 0) { return add_float(to, to, m, dir); + } return V_EQ; } template inline Result abs_float(Type& to, const Type from, Rounding_Dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } to = std::abs(from); return V_EQ; } @@ -10111,14 +10407,16 @@ template inline Result sqrt_float(Type& to, const Type from, Rounding_Dir dir) { - if (To_Policy::fpu_check_nan_result && is_nan(from)) + if (To_Policy::fpu_check_nan_result && is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (To_Policy::check_sqrt_neg && from < 0) { return assign_nan(to, V_SQRT_NEG); } prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = std::sqrt(from); + } else { fpu_rounding_control_word_type old = fpu_save_rounding_direction(round_fpu_dir(dir)); @@ -10133,24 +10431,30 @@ template inline Result_Relation sgn_float(const Type x) { - if (x > 0) + if (x > 0) { return VR_GT; - if (x < 0) + } + if (x < 0) { return VR_LT; - if (x == 0) + } + if (x == 0) { return VR_EQ; + } return VR_EMPTY; } template inline Result_Relation cmp_float(const Type x, const Type y) { - if (x > y) + if (x > y) { return VR_GT; - if (x < y) + } + if (x < y) { return VR_LT; - if (x == y) + } + if (x == y) { return VR_EQ; + } return VR_EMPTY; } @@ -10158,8 +10462,9 @@ inline Result assign_float_int_inexact(To& to, const From from, Rounding_Dir dir) { prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = from; + } else { fpu_rounding_control_word_type old = fpu_save_rounding_direction(round_fpu_dir(dir)); @@ -10173,10 +10478,12 @@ template inline Result assign_float_int(To& to, const From from, Rounding_Dir dir) { - if (sizeof_to_bits(sizeof(From)) > Float::Binary::MANTISSA_BITS) + if (sizeof_to_bits(sizeof(From)) > Float::Binary::MANTISSA_BITS) { return assign_float_int_inexact(to, from, dir); - else + } + else { return assign_exact(to, from, dir); + } } template @@ -10232,30 +10539,36 @@ mpz_srcptr from_z = from.get_mpz_t(); size_t exponent = mpz_sizeinbase(from_z, 2) - 1; if (exponent > size_t(Float::Binary::EXPONENT_MAX)) { - if (sign < 0) + if (sign < 0) { return set_neg_overflow_float(to, dir); - else + } + else { return set_pos_overflow_float(to, dir); + } } unsigned long zeroes = mpn_scan1(from_z->_mp_d, 0); size_t meaningful_bits = exponent - zeroes; mpz_t mantissa; mpz_init(mantissa); - if (exponent > Float::Binary::MANTISSA_BITS) + if (exponent > Float::Binary::MANTISSA_BITS) { mpz_tdiv_q_2exp(mantissa, from_z, exponent - Float::Binary::MANTISSA_BITS); - else + } + else { mpz_mul_2exp(mantissa, from_z, Float::Binary::MANTISSA_BITS - exponent); + } Float f; f.u.binary.build(sign < 0, mantissa, static_cast(exponent)); mpz_clear(mantissa); to = f.value(); if (meaningful_bits > Float::Binary::MANTISSA_BITS) { - if (sign < 0) + if (sign < 0) { return round_lt_float(to, dir); - else + } + else { return round_gt_float(to, dir); + } } return V_EQ; } @@ -10265,8 +10578,9 @@ assign_float_mpq(T& to, const mpq_class& from, Rounding_Dir dir) { const mpz_class& numer = from.get_num(); const mpz_class& denom = from.get_den(); - if (denom == 1) + if (denom == 1) { return assign_float_mpz(to, numer, dir); + } mpz_srcptr numer_z = numer.get_mpz_t(); mpz_srcptr denom_z = denom.get_mpz_t(); int sign = sgn(numer); @@ -10275,17 +10589,21 @@ if (exponent < Float::Binary::EXPONENT_MIN_DENORM) { to = 0; inexact: - if (sign < 0) + if (sign < 0) { return round_lt_float(to, dir); - else + } + else { return round_gt_float(to, dir); + } } if (exponent > Float::Binary::EXPONENT_MAX + 1) { overflow: - if (sign < 0) + if (sign < 0) { return set_neg_overflow_float(to, dir); - else + } + else { return set_pos_overflow_float(to, dir); + } } unsigned int needed_bits = Float::Binary::MANTISSA_BITS + 1; if (exponent < Float::Binary::EXPONENT_MIN) { @@ -10316,8 +10634,9 @@ inexact = (inexact || mpz_odd_p(mantissa)); mpz_tdiv_q_2exp(mantissa, mantissa, 1); } - else + else { --exponent; + } if (exponent > Float::Binary::EXPONENT_MAX) { mpz_clear(mantissa); goto overflow; @@ -10330,8 +10649,9 @@ f.u.binary.build(sign < 0, mantissa, exponent); mpz_clear(mantissa); to = f.value(); - if (inexact) + if (inexact) { goto inexact; + } return V_EQ; } @@ -10347,8 +10667,9 @@ } // FIXME: missing check_inf_add_inf prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = multiply_add(x, y, to); + } else if (fpu_inverse_rounding(dir)) { to = multiply_add(-x, y, -to); limit_precision(to); @@ -10364,8 +10685,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -10380,8 +10702,9 @@ } // FIXME: missing check_inf_add_inf prepare_inexact(dir); - if (fpu_direct_rounding(dir)) + if (fpu_direct_rounding(dir)) { to = multiply_add(x, -y, to); + } else if (fpu_inverse_rounding(dir)) { to = multiply_add(x, y, -to); limit_precision(to); @@ -10397,8 +10720,9 @@ limit_precision(to); fpu_restore_rounding_direction(old); } - if (To_Policy::fpu_check_nan_result && is_nan(to)) + if (To_Policy::fpu_check_nan_result && is_nan(to)) { return V_NAN; + } return result_relation(dir); } @@ -10412,8 +10736,9 @@ inline void assign_mpq_numeric_float(mpq_class& to, const long double from) { to = 0; - if (from == 0.0L) + if (from == 0.0L) { return; + } mpz_class& num = to.get_num(); mpz_class& den = to.get_den(); int exp; @@ -10431,16 +10756,20 @@ const long double intpart = std::floor(n); num += static_cast(intpart); n -= intpart; - if (n == 0.0L) + if (n == 0.0L) { break; + } num <<= bits; } - if (exp < 0) + if (exp < 0) { den <<= -exp; - else + } + else { num <<= exp; - if (neg) + } + if (neg) { to = -to; + } to.canonicalize(); } @@ -10448,14 +10777,18 @@ inline Result output_float(std::ostream& os, const Type from, const Numeric_Format&, Rounding_Dir) { - if (from == 0) + if (from == 0) { os << "0"; - else if (is_minf(from)) + } + else if (is_minf(from)) { os << "-inf"; - else if (is_pinf(from)) + } + else if (is_pinf(from)) { os << "+inf"; - else if (is_nan(from)) + } + else if (is_nan(from)) { os << "nan"; + } else { mpq_class q; assign_mpq_numeric_float(q, from); @@ -10672,7 +11005,10 @@ return V_GT; } -#ifdef PPL_HAVE_TYPEOF +#if __cplusplus >= 201103L +//! Type of the _mp_size field of GMP's __mpz_struct. +typedef decltype(__mpz_struct()._mp_size) mp_size_field_t; +#elif PPL_HAVE_TYPEOF //! Type of the _mp_size field of GMP's __mpz_struct. typedef typeof(__mpz_struct()._mp_size) mp_size_field_t; #else @@ -10697,19 +11033,24 @@ mp_size_field_t s = get_mp_size(v); if (Policy::has_nan && (nan || sign) - && s == C_Integer::min + 1) + && s == C_Integer::min + 1) { return V_NAN; - if (!inf && !sign) + } + if (!inf && !sign) { return V_LGE; + } if (Policy::has_infinity) { - if (s == C_Integer::min) + if (s == C_Integer::min) { return inf ? V_EQ_MINUS_INFINITY : V_LT; - if (s == C_Integer::max) + } + if (s == C_Integer::max) { return inf ? V_EQ_PLUS_INFINITY : V_GT; + } } } - if (sign) + if (sign) { return static_cast(sgn(v)); + } return V_LGE; } @@ -10755,8 +11096,9 @@ assign_special_mpz(mpz_class& v, Result_Class c, Rounding_Dir) { switch (c) { case VC_NAN: - if (Policy::has_nan) + if (Policy::has_nan) { set_mp_size(v, C_Integer::min + 1); + } return V_NAN; case VC_MINUS_INFINITY: if (Policy::has_infinity) { @@ -10781,10 +11123,12 @@ template inline void copy_mpz(mpz_class& to, const mpz_class& from) { - if (is_nan_mpz(from)) + if (is_nan_mpz(from)) { PPL_ASSERT(To_Policy::has_nan); - else if (is_minf_mpz(from) || is_pinf_mpz(from)) + } + else if (is_minf_mpz(from) || is_pinf_mpz(from)) { PPL_ASSERT(To_Policy::has_infinity); + } else { to = from; return; @@ -10797,7 +11141,7 @@ template inline Result construct_mpz_base(mpz_class& to, const From from, Rounding_Dir) { - new (&to) mpz_class(from); + new(&to) mpz_class(from); return V_EQ; } @@ -10814,24 +11158,30 @@ template inline Result construct_mpz_float(mpz_class& to, const From& from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return construct_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return construct_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return construct_special(to, VC_PLUS_INFINITY, dir); + } if (round_not_requested(dir)) { - new (&to) mpz_class(from); + new(&to) mpz_class(from); return V_LGE; } From n = rint(from); - new (&to) mpz_class(n); - if (from == n) + new(&to) mpz_class(n); + if (from == n) { return V_EQ; - if (from < 0) + } + if (from < 0) { return round_lt_mpz(to, dir); - else + } + else { return round_gt_mpz(to, dir); + } } PPL_SPECIALIZE_CONSTRUCT(construct_mpz_float, mpz_class, float) @@ -10851,12 +11201,14 @@ template inline Result assign_mpz_signed_int(mpz_class& to, const From from, Rounding_Dir) { - if (sizeof(From) <= sizeof(signed long)) + if (sizeof(From) <= sizeof(signed long)) { to = static_cast(from); + } else { mpz_ptr m = to.get_mpz_t(); - if (from >= 0) + if (from >= 0) { mpz_import(m, 1, 1, sizeof(From), 0, 0, &from); + } else { From n = -from; mpz_import(m, 1, 1, sizeof(From), 0, 0, &n); @@ -10871,10 +11223,12 @@ template inline Result assign_mpz_unsigned_int(mpz_class& to, const From from, Rounding_Dir) { - if (sizeof(From) <= sizeof(unsigned long)) + if (sizeof(From) <= sizeof(unsigned long)) { to = static_cast(from); - else + } + else { mpz_import(to.get_mpz_t(), 1, 1, sizeof(From), 0, 0, &from); + } return V_EQ; } @@ -10883,28 +11237,36 @@ template inline Result assign_mpz_float(mpz_class& to, const From from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } if (round_not_requested(dir)) { to = from; return V_LGE; } From i_from = rint(from); to = i_from; - if (from == i_from) + if (from == i_from) { return V_EQ; - if (round_direct(ROUND_UP)) + } + if (round_direct(ROUND_UP)) { return round_lt_mpz(to, dir); - if (round_direct(ROUND_DOWN)) + } + if (round_direct(ROUND_DOWN)) { return round_gt_mpz(to, dir); - if (from < i_from) + } + if (from < i_from) { return round_lt_mpz(to, dir); - if (from > i_from) + } + if (from > i_from) { return round_gt_mpz(to, dir); + } PPL_UNREACHABLE; return V_NAN; } @@ -10915,12 +11277,15 @@ template inline Result assign_mpz_long_double(mpz_class& to, const From& from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } // FIXME: this is an incredibly inefficient implementation! std::stringstream ss; output(ss, from, Numeric_Format(), dir); @@ -10950,15 +11315,17 @@ const mpz_srcptr d = from.get_den().get_mpz_t(); if (round_down(dir)) { mpz_fdiv_q(to.get_mpz_t(), n, d); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_p(n, d) != 0) ? V_EQ : V_GT; + } return V_GE; } else { PPL_ASSERT(round_up(dir)); mpz_cdiv_q(to.get_mpz_t(), n, d); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_p(n, d) != 0) ? V_EQ : V_LT; + } return V_LE; } } @@ -11024,15 +11391,17 @@ } if (round_down(dir)) { mpz_fdiv_q(to.get_mpz_t(), n, d); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_p(n, d) != 0) ? V_EQ : V_GT; + } return V_GE; } else { PPL_ASSERT(round_up(dir)); mpz_cdiv_q(to.get_mpz_t(), n, d); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_p(n, d) != 0) ? V_EQ : V_LT; + } return V_LE; } } @@ -11113,15 +11482,17 @@ } if (round_down(dir)) { mpz_fdiv_q_2exp(to.get_mpz_t(), n, exp); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_2exp_p(n, exp) != 0) ? V_EQ : V_GT; + } return V_GE; } else { PPL_ASSERT(round_up(dir)); mpz_cdiv_q_2exp(to.get_mpz_t(), n, exp); - if (round_strict_relation(dir)) + if (round_strict_relation(dir)) { return (mpz_divisible_2exp_p(n, exp) != 0) ? V_EQ : V_LT; + } return V_LE; } } @@ -11132,10 +11503,12 @@ inline Result smod_2exp_mpz(mpz_class& to, const mpz_class& x, unsigned int exp, Rounding_Dir) { - if (mpz_tstbit(x.get_mpz_t(), exp - 1) != 0) + if (mpz_tstbit(x.get_mpz_t(), exp - 1) != 0) { mpz_cdiv_r_2exp(to.get_mpz_t(), x.get_mpz_t(), exp); - else + } + else { mpz_fdiv_r_2exp(to.get_mpz_t(), x.get_mpz_t(), exp); + } return V_EQ; } @@ -11222,8 +11595,9 @@ } PPL_DIRTY_TEMP(mpz_class, r); mpz_sqrtrem(to.get_mpz_t(), r.get_mpz_t(), from.get_mpz_t()); - if (r == 0) + if (r == 0) { return V_EQ; + } return round_gt_mpz(to, dir); } @@ -11283,19 +11657,24 @@ if ((Policy::has_nan || Policy::has_infinity) && ::sgn(v.get_den()) == 0) { int s = ::sgn(v.get_num()); - if (Policy::has_nan && (nan || sign) && s == 0) + if (Policy::has_nan && (nan || sign) && s == 0) { return V_NAN; - if (!inf && !sign) + } + if (!inf && !sign) { return V_LGE; + } if (Policy::has_infinity) { - if (s < 0) + if (s < 0) { return inf ? V_EQ_MINUS_INFINITY : V_LT; - if (s > 0) + } + if (s > 0) { return inf ? V_EQ_PLUS_INFINITY : V_GT; + } } } - if (sign) + if (sign) { return static_cast(sgn(v)); + } return V_LGE; } @@ -11335,10 +11714,12 @@ inline bool is_int_mpq(const mpq_class& v) { if ((Policy::has_infinity || Policy::has_nan) - && ::sgn(v.get_den()) == 0) + && ::sgn(v.get_den()) == 0) { return !(Policy::has_nan && ::sgn(v.get_num()) == 0); - else + } + else { return v.get_den() == 1; + } } PPL_SPECIALIZE_IS_INT(is_int_mpq, mpq_class) @@ -11381,7 +11762,7 @@ template inline Result construct_mpq_base(mpq_class& to, const From& from, Rounding_Dir) { - new (&to) mpq_class(from); + new(&to) mpq_class(from); return V_EQ; } @@ -11399,13 +11780,16 @@ template inline Result construct_mpq_float(mpq_class& to, const From& from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return construct_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return construct_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return construct_special(to, VC_PLUS_INFINITY, dir); - new (&to) mpq_class(from); + } + new(&to) mpq_class(from); return V_EQ; } @@ -11427,12 +11811,15 @@ template inline Result assign_mpq_float(mpq_class& to, const From& from, Rounding_Dir dir) { - if (is_nan(from)) + if (is_nan(from)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(from)) + } + else if (is_minf(from)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(from)) + } + else if (is_pinf(from)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } assign_mpq_numeric_float(to, from); return V_EQ; } @@ -11444,12 +11831,14 @@ template inline Result assign_mpq_signed_int(mpq_class& to, const From from, Rounding_Dir) { - if (sizeof(From) <= sizeof(signed long)) + if (sizeof(From) <= sizeof(signed long)) { to = static_cast(from); + } else { mpz_ptr m = to.get_num().get_mpz_t(); - if (from >= 0) + if (from >= 0) { mpz_import(m, 1, 1, sizeof(From), 0, 0, &from); + } else { From n = -from; mpz_import(m, 1, 1, sizeof(From), 0, 0, &n); @@ -11465,8 +11854,9 @@ template inline Result assign_mpq_unsigned_int(mpq_class& to, const From from, Rounding_Dir) { - if (sizeof(From) <= sizeof(unsigned long)) + if (sizeof(From) <= sizeof(unsigned long)) { to = static_cast(from); + } else { mpz_import(to.get_num().get_mpz_t(), 1, 1, sizeof(From), 0, 0, &from); to.get_den() = 1; @@ -11643,8 +12033,9 @@ mpz_fdiv_q_2exp(to.get_den().get_mpz_t(), to.get_den().get_mpz_t(), 1); bool neg = to.get_num() >= to.get_den(); mpz_mul_2exp(to.get_den().get_mpz_t(), to.get_den().get_mpz_t(), 1); - if (neg) + if (neg) { to.get_num() -= to.get_den(); + } mpz_mul_2exp(to.get_num().get_mpz_t(), to.get_num().get_mpz_t(), exp); to.canonicalize(); return V_EQ; @@ -11775,11 +12166,13 @@ */ inline void set_irrational_precision(const unsigned p) { - if (p <= INT_MAX) + if (p <= INT_MAX) { Checked::irrational_precision = p; - else + } + else { throw std::invalid_argument("PPL::set_irrational_precision(p)" " with p > INT_MAX"); + } } } // namespace Parma_Polyhedra_Library @@ -11814,14 +12207,18 @@ template inline Result_Relation sgn_ext(const Type& x) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return VR_EMPTY; - else if (is_minf(x)) + } + else if (is_minf(x)) { return VR_LT; - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return VR_GT; + } else { native: return sgn(x); @@ -11832,14 +12229,18 @@ typename To, typename From> inline Result construct_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return construct_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return construct_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return construct_special(to, VC_PLUS_INFINITY, dir); + } else { native: return construct(to, x, dir); @@ -11850,14 +12251,18 @@ typename To, typename From> inline Result assign_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return assign(to, x, dir); @@ -11868,14 +12273,18 @@ typename To, typename From> inline Result neg_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); + } else { native: return neg(to, x, dir); @@ -11886,14 +12295,18 @@ typename To, typename From> inline Result floor_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return floor(to, x, dir); @@ -11904,14 +12317,18 @@ typename To, typename From> inline Result ceil_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return ceil(to, x, dir); @@ -11922,14 +12339,18 @@ typename To, typename From> inline Result trunc_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return trunc(to, x, dir); @@ -11940,12 +12361,15 @@ typename To, typename From> inline Result abs_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x) || is_pinf(x)) + } + else if (is_minf(x) || is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return abs(to, x, dir); @@ -11956,23 +12380,28 @@ typename To, typename From1, typename From2> inline Result add_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (is_minf(x)) { - if (CHECK_P(To_Policy::check_inf_add_inf, is_pinf(y))) + if (CHECK_P(To_Policy::check_inf_add_inf, is_pinf(y))) { goto inf_add_inf; - else + } + else { goto minf; + } } else if (is_pinf(x)) { if (CHECK_P(To_Policy::check_inf_add_inf, is_minf(y))) { inf_add_inf: return assign_nan(to, V_INF_ADD_INF); } - else + else { goto pinf; + } } else { if (is_minf(y)) { @@ -11994,23 +12423,28 @@ typename To, typename From1, typename From2> inline Result sub_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (is_minf(x)) { - if (CHECK_P(To_Policy::check_inf_sub_inf, is_minf(y))) + if (CHECK_P(To_Policy::check_inf_sub_inf, is_minf(y))) { goto inf_sub_inf; - else + } + else { goto minf; + } } else if (is_pinf(x)) { if (CHECK_P(To_Policy::check_inf_sub_inf, is_pinf(y))) { inf_sub_inf: return assign_nan(to, V_INF_SUB_INF); } - else + else { goto pinf; + } } else { if (is_pinf(y)) { @@ -12032,10 +12466,12 @@ typename To, typename From1, typename From2> inline Result mul_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (is_minf(x)) { switch (sgn_ext(y)) { case VR_LT: @@ -12094,11 +12530,13 @@ inline Result add_mul_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { if (!ext_to_handle(to) - && !ext_to_handle(x) && !ext_to_handle(y)) + && !ext_to_handle(x) && !ext_to_handle(y)) { goto native; + } if (is_nan(to) - || is_nan(x) || is_nan(y)) + || is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (is_minf(x)) { switch (sgn_ext(y)) { case VR_LT: @@ -12134,18 +12572,21 @@ switch (sgn(x)) { case VR_LT: a_minf: - if (CHECK_P(To_Policy::check_inf_add_inf, is_pinf(to))) + if (CHECK_P(To_Policy::check_inf_add_inf, is_pinf(to))) { goto inf_add_inf; - else + } + else { goto minf; + } case VR_GT: a_pinf: if (CHECK_P(To_Policy::check_inf_add_inf, is_minf(to))) { inf_add_inf: return assign_nan(to, V_INF_ADD_INF); } - else + else { goto pinf; + } default: inf_mul_zero: PPL_ASSERT(To_Policy::check_inf_mul_zero); @@ -12172,11 +12613,13 @@ inline Result sub_mul_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { if (!ext_to_handle(to) - && !ext_to_handle(x) && !ext_to_handle(y)) + && !ext_to_handle(x) && !ext_to_handle(y)) { goto native; + } if (is_nan(to) - || is_nan(x) || is_nan(y)) + || is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (is_minf(x)) { switch (sgn_ext(y)) { case VR_LT: @@ -12212,18 +12655,21 @@ switch (sgn(x)) { case VR_LT: a_minf: - if (CHECK_P(To_Policy::check_inf_sub_inf, is_minf(to))) + if (CHECK_P(To_Policy::check_inf_sub_inf, is_minf(to))) { goto inf_sub_inf; - else + } + else { goto pinf; + } case VR_GT: a_pinf: if (CHECK_P(To_Policy::check_inf_sub_inf, is_pinf(to))) { inf_sub_inf: return assign_nan(to, V_INF_SUB_INF); } - else + else { goto minf; + } default: inf_mul_zero: PPL_ASSERT(To_Policy::check_inf_mul_zero); @@ -12249,14 +12695,17 @@ typename To, typename From1, typename From2> inline Result div_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (is_minf(x)) { if (CHECK_P(To_Policy::check_inf_div_inf, is_minf(y) - || is_pinf(y))) + || is_pinf(y))) { goto inf_div_inf; + } else { switch (sgn(y)) { case VR_LT: @@ -12306,14 +12755,17 @@ typename To, typename From1, typename From2> inline Result idiv_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } if (is_minf(x)) { if (CHECK_P(To_Policy::check_inf_div_inf, is_minf(y) - || is_pinf(y))) + || is_pinf(y))) { goto inf_div_inf; + } else { switch (sgn(y)) { case VR_LT: @@ -12363,10 +12815,12 @@ typename To, typename From1, typename From2> inline Result rem_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (CHECK_P(To_Policy::check_inf_mod, is_minf(x) || is_pinf(x))) { return assign_nan(to, V_INF_MOD); @@ -12387,14 +12841,18 @@ typename To, typename From> inline Result add_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return add_2exp(to, x, exp, dir); @@ -12405,14 +12863,18 @@ typename To, typename From> inline Result sub_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return sub_2exp(to, x, exp, dir); @@ -12423,14 +12885,18 @@ typename To, typename From> inline Result mul_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return mul_2exp(to, x, exp, dir); @@ -12441,14 +12907,18 @@ typename To, typename From> inline Result div_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x)) + } + else if (is_minf(x)) { return assign_special(to, VC_MINUS_INFINITY, dir); - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return div_2exp(to, x, exp, dir); @@ -12459,10 +12929,12 @@ typename To, typename From> inline Result smod_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (CHECK_P(To_Policy::check_inf_mod, is_minf(x) || is_pinf(x))) { return assign_nan(to, V_INF_MOD); @@ -12477,10 +12949,12 @@ typename To, typename From> inline Result umod_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (CHECK_P(To_Policy::check_inf_mod, is_minf(x) || is_pinf(x))) { return assign_nan(to, V_INF_MOD); @@ -12495,15 +12969,18 @@ typename To, typename From> inline Result sqrt_ext(To& to, const From& x, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; - if (is_nan(x)) + } + if (is_nan(x)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (is_minf(x)) { return assign_nan(to, V_SQRT_NEG); } - else if (is_pinf(x)) + else if (is_pinf(x)) { return assign_special(to, VC_PLUS_INFINITY, dir); + } else { native: return sqrt(to, x, dir); @@ -12514,14 +12991,18 @@ typename To, typename From1, typename From2> inline Result gcd_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (is_nan(x) || is_nan(y)) + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); - else if (is_minf(x) || is_pinf(x)) + } + else if (is_minf(x) || is_pinf(x)) { return abs_ext(to, y, dir); - else if (is_minf(y) || is_pinf(y)) + } + else if (is_minf(y) || is_pinf(y)) { return abs_ext(to, x, dir); - else + } + else { return gcd(to, x, y, dir); + } } template (x) || is_nan(y)) + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (is_minf(x) || is_pinf(x)) { s = 0; t = y > 0 ? -1 : 1; @@ -12543,40 +13025,50 @@ t = 0; return abs_ext(to, x, dir); } - else + else { return gcdext(to, s, t, x, y, dir); + } } template inline Result lcm_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) { - if (is_nan(x) || is_nan(y)) + if (is_nan(x) || is_nan(y)) { return assign_special(to, VC_NAN, ROUND_IGNORE); + } else if (is_minf(x) || is_pinf(x) - || is_minf(y) || is_pinf(y)) + || is_minf(y) || is_pinf(y)) { return assign_special(to, VC_PLUS_INFINITY, dir); - else + } + else { return lcm(to, x, y, dir); + } } template inline Result_Relation cmp_ext(const Type1& x, const Type2& y) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return VR_EMPTY; - else if (is_minf(x)) + } + else if (is_minf(x)) { return is_minf(y) ? VR_EQ : VR_LT; - else if (is_pinf(x)) + } + else if (is_pinf(x)) { return is_pinf(y) ? VR_EQ : VR_GT; + } else { - if (is_minf(y)) + if (is_minf(y)) { return VR_GT; - if (is_pinf(y)) + } + if (is_pinf(y)) { return VR_LT; + } native: return cmp(x, y); } @@ -12586,14 +13078,18 @@ typename Type1, typename Type2> inline bool lt_ext(const Type1& x, const Type2& y) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return false; - if (is_pinf(x) || is_minf(y)) + } + if (is_pinf(x) || is_minf(y)) { return false; - if (is_minf(x) || is_pinf(y)) + } + if (is_minf(x) || is_pinf(y)) { return true; + } native: return lt_p(x, y); } @@ -12609,14 +13105,18 @@ typename Type1, typename Type2> inline bool le_ext(const Type1& x, const Type2& y) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return false; - if (is_minf(x) || is_pinf(y)) + } + if (is_minf(x) || is_pinf(y)) { return true; - if (is_pinf(x) || is_minf(y)) + } + if (is_pinf(x) || is_minf(y)) { return false; + } native: return le_p(x, y); } @@ -12632,16 +13132,21 @@ typename Type1, typename Type2> inline bool eq_ext(const Type1& x, const Type2& y) { - if (!ext_to_handle(x) && !ext_to_handle(y)) + if (!ext_to_handle(x) && !ext_to_handle(y)) { goto native; - if (is_nan(x) || is_nan(y)) + } + if (is_nan(x) || is_nan(y)) { return false; - if (is_minf(x)) + } + if (is_minf(x)) { return is_minf(y); - if (is_pinf(x)) + } + if (is_pinf(x)) { return is_pinf(y); - else if (is_minf(y) || is_pinf(y)) + } + else if (is_minf(y) || is_pinf(y)) { return false; + } native: return eq_p(x, y); } @@ -12657,8 +13162,9 @@ inline Result output_ext(std::ostream& os, const Type& x, const Numeric_Format& format, Rounding_Dir dir) { - if (!ext_to_handle(x)) + if (!ext_to_handle(x)) { goto native; + } if (is_nan(x)) { os << "nan"; return V_NAN; @@ -12911,7 +13417,9 @@ //! Direct initialization from special and rounding mode. template - Checked_Number(const From&, Rounding_Dir dir, typename Enable_If::value, bool>::type ignored = false); + Checked_Number(const From&, Rounding_Dir dir, + typename Enable_If::value, bool>::type + ignored = false); //! Direct initialization from a Checked_Number, default rounding mode. template @@ -13775,8 +14283,9 @@ inline void Extended_Number_Policy::handle_result(Result r) { - if (result_class(r) == VC_NAN) + if (result_class(r) == VC_NAN) { throw_result_exception(r); + } } template @@ -13826,21 +14335,19 @@ template \ inline \ Checked_Number::Checked_Number(const type y, Rounding_Dir dir) { \ - Policy::handle_result \ - (check_result(Checked::assign_ext > \ - (v, y, rounding_dir(dir)), \ - dir)); \ + Policy::handle_result(check_result(Checked::assign_ext > \ + (v, y, rounding_dir(dir)), \ + dir)); \ } \ template \ inline \ Checked_Number::Checked_Number(const type y) { \ Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; \ - Policy::handle_result \ - (check_result(Checked::assign_ext > \ - (v, y, rounding_dir(dir)), \ - dir)); \ + Policy::handle_result(check_result(Checked::assign_ext > \ + (v, y, rounding_dir(dir)), \ + dir)); \ } PPL_DEFINE_CTOR(char) @@ -13972,8 +14479,9 @@ template inline Checked_Number::operator T() const { - if (Policy::convertible) + if (Policy::convertible) { return v; + } } template @@ -14159,19 +14667,18 @@ PPL_U(name)(To1& to, To2& s, To3& t, const From1& x, const From2& y, \ Rounding_Dir dir) { \ return \ - check_result \ - (Checked::func::Policy, \ - typename Native_Checked_To_Wrapper::Policy, \ - typename Native_Checked_To_Wrapper::Policy, \ - typename Native_Checked_From_Wrapper::Policy, \ - typename Native_Checked_From_Wrapper::Policy> \ - (Native_Checked_To_Wrapper::raw_value(to), \ - Native_Checked_To_Wrapper::raw_value(s), \ - Native_Checked_To_Wrapper::raw_value(t), \ - Native_Checked_From_Wrapper::raw_value(x), \ - Native_Checked_From_Wrapper::raw_value(y), \ - rounding_dir(dir)), \ - dir); \ + check_result(Checked::func::Policy, \ + typename Native_Checked_To_Wrapper::Policy, \ + typename Native_Checked_To_Wrapper::Policy, \ + typename Native_Checked_From_Wrapper::Policy, \ + typename Native_Checked_From_Wrapper::Policy> \ + (Native_Checked_To_Wrapper::raw_value(to), \ + Native_Checked_To_Wrapper::raw_value(s), \ + Native_Checked_To_Wrapper::raw_value(t), \ + Native_Checked_From_Wrapper::raw_value(x), \ + Native_Checked_From_Wrapper::raw_value(y), \ + rounding_dir(dir)), \ + dir); \ } PPL_DEFINE_FUNC4(gcdext_assign_r, gcdext_ext) @@ -14433,7 +14940,9 @@ template inline typename Enable_If::value, int>::type sgn(const From& x) { - Result_Relation r = Checked::sgn_ext::Policy>(Native_Checked_From_Wrapper::raw_value(x)); + Result_Relation r + = Checked::sgn_ext::Policy> + (Native_Checked_From_Wrapper::raw_value(x)); switch (r) { case VR_LT: return -1; @@ -14506,10 +15015,12 @@ inline std::istream& operator>>(std::istream& is, Checked_Number& x) { Result r = input(x, is, Policy::ROUND_DEFAULT_INPUT); - if (r == V_CVT_STR_UNK) + if (r == V_CVT_STR_UNK) { is.setstate(std::ios::failbit); - else + } + else { Policy::handle_result(r); + } return is; } @@ -14542,17 +15053,20 @@ template inline void maybe_reset_fpu_inexact() { - if (FPU_Related::value) + if (FPU_Related::value) { return fpu_reset_inexact(); + } } template inline int maybe_check_fpu_inexact() { - if (FPU_Related::value) + if (FPU_Related::value) { return fpu_check_inexact(); - else + } + else { return 0; + } } } // namespace Parma_Polyhedra_Library @@ -14571,9 +15085,10 @@ template typename Enable_If::value, void>::type ascii_dump(std::ostream& s, const T& t) { - if (std::numeric_limits::is_exact) + if (std::numeric_limits::is_exact) { // An exact data type: pretty printer is accurate. s << t; + } else { // An inexact data type (probably floating point): // first dump its hexadecimal representation ... @@ -14601,8 +15116,9 @@ // An inexact data type (probably floating point): // first load its hexadecimal representation ... std::string str; - if (!(s >> str) || str.size() != 2*sizeof(T)) + if (!(s >> str) || str.size() != 2*sizeof(T)) { return false; + } unsigned char* p = reinterpret_cast(&t); // CHECKME: any (portable) simpler way? for (unsigned i = 0; i < sizeof(T); ++i) { @@ -14675,8 +15191,9 @@ p[i] = static_cast(byte_value); } // ... then read and discard pretty printed value. - if (!(s >> str)) + if (!(s >> str)) { return false; + } const std::string::size_type sz = str.size(); return sz > 2 && str[0] == '(' && str[sz-1] == ')'; } @@ -14684,7 +15201,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Checked_Number_defs.hh line 1067. */ +/* Automatically generated from PPL source file ../src/Checked_Number_defs.hh line 1069. */ /* Automatically generated from PPL source file ../src/checked_numeric_limits.hh line 29. */ #include @@ -15061,10 +15578,6 @@ : unget_char_buf(traits_type::eof()), next_char_buf(traits_type::eof()) { } -inline -c_streambuf::~c_streambuf() { -} - } // namespace Parma_Polyhedra_Library /* Automatically generated from PPL source file ../src/c_streambuf_defs.hh line 126. */ @@ -15079,6 +15592,16 @@ */ +/* Automatically generated from PPL source file ../src/Interval_types.hh line 1. */ + + +namespace Parma_Polyhedra_Library { + +template +class Interval; + +} // namespace Parma_Polyhedra_Library + /* Automatically generated from PPL source file ../src/assign_or_swap.hh line 1. */ /* The assign_or_swap() utility functions. */ @@ -15163,11 +15686,9 @@ */ -/* Automatically generated from PPL source file ../src/intervals_defs.hh line 28. */ +/* Automatically generated from PPL source file ../src/intervals_defs.hh line 29. */ #include -/* Automatically generated from PPL source file ../src/intervals_defs.hh line 31. */ - namespace Parma_Polyhedra_Library { #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS @@ -15296,7 +15817,7 @@ Return_Type get() const { return value; } - operator Return_Type () const { + operator Return_Type() const { return get(); } }; @@ -15330,7 +15851,7 @@ Return_Type get() const { return *ptr; } - operator Return_Type () const { + operator Return_Type() const { return get(); } }; @@ -15352,8 +15873,9 @@ case V_LE: r = assign_r(to, c.value(), (ROUND_UP | ROUND_STRICT_RELATION)); r = result_relation_class(r); - if (r == V_EQ) + if (r == V_EQ) { return V_LE; + } goto lt; case V_LT: r = assign_r(to, c.value(), ROUND_UP); @@ -15375,8 +15897,9 @@ case V_GE: r = assign_r(to, c.value(), (ROUND_DOWN | ROUND_STRICT_RELATION)); r = result_relation_class(r); - if (r == V_EQ) + if (r == V_EQ) { return V_GE; + } goto gt; case V_GT: r = assign_r(to, c.value(), ROUND_DOWN); @@ -15399,17 +15922,21 @@ r = assign_r(to, c.value(), ROUND_CHECK); r = result_relation_class(r); PPL_ASSERT(r != V_LT && r != V_GT); - if (r == V_EQ) + if (r == V_EQ) { return V_EQ; - else + } + else { return V_EMPTY; + } case V_NE: r = assign_r(to, c.value(), ROUND_CHECK); r = result_relation_class(r); - if (r == V_EQ) + if (r == V_EQ) { return V_NE; - else + } + else { return V_LGE; + } default: break; } @@ -15497,12 +16024,14 @@ PPL_ASSERT(rel == V_EQ); return V_GE; case V_EQ: - if (is_integer(to)) + if (is_integer(to)) { return V_EQ; + } return V_EMPTY; case V_NE: - if (is_integer(to)) + if (is_integer(to)) { return V_NE; + } return V_LGE; default: return rel; @@ -15609,16 +16138,6 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Interval_types.hh line 1. */ - - -namespace Parma_Polyhedra_Library { - -template -class Interval; - -} // namespace Parma_Polyhedra_Library - /* Automatically generated from PPL source file ../src/Interval_Info_defs.hh line 1. */ /* Interval_Info class declaration and implementation. */ @@ -15638,7 +16157,7 @@ struct Property { enum Type { SPECIAL_, - OPEN_, + OPEN_ }; typedef bool Value; static const Value default_value = true; @@ -15659,10 +16178,12 @@ inline Rounding_Dir round_dir_check(Boundary_Type t, bool check = false) { - if (check) + if (check) { return static_cast(t) | ROUND_STRICT_RELATION; - else + } + else { return static_cast(t); + } } template @@ -15682,21 +16203,25 @@ template inline bool normal_is_open(Boundary_Type type, const T& x, const Info& info) { - if (Info::store_open) + if (Info::store_open) { return info.get_boundary_property(type, OPEN); - else + } + else { return !Info::store_special && !Info::may_contain_infinity && normal_is_boundary_infinity(type, x, info); + } } template inline bool is_open(Boundary_Type type, const T& x, const Info& info) { - if (Info::store_open) + if (Info::store_open) { return info.get_boundary_property(type, OPEN); - else + } + else { return !Info::may_contain_infinity && is_boundary_infinity(type, x, info); + } } template @@ -15707,14 +16232,18 @@ || std::numeric_limits::has_infinity, "unbounded is not representable"); Result r; - if (Info::store_special) + if (Info::store_special) { r = special_set_boundary_infinity(type, x, info); - else if (type == LOWER) + } + else if (type == LOWER) { r = assign_r(x, MINUS_INFINITY, ROUND_UP); - else + } + else { r = assign_r(x, PLUS_INFINITY, ROUND_DOWN); - if (result_relation(r) == VR_EQ && !Info::may_contain_infinity) + } + if (result_relation(r) == VR_EQ && !Info::may_contain_infinity) { info.set_boundary_property(type, OPEN); + } return r; } @@ -15736,8 +16265,9 @@ r = assign_r(x, MINUS_INFINITY, round_dir_check(type)); PPL_ASSERT(result_representable(r)); } - if (open || result_relation(r) != VR_EQ) + if (open || result_relation(r) != VR_EQ) { info.set_boundary_property(type, OPEN); + } return r; } @@ -15759,8 +16289,9 @@ r = assign_r(x, PLUS_INFINITY, round_dir_check(type)); PPL_ASSERT(result_representable(r)); } - if (open || result_relation(r) != VR_EQ) + if (open || result_relation(r) != VR_EQ) { info.set_boundary_property(type, OPEN); + } return r; } @@ -15769,99 +16300,125 @@ set_boundary_infinity(Boundary_Type type, T& x, Info& info, bool open = false) { PPL_ASSERT(open || Info::may_contain_infinity); Result r; - if (Info::store_special) + if (Info::store_special) { r = special_set_boundary_infinity(type, x, info); - else if (type == LOWER) + } + else if (type == LOWER) { r = assign_r(x, MINUS_INFINITY, round_dir_check(type)); - else + } + else { r = assign_r(x, PLUS_INFINITY, round_dir_check(type)); + } PPL_ASSERT(result_representable(r)); - if (open) + if (open) { info.set_boundary_property(type, OPEN); + } return r; } template inline bool is_domain_inf(Boundary_Type type, const T& x, const Info& info) { - if (Info::store_special && type == LOWER) + if (Info::store_special && type == LOWER) { return info.get_boundary_property(type, SPECIAL); - else if (std::numeric_limits::has_infinity) + } + else if (std::numeric_limits::has_infinity) { return Parma_Polyhedra_Library::is_minus_infinity(x); - else if (std::numeric_limits::is_bounded) + } + else if (std::numeric_limits::is_bounded) { return x == std::numeric_limits::min(); - else + } + else { return false; + } } template inline bool is_domain_sup(Boundary_Type type, const T& x, const Info& info) { - if (Info::store_special && type == UPPER) + if (Info::store_special && type == UPPER) { return info.get_boundary_property(type, SPECIAL); - else if (std::numeric_limits::has_infinity) + } + else if (std::numeric_limits::has_infinity) { return Parma_Polyhedra_Library::is_plus_infinity(x); - else if (std::numeric_limits::is_bounded) + } + else if (std::numeric_limits::is_bounded) { return x == std::numeric_limits::max(); - else + } + else { return false; + } } template inline bool normal_is_boundary_infinity(Boundary_Type type, const T& x, const Info&) { - if (!std::numeric_limits::has_infinity) + if (!std::numeric_limits::has_infinity) { return false; - if (type == LOWER) + } + if (type == LOWER) { return Parma_Polyhedra_Library::is_minus_infinity(x); - else + } + else { return Parma_Polyhedra_Library::is_plus_infinity(x); + } } template inline bool is_boundary_infinity(Boundary_Type type, const T& x, const Info& info) { - if (Info::store_special) + if (Info::store_special) { return info.get_boundary_property(type, SPECIAL); - else + } + else { return normal_is_boundary_infinity(type, x, info); + } } template inline bool normal_is_reverse_infinity(Boundary_Type type, const T& x, const Info&) { - if (!Info::may_contain_infinity) + if (!Info::may_contain_infinity) { return false; - else if (type == LOWER) + } + else if (type == LOWER) { return Parma_Polyhedra_Library::is_plus_infinity(x); - else + } + else { return Parma_Polyhedra_Library::is_minus_infinity(x); + } } template inline bool is_minus_infinity(Boundary_Type type, const T& x, const Info& info) { if (type == LOWER) { - if (Info::store_special) + if (Info::store_special) { return info.get_boundary_property(type, SPECIAL); - else + } + else { return normal_is_boundary_infinity(type, x, info); + } } - else + else { return !Info::store_special && normal_is_reverse_infinity(type, x, info); + } } template inline bool is_plus_infinity(Boundary_Type type, const T& x, const Info& info) { if (type == UPPER) { - if (Info::store_special) + if (Info::store_special) { return info.get_boundary_property(type, SPECIAL); - else + } + else { return normal_is_boundary_infinity(type, x, info); + } } - else + else { return !Info::store_special && normal_is_reverse_infinity(type, x, info); + } } template @@ -15873,12 +16430,15 @@ template inline int infinity_sign(Boundary_Type type, const T& x, const Info& info) { - if (is_boundary_infinity(type, x, info)) + if (is_boundary_infinity(type, x, info)) { return (type == LOWER) ? -1 : 1; - else if (is_reverse_infinity(type, x, info)) + } + else if (is_reverse_infinity(type, x, info)) { return (type == UPPER) ? -1 : 1; - else + } + else { return 0; + } } template @@ -15899,22 +16459,26 @@ template inline int sgn_b(Boundary_Type type, const T& x, const Info& info) { - if (info.get_boundary_property(type, SPECIAL)) + if (info.get_boundary_property(type, SPECIAL)) { return (type == LOWER) ? -1 : 1; - else + } + else { // The following Parma_Polyhedra_Library:: qualification is to work // around a bug of GCC 4.0.x. return Parma_Polyhedra_Library::sgn(x); + } } template inline int sgn(Boundary_Type type, const T& x, const Info& info) { int sign = sgn_b(type, x, info); - if (x == 0 && info.get_boundary_property(type, OPEN)) + if (x == 0 && info.get_boundary_property(type, OPEN)) { return (type == LOWER) ? -1 : 1; - else + } + else { return sign; + } } template @@ -15923,21 +16487,27 @@ Boundary_Type type2, const T2& x2, const Info2& info2) { if (type1 == type2) { if (is_open(type1, x1, info1) - != is_open(type2, x2, info2)) + != is_open(type2, x2, info2)) { return false; + } } else if (is_open(type1, x1, info1) - || is_open(type2, x2, info2)) + || is_open(type2, x2, info2)) { return false; - if (is_minus_infinity(type1, x1, info1)) + } + if (is_minus_infinity(type1, x1, info1)) { return is_minus_infinity(type2, x2, info2); - else if (is_plus_infinity(type1, x1, info1)) + } + else if (is_plus_infinity(type1, x1, info1)) { return is_plus_infinity(type2, x2, info2); + } else if (is_minus_infinity(type2, x2, info2) - || is_plus_infinity(type2, x2, info2)) + || is_plus_infinity(type2, x2, info2)) { return false; - else + } + else { return equal(x1, x2); + } } template @@ -15947,29 +16517,36 @@ if (is_open(type1, x1, info1)) { if (type1 == UPPER && (type2 == LOWER - || !is_open(type2, x2, info2))) + || !is_open(type2, x2, info2))) { goto le; + } } else if (type2 == LOWER && is_open(type2, x2, info2)) { le: if (is_minus_infinity(type1, x1, info1) - || is_plus_infinity(type2, x2, info2)) + || is_plus_infinity(type2, x2, info2)) { return true; + } if (is_plus_infinity(type1, x1, info1) - || is_minus_infinity(type2, x2, info2)) + || is_minus_infinity(type2, x2, info2)) { return false; - else + } + else { return less_or_equal(x1, x2); + } } if (is_plus_infinity(type1, x1, info1) - || is_minus_infinity(type2, x2, info2)) + || is_minus_infinity(type2, x2, info2)) { return false; + } if (is_minus_infinity(type1, x1, info1) - || is_plus_infinity(type2, x2, info2)) + || is_plus_infinity(type2, x2, info2)) { return true; - else + } + else { return less_than(x1, x2); + } } template @@ -16004,18 +16581,21 @@ open = true; /* Fall through */ case V_EQ_MINUS_INFINITY: - if (!Info::store_special) + if (!Info::store_special) { return r; - if (open) + } + if (open) { info.set_boundary_property(type, OPEN); + } return special_set_boundary_infinity(type, x, info); case V_GT: open = true; /* Fall through */ case V_GE: case V_EQ: - if (open) + if (open) { info.set_boundary_property(type, OPEN); + } return r; default: PPL_UNREACHABLE; @@ -16028,18 +16608,21 @@ open = true; /* Fall through */ case V_EQ_PLUS_INFINITY: - if (!Info::store_special) + if (!Info::store_special) { return r; - if (open) + } + if (open) { info.set_boundary_property(type, OPEN); + } return special_set_boundary_infinity(type, x, info); case V_LT: open = true; /* Fall through */ case V_LE: case V_EQ: - if (open) + if (open) { info.set_boundary_property(type, OPEN); + } return r; default: PPL_UNREACHABLE; @@ -16056,10 +16639,12 @@ bool should_shrink; if (info.get_boundary_property(type, SPECIAL)) { should_shrink = !special_is_open(type, x, info); - if (type == LOWER) + if (type == LOWER) { return set_minus_infinity(to_type, to, to_info, should_shrink); - else + } + else { return set_plus_infinity(to_type, to, to_info, should_shrink); + } } should_shrink = !normal_is_open(type, x, info); bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open)); @@ -16100,10 +16685,12 @@ min_assign(Boundary_Type to_type, To& to, To_Info& to_info, Boundary_Type type1, const T1& x1, const Info1& info1, Boundary_Type type2, const T2& x2, const Info2& info2) { - if (lt(type1, x1, info1, type2, x2, info2)) + if (lt(type1, x1, info1, type2, x2, info2)) { return assign(to_type, to, to_info, type1, x1, info1); - else + } + else { return assign(to_type, to, to_info, type2, x2, info2); + } } template @@ -16122,10 +16709,12 @@ max_assign(Boundary_Type to_type, To& to, To_Info& to_info, Boundary_Type type1, const T1& x1, const Info1& info1, Boundary_Type type2, const T2& x2, const Info2& info2) { - if (gt(type1, x1, info1, type2, x2, info2)) + if (gt(type1, x1, info1, type2, x2, info2)) { return assign(to_type, to, to_info, type1, x1, info1); - else + } + else { return assign(to_type, to, to_info, type2, x2, info2); + } } template @@ -16234,12 +16823,14 @@ Boundary_Type type2, const T2& x2, const Info2& info2, int x2s) { bool should_shrink; if (x1s != 0) { - if (x2s != 0) + if (x2s != 0) { return mul_assign(to_type, to, to_info, type1, x1, info1, type2, x2, info2); - else + } + else { should_shrink = info2.get_boundary_property(type2, OPEN); + } } else { should_shrink = (info1.get_boundary_property(type1, OPEN) @@ -16278,10 +16869,11 @@ Boundary_Type type1, const T1& x1, const Info1& info1, int x1s, Boundary_Type type2, const T2& x2, const Info2& info2, int x2s) { if (x1s != 0) { - if (x2s != 0) + if (x2s != 0) { return div_assign(to_type, to, to_info, type1, x1, info1, type2, x2, info2); + } else { return set_boundary_infinity(to_type, to, to_info, true); } @@ -16332,7 +16924,6 @@ } // namespace Parma_Polyhedra_Library /* Automatically generated from PPL source file ../src/Interval_Info_defs.hh line 28. */ - #include namespace Parma_Polyhedra_Library { @@ -16373,10 +16964,12 @@ template inline void set_bit(T& bits, unsigned int bit, bool value) { - if (value) + if (value) { bits |= static_cast(1) << bit; - else + } + else { reset_bit(bits, bit); + } } template @@ -16452,10 +17045,12 @@ } bool get_boundary_property(Boundary_Type, const Boundary_NS::Property& p) const { - if (p.type == Boundary_NS::Property::OPEN_) + if (p.type == Boundary_NS::Property::OPEN_) { return open; - else + } + else { return Boundary_NS::Property::unsupported_value; + } } void ascii_dump(std::ostream& s) const; @@ -16505,18 +17100,22 @@ switch (p.type) { case Boundary_NS::Property::SPECIAL_: if (store_special) { - if (t == LOWER) + if (t == LOWER) { set_bit(bitset, lower_special_bit, value); - else + } + else { set_bit(bitset, upper_special_bit, value); + } } break; case Boundary_NS::Property::OPEN_: if (store_open) { - if (t == LOWER) + if (t == LOWER) { set_bit(bitset, lower_open_bit, value); - else + } + else { set_bit(bitset, upper_open_bit, value); + } } break; default: @@ -16526,19 +17125,25 @@ bool get_boundary_property(Boundary_Type t, const Boundary_NS::Property& p) const { switch (p.type) { case Boundary_NS::Property::SPECIAL_: - if (!store_special) + if (!store_special) { return false; - if (t == LOWER) + } + if (t == LOWER) { return get_bit(bitset, lower_special_bit); - else + } + else { return get_bit(bitset, upper_special_bit); + } case Boundary_NS::Property::OPEN_: - if (!store_open) + if (!store_open) { return false; - else if (t == LOWER) + } + else if (t == LOWER) { return get_bit(bitset, lower_open_bit); - else + } + else { return get_bit(bitset, upper_open_bit); + } default: return false; } @@ -16546,16 +17151,19 @@ void set_interval_property(const Interval_NS::Property& p, bool value = true) { switch (p.type) { case Interval_NS::Property::CARDINALITY_0_: - if (cache_empty) + if (cache_empty) { set_bit(bitset, cardinality_0_bit, value); + } break; case Interval_NS::Property::CARDINALITY_1_: - if (cache_singleton) + if (cache_singleton) { set_bit(bitset, cardinality_1_bit, value); + } break; case Interval_NS::Property::CARDINALITY_IS_: - if (cache_empty || cache_singleton) + if (cache_empty || cache_singleton) { set_bit(bitset, cardinality_is_bit, value); + } break; default: break; @@ -16622,8 +17230,9 @@ inline bool Interval_Info_Null_Open::ascii_load(std::istream& s) { std::string str; - if (!(s >> str)) + if (!(s >> str)) { return false; + } if (str == "open") { open = true; return true; @@ -16681,14 +17290,11 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Interval_Info_defs.hh line 284. */ +/* Automatically generated from PPL source file ../src/Interval_Info_defs.hh line 300. */ /* Automatically generated from PPL source file ../src/Interval_defs.hh line 33. */ #include -// Temporary! -#include - namespace Parma_Polyhedra_Library { enum Ternary { T_YES, T_NO, T_MAYBE }; @@ -16812,15 +17418,17 @@ I_Constraint lower_constraint() const { PPL_ASSERT(!is_empty()); - if (info().get_boundary_property(LOWER, SPECIAL)) + if (info().get_boundary_property(LOWER, SPECIAL)) { return I_Constraint(); + } return i_constraint(lower_is_open() ? GREATER_THAN : GREATER_OR_EQUAL, lower(), true); } I_Constraint upper_constraint() const { PPL_ASSERT(!is_empty()); - if (info().get_boundary_property(UPPER, SPECIAL)) + if (info().get_boundary_property(UPPER, SPECIAL)) { return I_Constraint(); + } return i_constraint(upper_is_open() ? LESS_THAN : LESS_OR_EQUAL, upper(), true); } @@ -17030,78 +17638,93 @@ //! Assigns to \p *this its topological closure. void topological_closure_assign() { - if (!Info::store_open || is_empty()) + if (!Info::store_open || is_empty()) { return; - if (lower_is_open() && !lower_is_boundary_infinity()) + } + if (lower_is_open() && !lower_is_boundary_infinity()) { info().set_boundary_property(LOWER, OPEN, false); - if (upper_is_open() && !upper_is_boundary_infinity()) + } + if (upper_is_open() && !upper_is_boundary_infinity()) { info().set_boundary_property(UPPER, OPEN, false); + } } void remove_inf() { PPL_ASSERT(!is_empty()); - if (!Info::store_open) + if (!Info::store_open) { return; + } info().set_boundary_property(LOWER, OPEN, true); } void remove_sup() { PPL_ASSERT(!is_empty()); - if (!Info::store_open) + if (!Info::store_open) { return; + } info().set_boundary_property(UPPER, OPEN, true); } int infinity_sign() const { PPL_ASSERT(OK()); - if (is_reverse_infinity(LOWER, lower(), info())) + if (is_reverse_infinity(LOWER, lower(), info())) { return 1; - else if (is_reverse_infinity(UPPER, upper(), info())) + } + else if (is_reverse_infinity(UPPER, upper(), info())) { return -1; - else + } + else { return 0; + } } bool contains_integer_point() const { PPL_ASSERT(OK()); - if (is_empty()) + if (is_empty()) { return false; - if (!is_bounded()) + } + if (!is_bounded()) { return true; + } Boundary l; if (lower_is_open()) { add_assign_r(l, lower(), Boundary(1), ROUND_DOWN); floor_assign_r(l, l, ROUND_DOWN); } - else + else { ceil_assign_r(l, lower(), ROUND_DOWN); + } Boundary u; if (upper_is_open()) { sub_assign_r(u, upper(), Boundary(1), ROUND_UP); ceil_assign_r(u, u, ROUND_UP); } - else + else { floor_assign_r(u, upper(), ROUND_UP); + } return u >= l; } void drop_some_non_integer_points() { - if (is_empty()) + if (is_empty()) { return; + } if (lower_is_open() && !lower_is_boundary_infinity()) { add_assign_r(lower(), lower(), Boundary(1), ROUND_DOWN); floor_assign_r(lower(), lower(), ROUND_DOWN); info().set_boundary_property(LOWER, OPEN, false); } - else + else { ceil_assign_r(lower(), lower(), ROUND_DOWN); + } if (upper_is_open() && !upper_is_boundary_infinity()) { sub_assign_r(upper(), upper(), Boundary(1), ROUND_UP); ceil_assign_r(upper(), upper(), ROUND_UP); info().set_boundary_property(UPPER, OPEN, false); } - else + else { floor_assign_r(upper(), upper(), ROUND_UP); + } } template @@ -17109,14 +17732,17 @@ wrap_assign(Bounded_Integer_Type_Width w, Bounded_Integer_Type_Representation r, const From& refinement) { - if (is_empty()) + if (is_empty()) { return I_EMPTY; - if (lower_is_boundary_infinity() || upper_is_boundary_infinity()) + } + if (lower_is_boundary_infinity() || upper_is_boundary_infinity()) { return assign(refinement); + } PPL_DIRTY_TEMP(Boundary, u); Result result = sub_2exp_assign_r(u, upper(), w, ROUND_UP); - if (result_overflow(result) == 0 && u > lower()) + if (result_overflow(result) == 0 && u > lower()) { return assign(refinement); + } info().clear(); switch (r) { case UNSIGNED: @@ -17135,8 +17761,9 @@ PPL_UNREACHABLE; break; } - if (le(LOWER, lower(), info(), UPPER, upper(), info())) + if (le(LOWER, lower(), info(), UPPER, upper(), info())) { return intersect_assign(refinement); + } PPL_DIRTY_TEMP(Interval, tmp); tmp.info().clear(); Boundary_NS::assign(LOWER, tmp.lower(), tmp.info(), @@ -17536,8 +18163,9 @@ inline typename Enable_If::value || Is_Interval::value, bool>::type check_empty_arg(const T& x) { - if (f_info(x).may_be_empty) + if (f_info(x).may_be_empty) { return f_is_empty(x); + } else { PPL_ASSERT(!f_is_empty(x)); return false; @@ -17555,10 +18183,12 @@ operator==(const T1& x, const T2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return check_empty_arg(y); - else if (check_empty_arg(y)) + } + else if (check_empty_arg(y)) { return false; + } return eq(LOWER, f_lower(x), f_info(x), LOWER, f_lower(y), f_info(y)) && eq(UPPER, f_upper(x), f_info(x), UPPER, f_upper(y), f_info(y)); } @@ -17582,10 +18212,12 @@ Interval::contains(const T& y) const { PPL_ASSERT(OK()); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(y)) + if (check_empty_arg(y)) { return true; - if (check_empty_arg(*this)) + } + if (check_empty_arg(*this)) { return false; + } return le(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y)) && ge(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y)); } @@ -17597,10 +18229,12 @@ Interval::strictly_contains(const T& y) const { PPL_ASSERT(OK()); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(y)) + if (check_empty_arg(y)) { return !check_empty_arg(*this); - if (check_empty_arg(*this)) + } + if (check_empty_arg(*this)) { return false; + } return (lt(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y)) && ge(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y))) || (le(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y)) @@ -17614,8 +18248,9 @@ Interval::is_disjoint_from(const T& y) const { PPL_ASSERT(OK()); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(*this) || check_empty_arg(y)) + if (check_empty_arg(*this) || check_empty_arg(y)) { return true; + } return gt(LOWER, lower(), info(), UPPER, f_upper(y), f_info(y)) || lt(UPPER, upper(), info(), LOWER, f_lower(y), f_info(y)); } @@ -17626,8 +18261,9 @@ || Is_Interval::value, I_Result>::type Interval::assign(const From& x) { PPL_ASSERT(f_OK(x)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return assign(EMPTY); + } PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); const Result rl = Boundary_NS::assign(LOWER, lower(), to_info, @@ -17645,10 +18281,12 @@ || Is_Interval::value, I_Result>::type Interval::join_assign(const From& x) { PPL_ASSERT(f_OK(x)); - if (check_empty_arg(*this)) + if (check_empty_arg(*this)) { return assign(x); - if (check_empty_arg(x)) + } + if (check_empty_arg(x)) { return combine(V_EQ, V_EQ); + } Result rl; Result ru; rl = min_assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)); @@ -17666,10 +18304,12 @@ Interval::join_assign(const From1& x, const From2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return assign(y); - if (check_empty_arg(y)) + } + if (check_empty_arg(y)) { return assign(x); + } PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); Result rl; @@ -17745,15 +18385,17 @@ Interval::difference_assign(const From& x) { PPL_ASSERT(f_OK(x)); if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x)) - || gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) + || gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) { return combine(V_EQ, V_EQ); + } bool nl = ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)); bool nu = le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)); Result rl = V_EQ; Result ru = V_EQ; if (nl) { - if (nu) + if (nu) { return assign(EMPTY); + } else { info().clear_boundary_properties(LOWER); rl = complement(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x)); @@ -17780,15 +18422,17 @@ PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); if (lt(UPPER, f_upper(x), f_info(x), LOWER, f_lower(y), f_info(y)) - || gt(LOWER, f_lower(x), f_info(x), UPPER, f_upper(y), f_info(y))) + || gt(LOWER, f_lower(x), f_info(x), UPPER, f_upper(y), f_info(y))) { return assign(x); + } bool nl = ge(LOWER, f_lower(x), f_info(x), LOWER, f_lower(y), f_info(y)); bool nu = le(UPPER, f_upper(x), f_info(x), UPPER, f_upper(y), f_info(y)); Result rl = V_EQ; Result ru = V_EQ; if (nl) { - if (nu) + if (nu) { return assign(EMPTY); + } else { rl = complement(LOWER, lower(), info(), UPPER, f_upper(y), f_info(y)); ru = Boundary_NS::assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)); @@ -17812,13 +18456,15 @@ ::refine_existential(Relation_Symbol rel, const From& x) { PPL_ASSERT(OK()); PPL_ASSERT(f_OK(x)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return assign(EMPTY); + } switch (rel) { case LESS_THAN: { - if (lt(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) + if (lt(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(UPPER); Boundary_NS::assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x), true); @@ -17826,8 +18472,9 @@ } case LESS_OR_EQUAL: { - if (le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) + if (le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(UPPER); Boundary_NS::assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)); @@ -17835,8 +18482,9 @@ } case GREATER_THAN: { - if (gt(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) + if (gt(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(LOWER); Boundary_NS::assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x), true); @@ -17844,8 +18492,9 @@ } case GREATER_OR_EQUAL: { - if (ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) + if (ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(LOWER); Boundary_NS::assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)); @@ -17855,14 +18504,18 @@ return intersect_assign(x); case NOT_EQUAL: { - if (!f_is_singleton(x)) + if (!f_is_singleton(x)) { return combine(V_EQ, V_EQ); - if (check_empty_arg(*this)) + } + if (check_empty_arg(*this)) { return I_EMPTY; - if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) + } + if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) { remove_inf(); - if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) + } + if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) { remove_sup(); + } return I_ANY; } default: @@ -17879,13 +18532,15 @@ const From& x) { PPL_ASSERT(OK()); PPL_ASSERT(f_OK(x)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return combine(V_EQ, V_EQ); + } switch (rel) { case LESS_THAN: { - if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) + if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(UPPER); Result ru = Boundary_NS::assign(UPPER, upper(), info(), LOWER, f_lower(x), SCALAR_INFO, @@ -17895,8 +18550,9 @@ } case LESS_OR_EQUAL: { - if (le(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) + if (le(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(UPPER); Result ru = Boundary_NS::assign(UPPER, upper(), info(), LOWER, f_lower(x), SCALAR_INFO); @@ -17905,8 +18561,9 @@ } case GREATER_THAN: { - if (gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) + if (gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(LOWER); Result rl = Boundary_NS::assign(LOWER, lower(), info(), UPPER, f_upper(x), SCALAR_INFO, @@ -17916,8 +18573,9 @@ } case GREATER_OR_EQUAL: { - if (ge(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) + if (ge(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) { return combine(V_EQ, V_EQ); + } info().clear_boundary_properties(LOWER); Result rl = Boundary_NS::assign(LOWER, lower(), info(), UPPER, f_upper(x), SCALAR_INFO); @@ -17925,17 +18583,21 @@ return I_ANY; } case EQUAL: - if (!f_is_singleton(x)) + if (!f_is_singleton(x)) { return assign(EMPTY); + } return intersect_assign(x); case NOT_EQUAL: { - if (check_empty_arg(*this)) + if (check_empty_arg(*this)) { return I_EMPTY; - if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) + } + if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) { remove_inf(); - if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) + } + if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) { remove_sup(); + } return I_ANY; } default: @@ -17950,8 +18612,9 @@ || Is_Interval::value, I_Result>::type Interval::neg_assign(const From& x) { PPL_ASSERT(f_OK(x)); - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return assign(EMPTY); + } PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); Result rl; @@ -17974,19 +18637,24 @@ Interval::add_assign(const From1& x, const From2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x) || check_empty_arg(y)) + if (check_empty_arg(x) || check_empty_arg(y)) { return assign(EMPTY); + } int inf_sign = Parma_Polyhedra_Library::infinity_sign(x); if (inf_sign != 0) { - if (Parma_Polyhedra_Library::infinity_sign(y) == -inf_sign) + if (Parma_Polyhedra_Library::infinity_sign(y) == -inf_sign) { return assign(EMPTY); + } } - else + else { inf_sign = Parma_Polyhedra_Library::infinity_sign(y); - if (inf_sign < 0) + } + if (inf_sign < 0) { return assign(MINUS_INFINITY); - else if (inf_sign > 0) + } + else if (inf_sign > 0) { return assign(PLUS_INFINITY); + } PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); Result rl = Boundary_NS::add_assign(LOWER, lower(), to_info, @@ -18009,20 +18677,24 @@ Interval::sub_assign(const From1& x, const From2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x) || check_empty_arg(y)) + if (check_empty_arg(x) || check_empty_arg(y)) { return assign(EMPTY); + } int inf_sign = Parma_Polyhedra_Library::infinity_sign(x); if (inf_sign != 0) { - if (Parma_Polyhedra_Library::infinity_sign(y) == inf_sign) + if (Parma_Polyhedra_Library::infinity_sign(y) == inf_sign) { return assign(EMPTY); + } } - else + else { inf_sign = -Parma_Polyhedra_Library::infinity_sign(y); - if (inf_sign < 0) + } + if (inf_sign < 0) { return assign(MINUS_INFINITY); - else if (inf_sign > 0) + } + else if (inf_sign > 0) { return assign(PLUS_INFINITY); - + } PPL_DIRTY_TEMP(To_Info, to_info); to_info.clear(); Result rl; @@ -18061,8 +18733,9 @@ Interval::mul_assign(const From1& x, const From2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x) || check_empty_arg(y)) + if (check_empty_arg(x) || check_empty_arg(y)) { return assign(EMPTY); + } int xls = sgn_b(LOWER, f_lower(x), f_info(x)); int xus = (xls > 0) ? 1 : sgn_b(UPPER, f_upper(x), f_info(x)); int yls = sgn_b(LOWER, f_lower(y), f_info(y)); @@ -18081,16 +18754,21 @@ ls = xls; us = xus; inf: - if (ls == 0 && us == 0) + if (ls == 0 && us == 0) { return assign(EMPTY); - if (ls == -us) + } + if (ls == -us) { return set_infinities(); - if (ls < 0 || us < 0) + } + if (ls < 0 || us < 0) { inf_sign = -inf_sign; - if (inf_sign < 0) + } + if (inf_sign < 0) { return assign(MINUS_INFINITY); - else + } + else { return assign(PLUS_INFINITY); + } } } @@ -18230,24 +18908,31 @@ Interval::div_assign(const From1& x, const From2& y) { PPL_ASSERT(f_OK(x)); PPL_ASSERT(f_OK(y)); - if (check_empty_arg(x) || check_empty_arg(y)) + if (check_empty_arg(x) || check_empty_arg(y)) { return assign(EMPTY); + } int yls = sgn_b(LOWER, f_lower(y), f_info(y)); int yus = (yls > 0) ? 1 : sgn_b(UPPER, f_upper(y), f_info(y)); - if (yls == 0 && yus == 0) + if (yls == 0 && yus == 0) { return assign(EMPTY); + } int inf_sign = Parma_Polyhedra_Library::infinity_sign(x); if (inf_sign != 0) { - if (Parma_Polyhedra_Library::infinity_sign(y) != 0) + if (Parma_Polyhedra_Library::infinity_sign(y) != 0) { return assign(EMPTY); - if (yls == -yus) + } + if (yls == -yus) { return set_infinities(); - if (yls < 0 || yus < 0) - inf_sign = -inf_sign; - if (inf_sign < 0) + } + if (yls < 0 || yus < 0) { + inf_sign = -inf_sign; + } + if (inf_sign < 0) { return assign(MINUS_INFINITY); - else + } + else { return assign(PLUS_INFINITY); + } } int xls = sgn_b(LOWER, f_lower(x), f_info(x)); int xus = (xls > 0) ? 1 : sgn_b(UPPER, f_upper(x), f_info(x)); @@ -18417,22 +19102,27 @@ template inline std::ostream& operator<<(std::ostream& os, const Interval& x) { - if (check_empty_arg(x)) + if (check_empty_arg(x)) { return os << "[]"; + } if (x.is_singleton()) { output(os, x.lower(), Numeric_Format(), ROUND_NOT_NEEDED); return os; } os << (x.lower_is_open() ? "(" : "["); - if (x.info().get_boundary_property(LOWER, SPECIAL)) + if (x.info().get_boundary_property(LOWER, SPECIAL)) { os << "-inf"; - else + } + else { output(os, x.lower(), Numeric_Format(), ROUND_NOT_NEEDED); + } os << ", "; - if (x.info().get_boundary_property(UPPER, SPECIAL)) + if (x.info().get_boundary_property(UPPER, SPECIAL)) { os << "+inf"; - else + } + else { output(os, x.upper(), Numeric_Format(), ROUND_NOT_NEEDED); + } os << (x.upper_is_open() ? ")" : "]"); return os; } @@ -18455,18 +19145,24 @@ Interval::ascii_load(std::istream& s) { using Parma_Polyhedra_Library::ascii_load; std::string str; - if (!(s >> str) || str != "info") + if (!(s >> str) || str != "info") { return false; - if (!info().ascii_load(s)) + } + if (!info().ascii_load(s)) { return false; - if (!(s >> str) || str != "lower") + } + if (!(s >> str) || str != "lower") { return false; - if (!ascii_load(s, lower())) + } + if (!ascii_load(s, lower())) { return false; - if (!(s >> str) || str != "upper") + } + if (!(s >> str) || str != "upper") { return false; - if (!ascii_load(s, upper())) + } + if (!ascii_load(s, upper())) { return false; + } PPL_ASSERT(OK()); return true; } @@ -18630,11 +19326,13 @@ if (y_ub < x_ub) { Iterator k = std::lower_bound(first, last, x_ub); if (k != last) { - if (x_ub < *k) + if (x_ub < *k) { x_ub = *k; + } } - else + else { x.upper_extend(); + } } } @@ -18647,17 +19345,21 @@ Iterator k = std::lower_bound(first, last, x_lb); if (k != last) { if (x_lb < *k) { - if (k != first) + if (k != first) { x_lb = *--k; - else + } + else { x.lower_extend(); + } } } else { - if (k != first) + if (k != first) { x_lb = *--k; - else + } + else { x.lower_extend(); + } } } } @@ -18700,10 +19402,12 @@ break; case V_EQ_PLUS_INFINITY: // Fall through. case V_LT_PLUS_INFINITY: - if (upper_r == V_EQ_PLUS_INFINITY || upper_r == V_LT_PLUS_INFINITY) + if (upper_r == V_EQ_PLUS_INFINITY || upper_r == V_LT_PLUS_INFINITY) { assign(UNIVERSE); - else + } + else { assign(EMPTY); + } break; default: PPL_UNREACHABLE; @@ -18718,10 +19422,12 @@ break; case V_EQ_MINUS_INFINITY: // Fall through. case V_GT_MINUS_INFINITY: - if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY) + if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY) { assign(UNIVERSE); - else + } + else { assign(EMPTY); + } break; case V_LT_PLUS_INFINITY: upper_open = true; @@ -18737,19 +19443,24 @@ if (!lower_boundary_infinity && !upper_boundary_infinity && (lower_bound > upper_bound - || (lower_open && lower_bound == upper_bound))) + || (lower_open && lower_bound == upper_bound))) { assign(EMPTY); + } else { - if (lower_boundary_infinity) + if (lower_boundary_infinity) { set_minus_infinity(LOWER, lower(), info(), lower_open); - else + } + else { Boundary_NS::assign(LOWER, lower(), info(), LOWER, lower_bound, SCALAR_INFO, lower_open); - if (upper_boundary_infinity) + } + if (upper_boundary_infinity) { set_plus_infinity(UPPER, upper(), info(), upper_open); - else + } + else { Boundary_NS::assign(UPPER, upper(), info(), UPPER, upper_bound, SCALAR_INFO, upper_open); + } } } @@ -18769,56 +19480,67 @@ // Eat leading white space. char c; do { - if (!is.get(c)) + if (!is.get(c)) { goto fail; + } } while (is_space(c)); // Get the opening parenthesis and handle the empty interval case. - if (c == '(') + if (c == '(') { lower_open = true; + } else if (c == '[') { - if (!is.get(c)) + if (!is.get(c)) { goto fail; + } if (c == ']') { // Empty interval. x.assign(EMPTY); return is; } - else + else { is.unget(); + } + } + else { + goto unexpected_char; } - else - goto unexpected; // Get the lower bound. lower_r = input(lower_bound, is, ROUND_DOWN); - if (lower_r == V_CVT_STR_UNK || lower_r == V_NAN) + if (lower_r == V_CVT_STR_UNK || lower_r == V_NAN) { goto fail; + } lower_r = result_relation_class(lower_r); // Match the comma separating the lower and upper bounds. do { - if (!is.get(c)) + if (!is.get(c)) { goto fail; + } } while (is_space(c)); - if (c != ',') - goto unexpected; + if (c != ',') { + goto unexpected_char; + } // Get the upper bound. upper_r = input(upper_bound, is, ROUND_UP); - if (upper_r == V_CVT_STR_UNK || upper_r == V_NAN) + if (upper_r == V_CVT_STR_UNK || upper_r == V_NAN) { goto fail; + } upper_r = result_relation_class(upper_r); // Get the closing parenthesis. do { - if (!is.get(c)) + if (!is.get(c)) { goto fail; + } } while (is_space(c)); - if (c == ')') + if (c == ')') { upper_open = true; + } else if (c != ']') { - unexpected: + unexpected_char: is.unget(); fail: is.setstate(std::ios::failbit); @@ -18841,10 +19563,12 @@ break; case V_EQ_PLUS_INFINITY: // Fall through. case V_LT_PLUS_INFINITY: - if (upper_r == V_EQ_PLUS_INFINITY || upper_r == V_LT_PLUS_INFINITY) + if (upper_r == V_EQ_PLUS_INFINITY || upper_r == V_LT_PLUS_INFINITY) { x.assign(UNIVERSE); - else + } + else { x.assign(EMPTY); + } return is; default: PPL_UNREACHABLE; @@ -18861,10 +19585,12 @@ upper_open = true; // Fall through. case V_EQ_MINUS_INFINITY: - if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY) + if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY) { x.assign(UNIVERSE); - else + } + else { x.assign(EMPTY); + } return is; case V_EQ_PLUS_INFINITY: // Fall through. case V_LT_PLUS_INFINITY: @@ -18878,19 +19604,24 @@ if (!lower_boundary_infinity && !upper_boundary_infinity && (lower_bound > upper_bound - || (lower_open && lower_bound == upper_bound))) + || (lower_open && lower_bound == upper_bound))) { x.assign(EMPTY); + } else { - if (lower_boundary_infinity) + if (lower_boundary_infinity) { set_minus_infinity(LOWER, x.lower(), x.info(), lower_open); - else + } + else { assign(LOWER, x.lower(), x.info(), LOWER, lower_bound, SCALAR_INFO, lower_open); - if (upper_boundary_infinity) + } + if (upper_boundary_infinity) { set_plus_infinity(UPPER, x.upper(), x.info(), upper_open); - else + } + else { assign(UPPER, x.upper(), x.info(), UPPER, upper_bound, SCALAR_INFO, upper_open); + } } return is; } @@ -18910,12 +19641,14 @@ } // Weakening the upper bound. if (!upper_is_boundary_infinity() && !y.upper_is_boundary_infinity() - && y.upper() <= upper()) + && y.upper() <= upper()) { upper_extend(); + } // Weakening the lower bound. if (!lower_is_boundary_infinity() && !y.lower_is_boundary_infinity() - && y.lower() >= lower()) + && y.lower() >= lower()) { lower_extend(); + } return true; } @@ -18929,7 +19662,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Interval_defs.hh line 762. */ +/* Automatically generated from PPL source file ../src/Interval_defs.hh line 780. */ /* Automatically generated from PPL source file ../src/Integer_Interval.hh line 28. */ #include @@ -19072,7 +19805,16 @@ #else -static Parma_Polyhedra_Library::Init* Parma_Polyhedra_Library_initializer_p; +namespace Parma_Polyhedra_Library { + +namespace Implementation { + +void initialize_aux(); +void finalize_aux(); + +} // namespace Implementation + +} // namespace Parma_Polyhedra_Library #endif @@ -19082,8 +19824,7 @@ inline void initialize() { #ifdef PPL_NO_AUTOMATIC_INITIALIZATION - if (Parma_Polyhedra_Library_initializer_p == 0) - Parma_Polyhedra_Library_initializer_p = new Init(); + Implementation::initialize_aux(); #endif } @@ -19091,9 +19832,7 @@ inline void finalize() { #ifdef PPL_NO_AUTOMATIC_INITIALIZATION - PPL_ASSERT(Parma_Polyhedra_Library_initializer_p != 0); - delete Parma_Polyhedra_Library_initializer_p; - Parma_Polyhedra_Library_initializer_p = 0; + Implementation::finalize_aux(); #endif } @@ -19114,23 +19853,36 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Coefficient_defs.hh line 1. */ -/* Coefficient class declaration. +/* Automatically generated from PPL source file ../src/Linear_Expression_Interface_defs.hh line 1. */ +/* Linear_Expression_Interface class declaration. */ -/* Automatically generated from PPL source file ../src/Coefficient_types.hh line 1. */ +/* Automatically generated from PPL source file ../src/Linear_Expression_Interface_types.hh line 1. */ -/* Automatically generated from PPL source file ../src/Coefficient_types.hh line 17. */ +namespace Parma_Polyhedra_Library { + +class Linear_Expression_Interface; + +} // namespace Parma_Polyhedra_Library + +/* Automatically generated from PPL source file ../src/Coefficient_defs.hh line 1. */ +/* Coefficient class declaration. +*/ + + +/* Automatically generated from PPL source file ../src/Coefficient_types.hh line 1. */ + + +/* Automatically generated from PPL source file ../src/Coefficient_types.hh line 17. */ #ifdef PPL_GMP_INTEGERS /* Automatically generated from PPL source file ../src/GMP_Integer_types.hh line 1. */ -/* Automatically generated from PPL source file ../src/GMP_Integer_types.hh line 17. */ +/* Automatically generated from PPL source file ../src/GMP_Integer_types.hh line 18. */ #include -/* Automatically generated from PPL source file ../src/GMP_Integer_types.hh line 19. */ namespace Parma_Polyhedra_Library { @@ -19321,10 +20073,9 @@ } // namespace Parma_Polyhedra_Library /* Automatically generated from PPL source file ../src/Coefficient_defs.hh line 28. */ -#include #if defined(PPL_CHECKED_INTEGERS) || defined(PPL_NATIVE_INTEGERS) -/* Automatically generated from PPL source file ../src/Coefficient_defs.hh line 33. */ +/* Automatically generated from PPL source file ../src/Coefficient_defs.hh line 32. */ #endif #ifdef PPL_GMP_INTEGERS @@ -19539,9 +20290,11 @@ /* Automatically generated from PPL source file ../src/GMP_Integer_defs.hh line 133. */ -/* Automatically generated from PPL source file ../src/Coefficient_defs.hh line 37. */ +/* Automatically generated from PPL source file ../src/Coefficient_defs.hh line 36. */ #endif +#include + namespace Parma_Polyhedra_Library { #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS @@ -19573,8 +20326,9 @@ inline void Bounded_Integer_Coefficient_Policy::handle_result(Result r) { // Note that the input functions can return VC_NAN. - if (result_overflow(r) || result_class(r) == VC_NAN) + if (result_overflow(r) || result_class(r) == VC_NAN) { throw_result_exception(r); + } } #endif // PPL_CHECKED_INTEGERS @@ -19612,12 +20366,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Coefficient_defs.hh line 60. */ - -/* Automatically generated from PPL source file ../src/Variables_Set_defs.hh line 1. */ -/* Variables_Set class declaration. -*/ - +/* Automatically generated from PPL source file ../src/Coefficient_defs.hh line 61. */ /* Automatically generated from PPL source file ../src/Variables_Set_types.hh line 1. */ @@ -19628,6 +20377,487 @@ } // namespace Parma_Polyhedra_Library +/* Automatically generated from PPL source file ../src/Dense_Row_types.hh line 1. */ + + +namespace Parma_Polyhedra_Library { + +class Dense_Row; + +} // namespace Parma_Polyhedra_Library + +/* Automatically generated from PPL source file ../src/Sparse_Row_types.hh line 1. */ + + +namespace Parma_Polyhedra_Library { + +class Sparse_Row; + +} // namespace Parma_Polyhedra_Library + +/* Automatically generated from PPL source file ../src/Linear_Expression_Interface_defs.hh line 33. */ +#include +#include +#include + +#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS +//! A linear expression. +/*! \ingroup PPL_CXX_interface + An object of a class implementing Linear_Expression_Interface + represents a linear expression + \f[ + \sum_{i=0}^{n-1} a_i x_i + b + \f] + where \f$n\f$ is the dimension of the vector space, + each \f$a_i\f$ is the integer coefficient + of the \f$i\f$-th variable \f$x_i\f$ + and \f$b\f$ is the integer for the inhomogeneous term. +*/ +#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) +class Parma_Polyhedra_Library::Linear_Expression_Interface { +public: + virtual ~Linear_Expression_Interface(); + + virtual bool OK() const = 0; + + //! Returns the current representation of this linear expression. + virtual Representation representation() const = 0; + + //! An interface for const iterators on the expression (homogeneous) + //! coefficients that are nonzero. + /*! + These iterators are invalidated by operations that modify the expression. + */ + class const_iterator_interface { + public: + typedef std::bidirectional_iterator_tag iterator_category; + typedef const Coefficient value_type; + typedef std::ptrdiff_t difference_type; + typedef value_type* pointer; + typedef Coefficient_traits::const_reference reference; + + //! Returns a copy of *this. + //! This returns a pointer to dynamic-allocated memory. The caller has the + //! duty to free the memory when it's not needed anymore. + virtual const_iterator_interface* clone() const = 0; + + virtual ~const_iterator_interface(); + + //! Navigates to the next nonzero coefficient. + //! Note that this method does *not* return a reference, to increase + //! efficiency since it's virtual. + virtual void operator++() = 0; + + //! Navigates to the previous nonzero coefficient. + //! Note that this method does *not* return a reference, to increase + //! efficiency since it's virtual. + virtual void operator--() = 0; + + //! Returns the current element. + virtual reference operator*() const = 0; + + //! Returns the variable of the coefficient pointed to by \c *this. + /*! + \returns the variable of the coefficient pointed to by \c *this. + */ + virtual Variable variable() const = 0; + + //! Compares \p *this with x . + /*! + \param x + The %iterator that will be compared with *this. + */ + virtual bool operator==(const const_iterator_interface& x) const = 0; + }; + + //! This returns a pointer to dynamic-allocated memory. The caller has the + //! duty to free the memory when it's not needed anymore. + virtual const_iterator_interface* begin() const = 0; + + //! This returns a pointer to dynamic-allocated memory. The caller has the + //! duty to free the memory when it's not needed anymore. + virtual const_iterator_interface* end() const = 0; + + //! This returns a pointer to dynamic-allocated memory. The caller has the + //! duty to free the memory when it's not needed anymore. + //! Returns (a pointer to) an iterator that points to the first nonzero + //! coefficient of a variable greater than or equal to v, or at end if no + //! such coefficient exists. + virtual const_iterator_interface* lower_bound(Variable v) const = 0; + + //! Returns the dimension of the vector space enclosing \p *this. + virtual dimension_type space_dimension() const = 0; + + //! Sets the dimension of the vector space enclosing \p *this to \p n . + virtual void set_space_dimension(dimension_type n) = 0; + + //! Returns the coefficient of \p v in \p *this. + virtual Coefficient_traits::const_reference + coefficient(Variable v) const = 0; + + //! Sets the coefficient of \p v in \p *this to \p n. + virtual void + set_coefficient(Variable v, Coefficient_traits::const_reference n) = 0; + + //! Returns the inhomogeneous term of \p *this. + virtual Coefficient_traits::const_reference inhomogeneous_term() const = 0; + + //! Sets the inhomogeneous term of \p *this to \p n. + virtual void + set_inhomogeneous_term(Coefficient_traits::const_reference n) = 0; + + //! Linearly combines \p *this with \p y so that the coefficient of \p v + //! is 0. + /*! + \param y + The expression that will be combined with \p *this object; + + \param v + The variable whose coefficient has to become \f$0\f$. + + Computes a linear combination of \p *this and \p y having + the coefficient of variable \p v equal to \f$0\f$. Then it assigns + the resulting expression to \p *this. + + \p *this and \p y must have the same space dimension. + */ + virtual void + linear_combine(const Linear_Expression_Interface& y, Variable v) = 0; + + //! Equivalent to *this = *this * c1 + y * c2, but assumes that + //! \p *this and \p y have the same space dimension. + virtual void linear_combine(const Linear_Expression_Interface& y, + Coefficient_traits::const_reference c1, + Coefficient_traits::const_reference c2) = 0; + + //! Equivalent to *this = *this * c1 + y * c2. + //! c1 and c2 may be 0. + virtual void linear_combine_lax(const Linear_Expression_Interface& y, + Coefficient_traits::const_reference c1, + Coefficient_traits::const_reference c2) = 0; + + //! Swaps the coefficients of the variables \p v1 and \p v2 . + virtual void swap_space_dimensions(Variable v1, Variable v2) = 0; + + //! Removes all the specified dimensions from the expression. + /*! + The space dimension of the variable with the highest space + dimension in \p vars must be at most the space dimension + of \p this. + */ + virtual void remove_space_dimensions(const Variables_Set& vars) = 0; + + //! Shift by \p n positions the coefficients of variables, starting from + //! the coefficient of \p v. This increases the space dimension by \p n. + virtual void shift_space_dimensions(Variable v, dimension_type n) = 0; + + //! Permutes the space dimensions of the expression. + /*! + \param cycle + A vector representing a cycle of the permutation according to which the + space dimensions must be rearranged. + + The \p cycle vector represents a cycle of a permutation of space + dimensions. + For example, the permutation + \f$ \{ x_1 \mapsto x_2, x_2 \mapsto x_3, x_3 \mapsto x_1 \}\f$ can be + represented by the vector containing \f$ x_1, x_2, x_3 \f$. + */ + virtual void + permute_space_dimensions(const std::vector& cycle) = 0; + + //! Returns true if and only if \p *this is \f$0\f$. + virtual bool is_zero() const = 0; + + /*! \brief + Returns true if and only if all the homogeneous + terms of \p *this are \f$0\f$. + */ + virtual bool all_homogeneous_terms_are_zero() const = 0; + + /*! \brief + Returns a lower bound to the total size in bytes of the memory + occupied by \p *this. + */ + virtual memory_size_type total_memory_in_bytes() const = 0; + + //! Returns the size in bytes of the memory managed by \p *this. + virtual memory_size_type external_memory_in_bytes() const = 0; + + //! Writes to \p s an ASCII representation of \p *this. + virtual void ascii_dump(std::ostream& s) const = 0; + + /*! \brief + Loads from \p s an ASCII representation (as produced by + ascii_dump(std::ostream&) const) and sets \p *this accordingly. + Returns true if successful, false otherwise. + */ + virtual bool ascii_load(std::istream& s) = 0; + + //! Returns \p true if *this is equal to \p x. + //! Note that (*this == x) has a completely different meaning. + virtual bool is_equal_to(const Linear_Expression_Interface& x) const = 0; + + //! Normalizes the modulo of the coefficients and of the inhomogeneous term + //! so that they are mutually prime. + /*! + Computes the Greatest Common Divisor (GCD) among the coefficients + and the inhomogeneous term and normalizes them by the GCD itself. + */ + virtual void normalize() = 0; + + //! Ensures that the first nonzero homogeneous coefficient is positive, + //! by negating the row if necessary. + virtual void sign_normalize() = 0; + + /*! \brief + Negates the elements from index \p first (included) + to index \p last (excluded). + */ + virtual void negate(dimension_type first, dimension_type last) = 0; + + virtual Linear_Expression_Interface& + operator+=(Coefficient_traits::const_reference n) = 0; + virtual Linear_Expression_Interface& + operator-=(Coefficient_traits::const_reference n) = 0; + + //! The basic comparison function. + /*! \relates Linear_Expression_Interface + + \returns -1 or -2 if x is less than y, 0 if they are equal and 1 or 2 is y + is greater. The absolute value of the result is 1 if the difference + is only in the inhomogeneous terms, 2 otherwise + + The order is a lexicographic. It starts comparing the variables' + coefficient, starting from Variable(0), and at the end it compares + the inhomogeneous terms. + */ + virtual int compare(const Linear_Expression_Interface& y) const = 0; + + virtual Linear_Expression_Interface& + operator+=(const Linear_Expression_Interface& e2) = 0; + virtual Linear_Expression_Interface& + operator+=(const Variable v) = 0; + virtual Linear_Expression_Interface& + operator-=(const Linear_Expression_Interface& e2) = 0; + virtual Linear_Expression_Interface& + operator-=(const Variable v) = 0; + virtual Linear_Expression_Interface& + operator*=(Coefficient_traits::const_reference n) = 0; + virtual Linear_Expression_Interface& + operator/=(Coefficient_traits::const_reference n) = 0; + + virtual void negate() = 0; + + virtual Linear_Expression_Interface& + add_mul_assign(Coefficient_traits::const_reference n, const Variable v) = 0; + + virtual Linear_Expression_Interface& + sub_mul_assign(Coefficient_traits::const_reference n, const Variable v) = 0; + + virtual void add_mul_assign(Coefficient_traits::const_reference factor, + const Linear_Expression_Interface& e2) = 0; + + virtual void sub_mul_assign(Coefficient_traits::const_reference factor, + const Linear_Expression_Interface& e2) = 0; + + virtual void print(std::ostream& s) const = 0; + + /*! \brief + Returns true if the coefficient of each variable in + \p vars[i] is \f$0\f$. + */ + virtual bool all_zeroes(const Variables_Set& vars) const = 0; + + //! Returns true if there is a variable in [first,last) whose coefficient + //! is nonzero in both *this and x. + virtual bool have_a_common_variable(const Linear_Expression_Interface& x, + Variable first, Variable last) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Returns the i-th coefficient. + virtual Coefficient_traits::const_reference get(dimension_type i) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Sets the i-th coefficient to n. + virtual void set(dimension_type i, Coefficient_traits::const_reference n) = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + /*! \brief + Returns true if (*this)[i] is \f$0\f$, for each i in + [start, end). + */ + virtual bool all_zeroes(dimension_type start, dimension_type end) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + /*! \brief + Returns the number of zero coefficient in [start, end). + */ + virtual dimension_type + num_zeroes(dimension_type start, dimension_type end) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + /*! \brief + Returns the gcd of the nonzero coefficients in [start,end). If all the + coefficients in this range are 0 returns 0. + */ + virtual Coefficient gcd(dimension_type start, dimension_type end) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + virtual void exact_div_assign(Coefficient_traits::const_reference c, + dimension_type start, dimension_type end) = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Equivalent to (*this)[i] *= n, for each i in [start, end). + virtual void mul_assign(Coefficient_traits::const_reference n, + dimension_type start, dimension_type end) = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Linearly combines \p *this with \p y so that the coefficient of \p v + //! is 0. + /*! + \param y + The expression that will be combined with \p *this object; + + \param i + The index of the coefficient that has to become \f$0\f$. + + Computes a linear combination of \p *this and \p y having + the i-th coefficient equal to \f$0\f$. Then it assigns + the resulting expression to \p *this. + + \p *this and \p y must have the same space dimension. + */ + virtual void + linear_combine(const Linear_Expression_Interface& y, dimension_type i) = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Equivalent to (*this)[i] = (*this)[i] * c1 + y[i] * c2, + //! for each i in [start, end). + virtual void linear_combine(const Linear_Expression_Interface& y, + Coefficient_traits::const_reference c1, + Coefficient_traits::const_reference c2, + dimension_type start, dimension_type end) = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Equivalent to (*this)[i] = (*this)[i] * c1 + y[i] * c2, + //! for each i in [start, end). c1 and c2 may be zero. + virtual void linear_combine_lax(const Linear_Expression_Interface& y, + Coefficient_traits::const_reference c1, + Coefficient_traits::const_reference c2, + dimension_type start, dimension_type end) = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Returns the index of the last nonzero element, or 0 if there are no + //! nonzero elements. + virtual dimension_type last_nonzero() const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Returns the index of the last nonzero element in [first,last), or last + //! if there are no nonzero elements. + virtual dimension_type + last_nonzero(dimension_type first, dimension_type last) const = 0; + + //! Returns the index of the first nonzero element, or \p last if there are no + //! nonzero elements, considering only elements in [first,last). + virtual dimension_type + first_nonzero(dimension_type first, dimension_type last) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + /*! \brief + Returns true if each coefficient in [start,end) is *not* in + \f$0\f$, disregarding coefficients of variables in \p vars. + */ + virtual bool + all_zeroes_except(const Variables_Set& vars, + dimension_type start, dimension_type end) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Sets results to the sum of (*this)[i]*y[i], for each i in [start,end). + virtual void + scalar_product_assign(Coefficient& result, + const Linear_Expression_Interface& y, + dimension_type start, dimension_type end) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Computes the sign of the sum of (*this)[i]*y[i], + //! for each i in [start,end). + virtual int + scalar_product_sign(const Linear_Expression_Interface& y, + dimension_type start, dimension_type end) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Removes from the set x all the indexes of nonzero elements of *this. + virtual void + has_a_free_dimension_helper(std::set& x) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Returns \p true if (*this)[i] is equal to x[i], for each i in [start,end). + virtual bool is_equal_to(const Linear_Expression_Interface& x, + dimension_type start, dimension_type end) const = 0; + + // NOTE: This method is public, but it's not exposed in Linear_Expression, + // so that it can be used internally in the PPL, by friends of + // Linear_Expression. + //! Returns \p true if (*this)[i]*c1 is equal to x[i]*c2, for each i in + //! [start,end). + virtual bool is_equal_to(const Linear_Expression_Interface& x, + Coefficient_traits::const_reference c1, + Coefficient_traits::const_reference c2, + dimension_type start, dimension_type end) const = 0; + + // NOTE: This method is public, but it is not exposed in + // Linear_Expression, so that it can be used internally in the PPL, + // by friends of Linear_Expression. + //! Sets \p r to a copy of the row that implements \p *this. + virtual void get_row(Dense_Row& r) const = 0; + + // NOTE: This method is public, but it is not exposed in + // Linear_Expression, so that it can be used internally in the PPL, + // by friends of Linear_Expression. + //! Sets \p r to a copy of the row that implements \p *this. + virtual void get_row(Sparse_Row& r) const = 0; +}; + +/* Automatically generated from PPL source file ../src/Variables_Set_defs.hh line 1. */ +/* Variables_Set class declaration. +*/ + + /* Automatically generated from PPL source file ../src/Variables_Set_defs.hh line 30. */ #include #include @@ -19764,32 +20994,15 @@ */ -/* Automatically generated from PPL source file ../src/Dense_Row_types.hh line 1. */ - - -namespace Parma_Polyhedra_Library { - -class Dense_Row; - -} // namespace Parma_Polyhedra_Library - /* Automatically generated from PPL source file ../src/Dense_Row_defs.hh line 28. */ /* Automatically generated from PPL source file ../src/Dense_Row_defs.hh line 30. */ -/* Automatically generated from PPL source file ../src/Sparse_Row_types.hh line 1. */ - - -namespace Parma_Polyhedra_Library { - -class Sparse_Row; - -} // namespace Parma_Polyhedra_Library - /* Automatically generated from PPL source file ../src/Dense_Row_defs.hh line 33. */ #include #include #include +#include #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS //! A finite sequence of coefficients. @@ -20190,12 +21403,12 @@ typedef std::bidirectional_iterator_tag iterator_category; typedef Coefficient value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef value_type& reference; iterator(); - iterator(Dense_Row& row1, dimension_type i1); + iterator(Dense_Row& r, dimension_type i); Coefficient& operator*(); Coefficient_traits::const_reference operator*() const; @@ -20224,19 +21437,19 @@ private: Dense_Row* row; - dimension_type i; + dimension_type idx; }; class Parma_Polyhedra_Library::Dense_Row::const_iterator { public: typedef const Coefficient value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef Coefficient_traits::const_reference reference; const_iterator(); - const_iterator(const Dense_Row& row1, dimension_type i1); + const_iterator(const Dense_Row& r, dimension_type i); Coefficient_traits::const_reference operator*() const; @@ -20262,7 +21475,7 @@ private: const Dense_Row* row; - dimension_type i; + dimension_type idx; }; @@ -20390,7 +21603,7 @@ impl.capacity = y.capacity(); impl.vec = impl.coeff_allocator.allocate(impl.capacity); while (impl.size != y.size()) { - new (&impl.vec[impl.size]) Coefficient(y[impl.size]); + new(&impl.vec[impl.size]) Coefficient(y[impl.size]); ++impl.size; } } @@ -20412,7 +21625,7 @@ if (y.impl.vec != 0) { while (impl.size != y.size()) { - new (&impl.vec[impl.size]) Coefficient(y[impl.size]); + new(&impl.vec[impl.size]) Coefficient(y[impl.size]); ++impl.size; } } @@ -20437,11 +21650,11 @@ const dimension_type n = std::min(sz, y.size()); while (impl.size != n) { - new (&impl.vec[impl.size]) Coefficient(y[impl.size]); + new(&impl.vec[impl.size]) Coefficient(y[impl.size]); ++impl.size; } while (impl.size != sz) { - new (&impl.vec[impl.size]) Coefficient(); + new(&impl.vec[impl.size]) Coefficient(); ++impl.size; } @@ -20478,8 +21691,9 @@ if (this != &y && size() == y.size()) { // Avoid reallocation. - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { (*this)[i] = y[i]; + } return *this; } @@ -20638,37 +21852,37 @@ inline Dense_Row::iterator::iterator() - : row(NULL), i(0) { + : row(NULL), idx(0) { PPL_ASSERT(OK()); } inline -Dense_Row::iterator::iterator(Dense_Row& row1,dimension_type i1) - : row(&row1), i(i1) { +Dense_Row::iterator::iterator(Dense_Row& r, dimension_type i) + : row(&r), idx(i) { PPL_ASSERT(OK()); } inline Coefficient& Dense_Row::iterator::operator*() { - PPL_ASSERT(i < row->size()); - return (*row)[i]; + PPL_ASSERT(idx < row->size()); + return (*row)[idx]; } inline Coefficient_traits::const_reference Dense_Row::iterator::operator*() const { - PPL_ASSERT(i < row->size()); - return (*row)[i]; + PPL_ASSERT(idx < row->size()); + return (*row)[idx]; } inline dimension_type Dense_Row::iterator::index() const { - return i; + return idx; } inline Dense_Row::iterator& Dense_Row::iterator::operator++() { - PPL_ASSERT(i < row->size()); - ++i; + PPL_ASSERT(idx < row->size()); + ++idx; PPL_ASSERT(OK()); return *this; } @@ -20682,8 +21896,8 @@ inline Dense_Row::iterator& Dense_Row::iterator::operator--() { - PPL_ASSERT(i > 0); - --i; + PPL_ASSERT(idx > 0); + --idx; PPL_ASSERT(OK()); return *this; } @@ -20697,7 +21911,7 @@ inline bool Dense_Row::iterator::operator==(const iterator& x) const { - return (row == x.row) && (i == x.i); + return (row == x.row) && (idx == x.idx); } inline bool @@ -20707,46 +21921,47 @@ inline Dense_Row::iterator::operator const_iterator() const { - return const_iterator(*row, i); + return const_iterator(*row, idx); } inline bool Dense_Row::iterator::OK() const { - if (row == NULL) + if (row == NULL) { return true; + } // i can be equal to row.size() for past-the-end iterators - return (i <= row->size()); + return (idx <= row->size()); } inline Dense_Row::const_iterator::const_iterator() - : row(NULL), i(0) { + : row(NULL), idx(0) { PPL_ASSERT(OK()); } inline -Dense_Row::const_iterator::const_iterator(const Dense_Row& row1, - dimension_type i1) - : row(&row1), i(i1) { +Dense_Row::const_iterator::const_iterator(const Dense_Row& r, + dimension_type i) + : row(&r), idx(i) { PPL_ASSERT(OK()); } inline Coefficient_traits::const_reference Dense_Row::const_iterator::operator*() const { - PPL_ASSERT(i < row->size()); - return (*row)[i]; + PPL_ASSERT(idx < row->size()); + return (*row)[idx]; } inline dimension_type Dense_Row::const_iterator::index() const { - return i; + return idx; } inline Dense_Row::const_iterator& Dense_Row::const_iterator::operator++() { - PPL_ASSERT(i < row->size()); - ++i; + PPL_ASSERT(idx < row->size()); + ++idx; PPL_ASSERT(OK()); return *this; } @@ -20760,8 +21975,8 @@ inline Dense_Row::const_iterator& Dense_Row::const_iterator::operator--() { - PPL_ASSERT(i > 0); - --i; + PPL_ASSERT(idx > 0); + --idx; PPL_ASSERT(OK()); return *this; } @@ -20775,7 +21990,7 @@ inline bool Dense_Row::const_iterator::operator==(const const_iterator& x) const { - return (row == x.row) && (i == x.i); + return (row == x.row) && (idx == x.idx); } inline bool @@ -20785,10 +22000,11 @@ inline bool Dense_Row::const_iterator::OK() const { - if (row == NULL) + if (row == NULL) { return true; + } // i can be equal to row.size() for past-the-end iterators - return (i <= row->size()); + return (idx <= row->size()); } inline void @@ -20833,29 +22049,32 @@ void Dense_Row::combine_needs_first(const Dense_Row& y, const Func1& /* f */, const Func2& g) { - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { g((*this)[i], y[i]); + } } template void Dense_Row::combine_needs_second(const Dense_Row& y, const Func1& g, const Func2& /* h */) { - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { g((*this)[i], y[i]); + } } template void Dense_Row::combine(const Dense_Row& y, const Func1& /* f */, const Func2& g, const Func3& /* h */) { - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { g((*this)[i], y[i]); + } } } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Dense_Row_defs.hh line 560. */ +/* Automatically generated from PPL source file ../src/Dense_Row_defs.hh line 561. */ /* Automatically generated from PPL source file ../src/Sparse_Row_defs.hh line 1. */ /* Sparse_Row class declaration. @@ -20882,6 +22101,7 @@ /* Automatically generated from PPL source file ../src/CO_Tree_defs.hh line 30. */ #include +#include #ifndef PPL_CO_TREE_EXTRA_DEBUG #ifdef PPL_ABI_BREAKING_EXTRA_DEBUG @@ -21013,7 +22233,7 @@ typedef std::bidirectional_iterator_tag iterator_category; typedef const data_type value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef data_type_const_reference reference; @@ -21168,7 +22388,7 @@ typedef std::bidirectional_iterator_tag iterator_category; typedef data_type value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef value_type& reference; @@ -22412,6 +23632,8 @@ */ +#include + namespace Parma_Polyhedra_Library { inline dimension_type @@ -22419,7 +23641,7 @@ PPL_ASSERT(itr.current_index != 0); PPL_ASSERT(itr.current_index >= indexes + 1); PPL_ASSERT(itr.current_index <= indexes + reserved_size); - const ptrdiff_t index = itr.current_index - indexes; + const std::ptrdiff_t index = itr.current_index - indexes; return static_cast(index); } @@ -22428,7 +23650,7 @@ PPL_ASSERT(itr.current_index != 0); PPL_ASSERT(itr.current_index >= indexes + 1); PPL_ASSERT(itr.current_index <= indexes + reserved_size); - const ptrdiff_t index = itr.current_index - indexes; + const std::ptrdiff_t index = itr.current_index - indexes; return static_cast(index); } @@ -22485,23 +23707,28 @@ inline void CO_Tree::dump_tree() const { - if (empty()) + if (empty()) { std::cout << "(empty tree)" << std::endl; - else + } + else { dump_subtree(tree_iterator(*const_cast(this))); + } } inline CO_Tree::iterator CO_Tree::insert(const dimension_type key) { - if (empty()) + if (empty()) { return insert(key, Coefficient_zero()); + } else { tree_iterator itr(*this); itr.go_down_searching_key(key); - if (itr.index() == key) + if (itr.index() == key) { return iterator(itr); - else + } + else { return iterator(insert_precise(key, Coefficient_zero(), itr)); + } } } @@ -22524,18 +23751,21 @@ CO_Tree::erase(dimension_type key) { PPL_ASSERT(key != unused_index); - if (empty()) + if (empty()) { return end(); + } tree_iterator itr(*this); itr.go_down_searching_key(key); - if (itr.index() == key) + if (itr.index() == key) { return erase(itr); + } iterator result(itr); - if (result.index() < key) + if (result.index() < key) { ++result; + } PPL_ASSERT(result == end() || result.index() > key); #ifndef NDEBUG @@ -22602,8 +23832,9 @@ inline CO_Tree::iterator CO_Tree::bisect(dimension_type key) { - if (empty()) + if (empty()) { return end(); + } iterator last = end(); --last; return bisect_in(begin(), last, key); @@ -22611,8 +23842,9 @@ inline CO_Tree::const_iterator CO_Tree::bisect(dimension_type key) const { - if (empty()) + if (empty()) { return end(); + } const_iterator last = end(); --last; return bisect_in(begin(), last, key); @@ -22639,8 +23871,9 @@ inline CO_Tree::iterator CO_Tree::bisect_near(iterator hint, dimension_type key) { - if (hint == end()) + if (hint == end()) { return bisect(key); + } const dimension_type index = bisect_near(dfs_index(hint), key); return iterator(*this, index); @@ -22648,8 +23881,9 @@ inline CO_Tree::const_iterator CO_Tree::bisect_near(const_iterator hint, dimension_type key) const { - if (hint == end()) + if (hint == end()) { return bisect(key); + } const dimension_type index = bisect_near(dfs_index(hint), key); return const_iterator(*this, index); } @@ -22669,7 +23903,7 @@ rebuild_bigger_tree(); tree_iterator itr(*this); PPL_ASSERT(itr.index() == unused_index); - new (&(*itr)) data_type(data1); + new(&(*itr)) data_type(data1); // Set the index afterwards, so that if the constructor above throws // the tree's structure is consistent. itr.index() = key; @@ -22717,12 +23951,14 @@ inline void CO_Tree::move_data_element(data_type& to, data_type& from) { - // The following code is equivalent (but slower): - // - // - // new (&to) data_type(from); - // from.~data_type(); - // + /* + The following code is equivalent (but slower): + + + new(&to) data_type(from); + from.~data_type(); + + */ std::memcpy(&to, &from, sizeof(data_type)); } @@ -22742,11 +23978,12 @@ #if PPL_CO_TREE_EXTRA_DEBUG tree = &tree1; #endif - if (!tree1.empty()) + if (!tree1.empty()) { while (*current_index == unused_index) { ++current_index; ++current_data; } + } PPL_ASSERT(OK()); } @@ -22905,11 +24142,12 @@ #if PPL_CO_TREE_EXTRA_DEBUG tree = &tree1; #endif - if (!tree1.empty()) + if (!tree1.empty()) { while (*current_index == unused_index) { ++current_index; ++current_data; } + } PPL_ASSERT(OK()); } @@ -23158,9 +24396,10 @@ const dimension_type* p = tree.indexes; p += i; p -= (offset - 1); - while (*p == unused_index) + while (*p == unused_index) { ++p; - const ptrdiff_t distance = p - tree.indexes; + } + const std::ptrdiff_t distance = p - tree.indexes; PPL_ASSERT(distance >= 0); i = static_cast(distance); offset = least_significant_one_mask(i); @@ -23173,9 +24412,10 @@ const dimension_type* p = tree.indexes; p += i; p += (offset - 1); - while (*p == unused_index) + while (*p == unused_index) { --p; - const ptrdiff_t distance = p - tree.indexes; + } + const std::ptrdiff_t distance = p - tree.indexes; PPL_ASSERT(distance >= 0); i = static_cast(distance); offset = least_significant_one_mask(i); @@ -23191,8 +24431,9 @@ inline bool CO_Tree::tree_iterator::is_right_child() const { - if (is_root()) + if (is_root()) { return false; + } return (i & (2*offset)) != 0; } @@ -23273,8 +24514,9 @@ reserved_size = (static_cast(1) << new_max_depth) - 1; if (is_greater_than_ratio(n, reserved_size, max_density_percent) - && reserved_size != 3) + && reserved_size != 3) { reserved_size = reserved_size*2 + 1; + } init(reserved_size); @@ -23349,7 +24591,7 @@ if (top_n == 1) { PPL_ASSERT(root.index() == unused_index); root.index() = i.index(); - new (&(*root)) data_type(*i); + new(&(*root)) data_type(*i); ++i; --stack_first_empty; } @@ -23372,7 +24614,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/CO_Tree_defs.hh line 1558. */ +/* Automatically generated from PPL source file ../src/CO_Tree_defs.hh line 1559. */ /* Automatically generated from PPL source file ../src/Sparse_Row_defs.hh line 32. */ @@ -24325,8 +25567,9 @@ inline void Sparse_Row::resize(dimension_type n) { - if (n < size_) + if (n < size_) { reset_after(n); + } size_ = n; PPL_ASSERT(OK()); } @@ -24414,13 +25657,16 @@ inline Coefficient_traits::const_reference Sparse_Row::get(dimension_type i) const { PPL_ASSERT(i < size_); - if (tree.empty()) + if (tree.empty()) { return Coefficient_zero(); + } const_iterator itr = find(i); - if (itr != end()) + if (itr != end()) { return *itr; - else + } + else { return Coefficient_zero(); + } } inline Sparse_Row::iterator @@ -24429,9 +25675,9 @@ iterator itr = tree.bisect(i); - if (itr != end() && itr.index() == i) + if (itr != end() && itr.index() == i) { return itr; - + } return end(); } @@ -24441,9 +25687,9 @@ iterator itr = tree.bisect_near(hint, i); - if (itr != end() && itr.index() == i) + if (itr != end() && itr.index() == i) { return itr; - + } return end(); } @@ -24453,8 +25699,9 @@ const_iterator itr = tree.bisect(i); - if (itr != end() && itr.index() == i) + if (itr != end() && itr.index() == i) { return itr; + } return end(); } @@ -24465,9 +25712,9 @@ const_iterator itr = tree.bisect_near(hint, i); - if (itr != end() && itr.index() == i) + if (itr != end() && itr.index() == i) { return itr; - + } return end(); } @@ -24477,11 +25724,13 @@ iterator itr = tree.bisect(i); - if (itr == end()) + if (itr == end()) { return end(); + } - if (itr.index() < i) + if (itr.index() < i) { ++itr; + } PPL_ASSERT(itr == end() || itr.index() >= i); @@ -24494,11 +25743,13 @@ iterator itr = tree.bisect_near(hint, i); - if (itr == end()) + if (itr == end()) { return end(); + } - if (itr.index() < i) + if (itr.index() < i) { ++itr; + } PPL_ASSERT(itr == end() || itr.index() >= i); @@ -24511,11 +25762,13 @@ const_iterator itr = tree.bisect(i); - if (itr == end()) + if (itr == end()) { return end(); + } - if (itr.index() < i) + if (itr.index() < i) { ++itr; + } PPL_ASSERT(itr == end() || itr.index() >= i); @@ -24528,11 +25781,13 @@ const_iterator itr = tree.bisect_near(hint, i); - if (itr == end()) + if (itr == end()) { return end(); + } - if (itr.index() < i) + if (itr.index() < i) { ++itr; + } PPL_ASSERT(itr == end() || itr.index() >= i); @@ -24542,697 +25797,245 @@ inline Sparse_Row::iterator Sparse_Row::insert(dimension_type i, Coefficient_traits::const_reference x) { PPL_ASSERT(i < size_); - return tree.insert(i, x); -} - -inline Sparse_Row::iterator -Sparse_Row::insert(iterator itr, dimension_type i, - Coefficient_traits::const_reference x) { - PPL_ASSERT(i < size_); - return tree.insert(itr, i, x); -} - -inline Sparse_Row::iterator -Sparse_Row::insert(dimension_type i) { - PPL_ASSERT(i < size_); - return tree.insert(i); -} - -inline Sparse_Row::iterator -Sparse_Row::insert(iterator itr, dimension_type i) { - PPL_ASSERT(i < size_); - return tree.insert(itr, i); -} - -inline void -Sparse_Row::swap_coefficients(iterator i, iterator j) { - PPL_ASSERT(i != end()); - PPL_ASSERT(j != end()); - using std::swap; - swap(*i, *j); - PPL_ASSERT(OK()); -} - -inline void -Sparse_Row::fast_swap(dimension_type i, iterator itr) { - PPL_ASSERT(lower_bound(i) == itr); - PPL_ASSERT(itr != end()); - tree.fast_shift(i, itr); - PPL_ASSERT(OK()); -} - -inline Sparse_Row::iterator -Sparse_Row::reset(iterator i) { - iterator res = tree.erase(i); - PPL_ASSERT(OK()); - return res; -} - -inline void -Sparse_Row::reset(dimension_type i) { - PPL_ASSERT(i < size()); - - tree.erase(i); - PPL_ASSERT(OK()); -} - -inline memory_size_type -Sparse_Row::external_memory_in_bytes() const { - return tree.external_memory_in_bytes(); -} - -inline memory_size_type -Sparse_Row::external_memory_in_bytes(dimension_type /* capacity */) const { - return external_memory_in_bytes(); -} - -inline memory_size_type -Sparse_Row::total_memory_in_bytes() const { - return external_memory_in_bytes() + sizeof(*this); -} - -inline memory_size_type -Sparse_Row::total_memory_in_bytes(dimension_type /* capacity */) const { - return total_memory_in_bytes(); -} - -#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS -/*! \relates Sparse_Row */ -#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) -inline void -swap(Sparse_Row& x, Sparse_Row& y) { - x.m_swap(y); -} - -} // namespace Parma_Polyhedra_Library - -/* Automatically generated from PPL source file ../src/Sparse_Row_templates.hh line 1. */ -/* Sparse_Row class implementation: non-inline template functions. -*/ - - -namespace Parma_Polyhedra_Library { - - -template -void -Sparse_Row::combine_needs_first(const Sparse_Row& y, - const Func1& f, const Func2& g) { - if (this == &y) { - for (iterator i = begin(), i_end = end(); i != i_end; ++i) - g(*i, *i); - } - else { - iterator i = begin(); - // This is a const reference to an internal iterator, that is kept valid. - // If we just stored a copy, that would be invalidated by the calls to - // reset(). - const iterator& i_end = end(); - const_iterator j = y.begin(); - const_iterator j_end = y.end(); - while (i != i_end && j != j_end) - if (i.index() == j.index()) { - g(*i, *j); - if (*i == 0) - i = reset(i); - else - ++i; - ++j; - } - else - if (i.index() < j.index()) { - f(*i); - if (*i == 0) - i = reset(i); - else - ++i; - } - else - j = y.lower_bound(j, i.index()); - while (i != i_end) { - f(*i); - if (*i == 0) - i = reset(i); - else - ++i; - } - } -} - -template -void -Sparse_Row::combine_needs_second(const Sparse_Row& y, - const Func1& g, - const Func2& /* h */) { - iterator i = begin(); - for (const_iterator j = y.begin(), j_end = y.end(); j != j_end; ++j) { - i = insert(i, j.index()); - g(*i, *j); - if (*i == 0) - i = reset(i); - } -} - -template -void -Sparse_Row::combine(const Sparse_Row& y, const Func1& f, - const Func2& g, const Func3& h) { - if (this == &y) { - for (iterator i = begin(), i_end = end(); i != i_end; ++i) - g(*i, *i); - } - else { - iterator i = begin(); - // This is a const reference to an internal iterator, that is kept valid. - // If we just stored a copy, that would be invalidated by the calls to - // reset() and insert(). - const iterator& i_end = end(); - const_iterator j = y.begin(); - const_iterator j_end = y.end(); - while (i != i_end && j != j_end) { - if (i.index() == j.index()) { - g(*i, *j); - if (*i == 0) - i = reset(i); - else - ++i; - ++j; - } - else - if (i.index() < j.index()) { - f(*i); - if (*i == 0) - i = reset(i); - else - ++i; - } - else { - PPL_ASSERT(i.index() > j.index()); - i = insert(i, j.index()); - h(*i, *j); - if (*i == 0) - i = reset(i); - else - ++i; - ++j; - } - } - PPL_ASSERT(i == i_end || j == j_end); - while (i != i_end) { - f(*i); - if (*i == 0) - i = reset(i); - else - ++i; - } - while (j != j_end) { - i = insert(i, j.index()); - h(*i, *j); - if (*i == 0) - i = reset(i); - ++j; - } - } -} - -} // namespace Parma_Polyhedra_Library - -/* Automatically generated from PPL source file ../src/Sparse_Row_defs.hh line 929. */ - -/* Automatically generated from PPL source file ../src/Linear_Expression_Impl_defs.hh line 33. */ -#include -/* Automatically generated from PPL source file ../src/Linear_Expression_Interface_defs.hh line 1. */ -/* Linear_Expression_Interface class declaration. -*/ - - -/* Automatically generated from PPL source file ../src/Linear_Expression_Interface_types.hh line 1. */ - - -namespace Parma_Polyhedra_Library { - -class Linear_Expression_Interface; - -} // namespace Parma_Polyhedra_Library - -/* Automatically generated from PPL source file ../src/Linear_Expression_Interface_defs.hh line 33. */ -#include -#include - -#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS -//! A linear expression. -/*! \ingroup PPL_CXX_interface - An object of a class implementing Linear_Expression_Interface - represents a linear expression - \f[ - \sum_{i=0}^{n-1} a_i x_i + b - \f] - where \f$n\f$ is the dimension of the vector space, - each \f$a_i\f$ is the integer coefficient - of the \f$i\f$-th variable \f$x_i\f$ - and \f$b\f$ is the integer for the inhomogeneous term. -*/ -#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) -class Parma_Polyhedra_Library::Linear_Expression_Interface { -public: - virtual ~Linear_Expression_Interface(); - - virtual bool OK() const = 0; - - //! Returns the current representation of this linear expression. - virtual Representation representation() const = 0; - - //! An interface for const iterators on the expression (homogeneous) - //! coefficients that are nonzero. - /*! - These iterators are invalidated by operations that modify the expression. - */ - class const_iterator_interface { - public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef const Coefficient value_type; - typedef ptrdiff_t difference_type; - typedef value_type* pointer; - typedef Coefficient_traits::const_reference reference; - - //! Returns a copy of *this. - //! This returns a pointer to dynamic-allocated memory. The caller has the - //! duty to free the memory when it's not needed anymore. - virtual const_iterator_interface* clone() const = 0; - - virtual ~const_iterator_interface(); - - //! Navigates to the next nonzero coefficient. - //! Note that this method does *not* return a reference, to increase - //! efficiency since it's virtual. - virtual void operator++() = 0; - - //! Navigates to the previous nonzero coefficient. - //! Note that this method does *not* return a reference, to increase - //! efficiency since it's virtual. - virtual void operator--() = 0; - - //! Returns the current element. - virtual reference operator*() const = 0; - - //! Returns the variable of the coefficient pointed to by \c *this. - /*! - \returns the variable of the coefficient pointed to by \c *this. - */ - virtual Variable variable() const = 0; - - //! Compares \p *this with x . - /*! - \param x - The %iterator that will be compared with *this. - */ - virtual bool operator==(const const_iterator_interface& x) const = 0; - }; - - //! This returns a pointer to dynamic-allocated memory. The caller has the - //! duty to free the memory when it's not needed anymore. - virtual const_iterator_interface* begin() const = 0; - - //! This returns a pointer to dynamic-allocated memory. The caller has the - //! duty to free the memory when it's not needed anymore. - virtual const_iterator_interface* end() const = 0; - - //! This returns a pointer to dynamic-allocated memory. The caller has the - //! duty to free the memory when it's not needed anymore. - //! Returns (a pointer to) an iterator that points to the first nonzero - //! coefficient of a variable greater than or equal to v, or at end if no - //! such coefficient exists. - virtual const_iterator_interface* lower_bound(Variable v) const = 0; - - //! Returns the dimension of the vector space enclosing \p *this. - virtual dimension_type space_dimension() const = 0; - - //! Sets the dimension of the vector space enclosing \p *this to \p n . - virtual void set_space_dimension(dimension_type n) = 0; - - //! Returns the coefficient of \p v in \p *this. - virtual Coefficient_traits::const_reference - coefficient(Variable v) const = 0; - - //! Sets the coefficient of \p v in \p *this to \p n. - virtual void - set_coefficient(Variable v, Coefficient_traits::const_reference n) = 0; - - //! Returns the inhomogeneous term of \p *this. - virtual Coefficient_traits::const_reference inhomogeneous_term() const = 0; - - //! Sets the inhomogeneous term of \p *this to \p n. - virtual void - set_inhomogeneous_term(Coefficient_traits::const_reference n) = 0; - - //! Linearly combines \p *this with \p y so that the coefficient of \p v - //! is 0. - /*! - \param y - The expression that will be combined with \p *this object; - - \param v - The variable whose coefficient has to become \f$0\f$. - - Computes a linear combination of \p *this and \p y having - the coefficient of variable \p v equal to \f$0\f$. Then it assigns - the resulting expression to \p *this. - - \p *this and \p y must have the same space dimension. - */ - virtual void - linear_combine(const Linear_Expression_Interface& y, Variable v) = 0; - - //! Equivalent to *this = *this * c1 + y * c2, but assumes that - //! \p *this and \p y have the same space dimension. - virtual void linear_combine(const Linear_Expression_Interface& y, - Coefficient_traits::const_reference c1, - Coefficient_traits::const_reference c2) = 0; - - //! Equivalent to *this = *this * c1 + y * c2. - //! c1 and c2 may be 0. - virtual void linear_combine_lax(const Linear_Expression_Interface& y, - Coefficient_traits::const_reference c1, - Coefficient_traits::const_reference c2) = 0; - - //! Swaps the coefficients of the variables \p v1 and \p v2 . - virtual void swap_space_dimensions(Variable v1, Variable v2) = 0; - - //! Removes all the specified dimensions from the expression. - /*! - The space dimension of the variable with the highest space - dimension in \p vars must be at most the space dimension - of \p this. - */ - virtual void remove_space_dimensions(const Variables_Set& vars) = 0; - - //! Shift by \p n positions the coefficients of variables, starting from - //! the coefficient of \p v. This increases the space dimension by \p n. - virtual void shift_space_dimensions(Variable v, dimension_type n) = 0; - - //! Permutes the space dimensions of the expression. - /*! - \param cycle - A vector representing a cycle of the permutation according to which the - space dimensions must be rearranged. - - The \p cycle vector represents a cycle of a permutation of space - dimensions. - For example, the permutation - \f$ \{ x_1 \mapsto x_2, x_2 \mapsto x_3, x_3 \mapsto x_1 \}\f$ can be - represented by the vector containing \f$ x_1, x_2, x_3 \f$. - */ - virtual void - permute_space_dimensions(const std::vector& cycle) = 0; - - //! Returns true if and only if \p *this is \f$0\f$. - virtual bool is_zero() const = 0; - - /*! \brief - Returns true if and only if all the homogeneous - terms of \p *this are \f$0\f$. - */ - virtual bool all_homogeneous_terms_are_zero() const = 0; - - /*! \brief - Returns a lower bound to the total size in bytes of the memory - occupied by \p *this. - */ - virtual memory_size_type total_memory_in_bytes() const = 0; - - //! Returns the size in bytes of the memory managed by \p *this. - virtual memory_size_type external_memory_in_bytes() const = 0; - - //! Writes to \p s an ASCII representation of \p *this. - virtual void ascii_dump(std::ostream& s) const = 0; - - /*! \brief - Loads from \p s an ASCII representation (as produced by - ascii_dump(std::ostream&) const) and sets \p *this accordingly. - Returns true if successful, false otherwise. - */ - virtual bool ascii_load(std::istream& s) = 0; - - //! Returns \p true if *this is equal to \p x. - //! Note that (*this == x) has a completely different meaning. - virtual bool is_equal_to(const Linear_Expression_Interface& x) const = 0; - - //! Normalizes the modulo of the coefficients and of the inhomogeneous term - //! so that they are mutually prime. - /*! - Computes the Greatest Common Divisor (GCD) among the coefficients - and the inhomogeneous term and normalizes them by the GCD itself. - */ - virtual void normalize() = 0; - - //! Ensures that the first nonzero homogeneous coefficient is positive, - //! by negating the row if necessary. - virtual void sign_normalize() = 0; - - /*! \brief - Negates the elements from index \p first (included) - to index \p last (excluded). - */ - virtual void negate(dimension_type first, dimension_type last) = 0; - - virtual Linear_Expression_Interface& - operator+=(Coefficient_traits::const_reference n) = 0; - virtual Linear_Expression_Interface& - operator-=(Coefficient_traits::const_reference n) = 0; - - //! The basic comparison function. - /*! \relates Linear_Expression_Interface - - \returns -1 or -2 if x is less than y, 0 if they are equal and 1 or 2 is y - is greater. The absolute value of the result is 1 if the difference - is only in the inhomogeneous terms, 2 otherwise - - The order is a lexicographic. It starts comparing the variables' - coefficient, starting from Variable(0), and at the end it compares - the inhomogeneous terms. - */ - virtual int compare(const Linear_Expression_Interface& y) const = 0; - - virtual Linear_Expression_Interface& - operator+=(const Linear_Expression_Interface& e2) = 0; - virtual Linear_Expression_Interface& - operator+=(const Variable v) = 0; - virtual Linear_Expression_Interface& - operator-=(const Linear_Expression_Interface& e2) = 0; - virtual Linear_Expression_Interface& - operator-=(const Variable v) = 0; - virtual Linear_Expression_Interface& - operator*=(Coefficient_traits::const_reference n) = 0; - virtual Linear_Expression_Interface& - operator/=(Coefficient_traits::const_reference n) = 0; - - virtual void negate() = 0; - - virtual Linear_Expression_Interface& - add_mul_assign(Coefficient_traits::const_reference n, const Variable v) = 0; - - virtual Linear_Expression_Interface& - sub_mul_assign(Coefficient_traits::const_reference n, const Variable v) = 0; - - virtual void add_mul_assign(Coefficient_traits::const_reference factor, - const Linear_Expression_Interface& e2) = 0; - - virtual void sub_mul_assign(Coefficient_traits::const_reference factor, - const Linear_Expression_Interface& e2) = 0; - - virtual void print(std::ostream& s) const = 0; - - /*! \brief - Returns true if the coefficient of each variable in - \p vars[i] is \f$0\f$. - */ - virtual bool all_zeroes(const Variables_Set& vars) const = 0; - - //! Returns true if there is a variable in [first,last) whose coefficient - //! is nonzero in both *this and x. - virtual bool have_a_common_variable(const Linear_Expression_Interface& x, - Variable first, Variable last) const = 0; - - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Returns the i-th coefficient. - virtual Coefficient_traits::const_reference get(dimension_type i) const = 0; + return tree.insert(i, x); +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Sets the i-th coefficient to n. - virtual void set(dimension_type i, Coefficient_traits::const_reference n) = 0; +inline Sparse_Row::iterator +Sparse_Row::insert(iterator itr, dimension_type i, + Coefficient_traits::const_reference x) { + PPL_ASSERT(i < size_); + return tree.insert(itr, i, x); +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - /*! \brief - Returns true if (*this)[i] is \f$0\f$, for each i in - [start, end). - */ - virtual bool all_zeroes(dimension_type start, dimension_type end) const = 0; +inline Sparse_Row::iterator +Sparse_Row::insert(dimension_type i) { + PPL_ASSERT(i < size_); + return tree.insert(i); +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - /*! \brief - Returns the number of zero coefficient in [start, end). - */ - virtual dimension_type - num_zeroes(dimension_type start, dimension_type end) const = 0; +inline Sparse_Row::iterator +Sparse_Row::insert(iterator itr, dimension_type i) { + PPL_ASSERT(i < size_); + return tree.insert(itr, i); +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - /*! \brief - Returns the gcd of the nonzero coefficients in [start,end). If all the - coefficients in this range are 0 returns 0. - */ - virtual Coefficient gcd(dimension_type start, dimension_type end) const = 0; +inline void +Sparse_Row::swap_coefficients(iterator i, iterator j) { + PPL_ASSERT(i != end()); + PPL_ASSERT(j != end()); + using std::swap; + swap(*i, *j); + PPL_ASSERT(OK()); +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - virtual void exact_div_assign(Coefficient_traits::const_reference c, - dimension_type start, dimension_type end) = 0; +inline void +Sparse_Row::fast_swap(dimension_type i, iterator itr) { + PPL_ASSERT(lower_bound(i) == itr); + PPL_ASSERT(itr != end()); + tree.fast_shift(i, itr); + PPL_ASSERT(OK()); +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Equivalent to (*this)[i] *= n, for each i in [start, end). - virtual void mul_assign(Coefficient_traits::const_reference n, - dimension_type start, dimension_type end) = 0; +inline Sparse_Row::iterator +Sparse_Row::reset(iterator i) { + iterator res = tree.erase(i); + PPL_ASSERT(OK()); + return res; +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Linearly combines \p *this with \p y so that the coefficient of \p v - //! is 0. - /*! - \param y - The expression that will be combined with \p *this object; +inline void +Sparse_Row::reset(dimension_type i) { + PPL_ASSERT(i < size()); - \param i - The index of the coefficient that has to become \f$0\f$. + tree.erase(i); + PPL_ASSERT(OK()); +} - Computes a linear combination of \p *this and \p y having - the i-th coefficient equal to \f$0\f$. Then it assigns - the resulting expression to \p *this. +inline memory_size_type +Sparse_Row::external_memory_in_bytes() const { + return tree.external_memory_in_bytes(); +} - \p *this and \p y must have the same space dimension. - */ - virtual void - linear_combine(const Linear_Expression_Interface& y, dimension_type i) = 0; +inline memory_size_type +Sparse_Row::external_memory_in_bytes(dimension_type /* capacity */) const { + return external_memory_in_bytes(); +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Equivalent to (*this)[i] = (*this)[i] * c1 + y[i] * c2, - //! for each i in [start, end). - virtual void linear_combine(const Linear_Expression_Interface& y, - Coefficient_traits::const_reference c1, - Coefficient_traits::const_reference c2, - dimension_type start, dimension_type end) = 0; +inline memory_size_type +Sparse_Row::total_memory_in_bytes() const { + return external_memory_in_bytes() + sizeof(*this); +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Equivalent to (*this)[i] = (*this)[i] * c1 + y[i] * c2, - //! for each i in [start, end). c1 and c2 may be zero. - virtual void linear_combine_lax(const Linear_Expression_Interface& y, - Coefficient_traits::const_reference c1, - Coefficient_traits::const_reference c2, - dimension_type start, dimension_type end) = 0; +inline memory_size_type +Sparse_Row::total_memory_in_bytes(dimension_type /* capacity */) const { + return total_memory_in_bytes(); +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Returns the index of the last nonzero element, or 0 if there are no - //! nonzero elements. - virtual dimension_type last_nonzero() const = 0; +#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS +/*! \relates Sparse_Row */ +#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) +inline void +swap(Sparse_Row& x, Sparse_Row& y) { + x.m_swap(y); +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Returns the index of the last nonzero element in [first,last), or last - //! if there are no nonzero elements. - virtual dimension_type - last_nonzero(dimension_type first, dimension_type last) const = 0; +} // namespace Parma_Polyhedra_Library - //! Returns the index of the first nonzero element, or \p last if there are no - //! nonzero elements, considering only elements in [first,last). - virtual dimension_type - first_nonzero(dimension_type first, dimension_type last) const = 0; +/* Automatically generated from PPL source file ../src/Sparse_Row_templates.hh line 1. */ +/* Sparse_Row class implementation: non-inline template functions. +*/ - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - /*! \brief - Returns true if each coefficient in [start,end) is *not* in - \f$0\f$, disregarding coefficients of variables in \p vars. - */ - virtual bool - all_zeroes_except(const Variables_Set& vars, - dimension_type start, dimension_type end) const = 0; - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Sets results to the sum of (*this)[i]*y[i], for each i in [start,end). - virtual void - scalar_product_assign(Coefficient& result, - const Linear_Expression_Interface& y, - dimension_type start, dimension_type end) const = 0; +namespace Parma_Polyhedra_Library { - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Computes the sign of the sum of (*this)[i]*y[i], - //! for each i in [start,end). - virtual int - scalar_product_sign(const Linear_Expression_Interface& y, - dimension_type start, dimension_type end) const = 0; - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Removes from the set x all the indexes of nonzero elements of *this. - virtual void - has_a_free_dimension_helper(std::set& x) const = 0; +template +void +Sparse_Row::combine_needs_first(const Sparse_Row& y, + const Func1& f, const Func2& g) { + if (this == &y) { + for (iterator i = begin(), i_end = end(); i != i_end; ++i) { + g(*i, *i); + } + } + else { + iterator i = begin(); + // This is a const reference to an internal iterator, that is kept valid. + // If we just stored a copy, that would be invalidated by the calls to + // reset(). + const iterator& i_end = end(); + const_iterator j = y.begin(); + const_iterator j_end = y.end(); + while (i != i_end && j != j_end) { + if (i.index() == j.index()) { + g(*i, *j); + if (*i == 0) { + i = reset(i); + } + else { + ++i; + } + ++j; + } + else + if (i.index() < j.index()) { + f(*i); + if (*i == 0) { + i = reset(i); + } + else { + ++i; + } + } + else { + j = y.lower_bound(j, i.index()); + } + } + while (i != i_end) { + f(*i); + if (*i == 0) { + i = reset(i); + } + else { + ++i; + } + } + } +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Returns \p true if (*this)[i] is equal to x[i], for each i in [start,end). - virtual bool is_equal_to(const Linear_Expression_Interface& x, - dimension_type start, dimension_type end) const = 0; +template +void +Sparse_Row::combine_needs_second(const Sparse_Row& y, + const Func1& g, + const Func2& /* h */) { + iterator i = begin(); + for (const_iterator j = y.begin(), j_end = y.end(); j != j_end; ++j) { + i = insert(i, j.index()); + g(*i, *j); + if (*i == 0) { + i = reset(i); + } + } +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Returns \p true if (*this)[i]*c1 is equal to x[i]*c2, for each i in - //! [start,end). - virtual bool is_equal_to(const Linear_Expression_Interface& x, - Coefficient_traits::const_reference c1, - Coefficient_traits::const_reference c2, - dimension_type start, dimension_type end) const = 0; +template +void +Sparse_Row::combine(const Sparse_Row& y, const Func1& f, + const Func2& g, const Func3& h) { + if (this == &y) { + for (iterator i = begin(), i_end = end(); i != i_end; ++i) { + g(*i, *i); + } + } + else { + iterator i = begin(); + // This is a const reference to an internal iterator, that is kept valid. + // If we just stored a copy, that would be invalidated by the calls to + // reset() and insert(). + const iterator& i_end = end(); + const_iterator j = y.begin(); + const_iterator j_end = y.end(); + while (i != i_end && j != j_end) { + if (i.index() == j.index()) { + g(*i, *j); + if (*i == 0) { + i = reset(i); + } + else { + ++i; + } + ++j; + } + else + if (i.index() < j.index()) { + f(*i); + if (*i == 0) { + i = reset(i); + } + else { + ++i; + } + } + else { + PPL_ASSERT(i.index() > j.index()); + i = insert(i, j.index()); + h(*i, *j); + if (*i == 0) { + i = reset(i); + } + else { + ++i; + } + ++j; + } + } + PPL_ASSERT(i == i_end || j == j_end); + while (i != i_end) { + f(*i); + if (*i == 0) { + i = reset(i); + } + else { + ++i; + } + } + while (j != j_end) { + i = insert(i, j.index()); + h(*i, *j); + if (*i == 0) { + i = reset(i); + } + ++j; + } + } +} - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Sets `row' to a copy of the row that implements *this. - virtual void get_row(Dense_Row& row) const = 0; +} // namespace Parma_Polyhedra_Library - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Sets `row' to a copy of the row that implements *this. - virtual void get_row(Sparse_Row& row) const = 0; -}; +/* Automatically generated from PPL source file ../src/Sparse_Row_defs.hh line 929. */ -/* Automatically generated from PPL source file ../src/Linear_Expression_Impl_defs.hh line 35. */ +/* Automatically generated from PPL source file ../src/Linear_Expression_Impl_defs.hh line 34. */ +#include namespace Parma_Polyhedra_Library { @@ -25761,17 +26564,17 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Sets `row' to a copy of the row that implements *this. - virtual void get_row(Dense_Row& row) const; - - // NOTE: This method is public, but it's not exposed in Linear_Expression, - // so that it can be used internally in the PPL, by friends of - // Linear_Expression. - //! Sets `row' to a copy of the row that implements *this. - virtual void get_row(Sparse_Row& row) const; + // NOTE: This method is public, but it is not exposed in + // Linear_Expression, so that it can be used internally in the PPL, + // by friends of Linear_Expression. + //! Sets \p r to a copy of the row that implements \p *this. + virtual void get_row(Dense_Row& r) const; + + // NOTE: This method is public, but it is not exposed in + // Linear_Expression, so that it can be used internally in the PPL, + // by friends of Linear_Expression. + //! Sets \p r to a copy of the row that implements \p *this. + virtual void get_row(Sparse_Row& r) const; //! Implementation sizing constructor. /*! @@ -26196,9 +26999,8 @@ */ -/* Automatically generated from PPL source file ../src/math_utilities_inlines.hh line 28. */ +/* Automatically generated from PPL source file ../src/math_utilities_inlines.hh line 29. */ #include -/* Automatically generated from PPL source file ../src/math_utilities_inlines.hh line 30. */ namespace Parma_Polyhedra_Library { @@ -26250,15 +27052,17 @@ template inline void min_assign(N& x, const N& y) { - if (x > y) + if (x > y) { x = y; + } } template inline void max_assign(N& x, const N& y) { - if (x < y) + if (x < y) { x = y; + } } template @@ -26279,8 +27083,9 @@ inline bool is_canonical(const mpq_class& x) { - if (x.get_den() <= 0) + if (x.get_den() <= 0) { return false; + } PPL_DIRTY_TEMP(mpq_class, temp); temp = x; temp.canonicalize(); @@ -26327,8 +27132,9 @@ Linear_Expression_Impl ::Linear_Expression_Impl(Coefficient_traits::const_reference n) : row(1) { - if (n != 0) + if (n != 0) { row.insert(0, n); + } PPL_ASSERT(OK()); } @@ -26348,8 +27154,9 @@ template inline Coefficient_traits::const_reference Linear_Expression_Impl::coefficient(Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { return Coefficient_zero(); + } return row.get(v.id() + 1); } @@ -26359,10 +27166,12 @@ ::set_coefficient(Variable v, Coefficient_traits::const_reference n) { PPL_ASSERT(v.space_dimension() <= space_dimension()); const dimension_type i = v.space_dimension(); - if (n == 0) + if (n == 0) { row.reset(i); - else + } + else { row.insert(i, n); + } PPL_ASSERT(OK()); } @@ -26376,10 +27185,12 @@ inline void Linear_Expression_Impl ::set_inhomogeneous_term(Coefficient_traits::const_reference n) { - if (n == 0) + if (n == 0) { row.reset(0); - else + } + else { row.insert(0, n); + } PPL_ASSERT(OK()); } @@ -26415,8 +27226,9 @@ Linear_Expression_Impl::operator+=(Coefficient_traits::const_reference n) { typename Row::iterator itr = row.insert(0); (*itr) += n; - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -26426,8 +27238,9 @@ Linear_Expression_Impl::operator-=(Coefficient_traits::const_reference n) { typename Row::iterator itr = row.insert(0); (*itr) -= n; - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -26470,8 +27283,9 @@ template <> inline dimension_type Linear_Expression_Impl::last_nonzero() const { - if (row.num_stored_elements() == 0) + if (row.num_stored_elements() == 0) { return 0; + } Sparse_Row::const_iterator i = row.end(); --i; return i.index(); @@ -26485,10 +27299,12 @@ PPL_ASSERT(last <= row.size()); Sparse_Row::const_iterator i = row.lower_bound(first); - if (i != row.end() && i.index() < last) + if (i != row.end() && i.index() < last) { return i.index(); - else + } + else { return last; + } } template <> @@ -26500,8 +27316,9 @@ Sparse_Row::const_iterator itr1 = row.lower_bound(first); Sparse_Row::const_iterator itr2 = row.lower_bound(last); - if (itr1 == itr2) + if (itr1 == itr2) { return last; + } --itr2; return itr2.index(); @@ -26910,11 +27727,11 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Dense_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Dense_Row& r) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Sparse_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Sparse_Row& r) const; //! Returns \c true if there is a variable in [first,last) whose coefficient //! is nonzero in both \p *this and \p y. @@ -27130,14 +27947,14 @@ template inline void -Expression_Adapter::get_row(Dense_Row& row) const { - inner().get_row(row); +Expression_Adapter::get_row(Dense_Row& r) const { + inner().get_row(r); } template inline void -Expression_Adapter::get_row(Sparse_Row& row) const { - inner().get_row(row); +Expression_Adapter::get_row(Sparse_Row& r) const { + inner().get_row(r); } template @@ -27183,6 +28000,7 @@ /* Automatically generated from PPL source file ../src/Linear_Expression_defs.hh line 51. */ /* Automatically generated from PPL source file ../src/Linear_Expression_defs.hh line 54. */ +#include namespace Parma_Polyhedra_Library { @@ -27446,14 +28264,21 @@ template explicit Linear_Expression(const LE_Adapter& e, - typename Enable_If::value, void*>::type = 0); + typename + Enable_If::value, + void*>::type = 0); /*! \brief Copy constructor from a linear expression adapter that takes a Representation. */ template - Linear_Expression(const LE_Adapter& e, Representation r, - typename Enable_If::value, void*>::type = 0); + Linear_Expression(const LE_Adapter& e, + Representation r, + typename + Enable_If::value, + void*>::type = 0); /*! \brief Copy constructor from a linear expression adapter that takes a @@ -27464,8 +28289,12 @@ */ template explicit - Linear_Expression(const LE_Adapter& e, dimension_type space_dim, - typename Enable_If::value, void*>::type = 0); + Linear_Expression(const LE_Adapter& e, + dimension_type space_dim, + typename + Enable_If::value, + void*>::type = 0); /*! \brief Copy constructor from a linear expression adapter that takes a @@ -27473,8 +28302,12 @@ */ template Linear_Expression(const LE_Adapter& e, - dimension_type space_dim, Representation r, - typename Enable_If::value, void*>::type = 0); + dimension_type space_dim, + Representation r, + typename + Enable_If::value, + void*>::type = 0); //! Assignment operator. Linear_Expression& operator=(const Linear_Expression& e); @@ -27513,7 +28346,7 @@ public: typedef std::bidirectional_iterator_tag iterator_category; typedef const Coefficient value_type; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef value_type* pointer; typedef Coefficient_traits::const_reference reference; @@ -27525,32 +28358,32 @@ //! The copy constructor. /*! - \param itr + \param i The %iterator that will be copied. This constructor takes \f$O(1)\f$ time. */ - const_iterator(const const_iterator& itr); + const_iterator(const const_iterator& i); ~const_iterator(); - //! Swaps itr with *this. + //! Swaps \p i with \p *this. /*! - \param itr - The %iterator that will be swapped with *this. + \param i + The %iterator that will be swapped with \p *this. This method takes \f$O(1)\f$ time. */ - void m_swap(const_iterator& itr); + void m_swap(const_iterator& i); - //! Assigns \p itr to *this . + //! Assigns \p i to *this . /*! - \param itr + \param i The %iterator that will be assigned into *this. This method takes \f$O(1)\f$ time. */ - const_iterator& operator=(const const_iterator& itr); + const_iterator& operator=(const const_iterator& i); //! Navigates to the next nonzero coefficient. /*! @@ -27575,24 +28408,24 @@ */ Variable variable() const; - //! Compares \p *this with x . + //! Compares \p *this with \p i. /*! - \param x + \param i The %iterator that will be compared with *this. */ - bool operator==(const const_iterator& x) const; + bool operator==(const const_iterator& i) const; - //! Compares \p *this with x . + //! Compares \p *this with \p i . /*! - \param x + \param i The %iterator that will be compared with *this. */ - bool operator!=(const const_iterator& x) const; + bool operator!=(const const_iterator& i) const; private: //! Constructor from a const_iterator_interface*. //! The new object takes ownership of the dynamic object. - const_iterator(Linear_Expression_Interface::const_iterator_interface* itr); + const_iterator(Linear_Expression_Interface::const_iterator_interface* i); Linear_Expression_Interface::const_iterator_interface* itr; @@ -27907,14 +28740,17 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; - //! Sets `row' to a copy of the row that implements *this. - void get_row(Dense_Row& row) const; + //! Sets \p r to a copy of the row that implements \p *this. + void get_row(Dense_Row& r) const; - //! Sets `row' to a copy of the row that implements *this. - void get_row(Sparse_Row& row) const; + //! Sets \p r to a copy of the row that implements \p *this. + void get_row(Sparse_Row& r) const; - //! Returns true if there is a variable in [first,last) whose coefficient - //! is nonzero in both *this and x. + /*! \brief + Returns \p true if there is a variable from index \p first (included) + to index \p last (excluded) whose coefficient is nonzero in both + \p *this and \p x. + */ bool have_a_common_variable(const Linear_Expression& x, Variable first, Variable last) const; @@ -28185,11 +29021,12 @@ const dimension_type v_space_dim = v.space_dimension(); const dimension_type w_space_dim = w.space_dimension(); const dimension_type space_dim = std::max(v_space_dim, w_space_dim); - if (space_dim > Linear_Expression::max_space_dimension()) + if (space_dim > Linear_Expression::max_space_dimension()) { throw std::length_error("Linear_Expression " "PPL::operator+(v, w):\n" "v or w exceed the maximum allowed " "space dimension."); + } if (v_space_dim >= w_space_dim) { Linear_Expression e(v); e -= w; @@ -28290,11 +29127,12 @@ const dimension_type v_space_dim = v.space_dimension(); const dimension_type w_space_dim = w.space_dimension(); const dimension_type space_dim = std::max(v_space_dim, w_space_dim); - if (space_dim > Linear_Expression::max_space_dimension()) + if (space_dim > Linear_Expression::max_space_dimension()) { throw std::length_error("Linear_Expression " "PPL::operator+(v, w):\n" "v or w exceed the maximum allowed " "space dimension."); + } if (v_space_dim >= w_space_dim) { Linear_Expression e(v); e += w; @@ -28585,14 +29423,14 @@ inline void Linear_Expression -::get_row(Dense_Row& row) const { - return impl->get_row(row); +::get_row(Dense_Row& r) const { + return impl->get_row(r); } inline void Linear_Expression -::get_row(Sparse_Row& row) const { - return impl->get_row(row); +::get_row(Sparse_Row& r) const { + return impl->get_row(r); } inline void @@ -28660,27 +29498,27 @@ inline Linear_Expression::const_iterator -::const_iterator(const const_iterator& x) - : itr(x.itr->clone()) { +::const_iterator(const const_iterator& i) + : itr(i.itr->clone()) { } inline Linear_Expression::const_iterator ::~const_iterator() { - // Note that this does nothing if itr==NULL. + // Note that this does nothing if itr == NULL. delete itr; } inline void -Linear_Expression::const_iterator::m_swap(const_iterator& x) { +Linear_Expression::const_iterator::m_swap(const_iterator& i) { using std::swap; - swap(itr, x.itr); + swap(itr, i.itr); } inline Linear_Expression::const_iterator& Linear_Expression::const_iterator -::operator=(const const_iterator& itr) { - const_iterator tmp = itr; +::operator=(const const_iterator& i) { + const_iterator tmp = i; using std::swap; swap(*this, tmp); return *this; @@ -28718,23 +29556,23 @@ inline bool Linear_Expression::const_iterator -::operator==(const const_iterator& x) const { +::operator==(const const_iterator& i) const { PPL_ASSERT(itr != NULL); - PPL_ASSERT(x.itr != NULL); - return *itr == *(x.itr); + PPL_ASSERT(i.itr != NULL); + return *itr == *(i.itr); } inline bool Linear_Expression::const_iterator -::operator!=(const const_iterator& x) const { - return !(*this == x); +::operator!=(const const_iterator& i) const { + return !(*this == i); } inline Linear_Expression::const_iterator -::const_iterator(Linear_Expression_Interface::const_iterator_interface* itr) - : itr(itr) { - PPL_ASSERT(itr != NULL); +::const_iterator(Linear_Expression_Interface::const_iterator_interface* i) + : itr(i) { + PPL_ASSERT(i != NULL); } inline Linear_Expression::const_iterator @@ -28757,74 +29595,94 @@ template inline -Linear_Expression::Linear_Expression(const LE_Adapter& e, - typename Enable_If::value, void*>::type) +Linear_Expression +::Linear_Expression(const LE_Adapter& e, + typename Enable_If::value, + void*>::type) : impl(NULL) { Linear_Expression tmp(e.representation()); tmp.set_space_dimension(e.space_dimension()); tmp.set_inhomogeneous_term(e.inhomogeneous_term()); for (typename LE_Adapter::const_iterator i = e.begin(), - i_end = e.end(); i != i_end; ++i) + i_end = e.end(); i != i_end; ++i) { add_mul_assign(tmp, *i, i.variable()); + } using std::swap; swap(impl, tmp.impl); } template inline -Linear_Expression::Linear_Expression(const LE_Adapter& e, - Representation r, - typename Enable_If::value, void*>::type) +Linear_Expression +::Linear_Expression(const LE_Adapter& e, + Representation r, + typename Enable_If::value, + void*>::type) : impl(NULL) { Linear_Expression tmp(r); tmp.set_space_dimension(e.space_dimension()); tmp.set_inhomogeneous_term(e.inhomogeneous_term()); for (typename LE_Adapter::const_iterator i = e.begin(), - i_end = e.end(); i != i_end; ++i) + i_end = e.end(); i != i_end; ++i) { add_mul_assign(tmp, *i, i.variable()); + } using std::swap; swap(impl, tmp.impl); } template inline -Linear_Expression::Linear_Expression(const LE_Adapter& e, - dimension_type space_dim, - typename Enable_If::value, void*>::type) +Linear_Expression +::Linear_Expression(const LE_Adapter& e, + dimension_type space_dim, + typename Enable_If::value, + void*>::type) : impl(NULL) { Linear_Expression tmp(e.representation()); tmp.set_space_dimension(space_dim); tmp.set_inhomogeneous_term(e.inhomogeneous_term()); typedef typename LE_Adapter::const_iterator itr_t; itr_t i_end; - if (space_dim <= e.space_dimension()) + if (space_dim <= e.space_dimension()) { i_end = e.lower_bound(Variable(space_dim)); - else + } + else { i_end = e.end(); - for (itr_t i = e.begin(); i != i_end; ++i) + } + for (itr_t i = e.begin(); i != i_end; ++i) { add_mul_assign(tmp, *i, i.variable()); + } using std::swap; swap(impl, tmp.impl); } template inline -Linear_Expression::Linear_Expression(const LE_Adapter& e, - dimension_type space_dim, - Representation r, - typename Enable_If::value, void*>::type) +Linear_Expression +::Linear_Expression(const LE_Adapter& e, + dimension_type space_dim, + Representation r, + typename Enable_If::value, + void*>::type) : impl(NULL) { Linear_Expression tmp(r); tmp.set_space_dimension(space_dim); tmp.set_inhomogeneous_term(e.inhomogeneous_term()); typedef typename LE_Adapter::const_iterator itr_t; itr_t i_end; - if (space_dim <= e.space_dimension()) + if (space_dim <= e.space_dimension()) { i_end = e.lower_bound(Variable(space_dim)); - else + } + else { i_end = e.end(); - for (itr_t i = e.begin(); i != i_end; ++i) + } + for (itr_t i = e.begin(); i != i_end; ++i) { add_mul_assign(tmp, *i, i.variable()); + } using std::swap; swap(impl, tmp.impl); } @@ -28855,7 +29713,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Linear_Expression_defs.hh line 927. */ +/* Automatically generated from PPL source file ../src/Linear_Expression_defs.hh line 946. */ /* Automatically generated from PPL source file ../src/Topology_types.hh line 1. */ @@ -28995,11 +29853,11 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Dense_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Dense_Row& r) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Sparse_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Sparse_Row& r) const; //! Returns \c true if there is a variable in [first,last) whose coefficient //! is nonzero in both \p *this and \p y. @@ -29083,8 +29941,9 @@ ::is_equal_to(const Expression& y) const { const dimension_type x_dim = space_dimension(); const dimension_type y_dim = y.space_dimension(); - if (x_dim != y_dim) + if (x_dim != y_dim) { return false; + } return is_equal_to(y, 0, x_dim + 1); } @@ -29168,8 +30027,9 @@ inline void Expression_Hide_Last ::has_a_free_dimension_helper(std::set& x) const { - if (x.empty()) + if (x.empty()) { return; + } PPL_ASSERT(*(--x.end()) <= space_dimension()); this->inner().has_a_free_dimension_helper(x); } @@ -29200,21 +30060,21 @@ template inline void -Expression_Hide_Last::get_row(Dense_Row& row) const { - this->inner().get_row(row); +Expression_Hide_Last::get_row(Dense_Row& r) const { + this->inner().get_row(r); if (hide_last_) { - PPL_ASSERT(row.size() != 0); - row.resize(row.size() - 1); + PPL_ASSERT(r.size() != 0); + r.resize(r.size() - 1); } } template inline void -Expression_Hide_Last::get_row(Sparse_Row& row) const { - this->inner().get_row(row); +Expression_Hide_Last::get_row(Sparse_Row& r) const { + this->inner().get_row(r); if (hide_last_) { - PPL_ASSERT(row.size() != 0); - row.resize(row.size() - 1); + PPL_ASSERT(r.size() != 0); + r.resize(r.size() - 1); } } @@ -30089,8 +30949,9 @@ inline void Constraint::set_topology(Topology x) { - if (topology() == x) + if (topology() == x) { return; + } if (topology() == NECESSARILY_CLOSED) { // Add a column for the epsilon dimension. expr.set_space_dimension(expr.space_dimension() + 1); @@ -30149,9 +31010,10 @@ topology_(topology) { PPL_ASSERT(kind != RAY_OR_POINT_OR_INEQUALITY || topology == NOT_NECESSARILY_CLOSED); swap(expr, e); - if (topology == NOT_NECESSARILY_CLOSED) + if (topology == NOT_NECESSARILY_CLOSED) { // Add the epsilon dimension. expr.set_space_dimension(expr.space_dimension() + 1); + } strong_normalize(); PPL_ASSERT(OK()); } @@ -30161,12 +31023,15 @@ : topology_(topology) { PPL_ASSERT(type != STRICT_INEQUALITY || topology == NOT_NECESSARILY_CLOSED); swap(expr, e); - if (topology == NOT_NECESSARILY_CLOSED) + if (topology == NOT_NECESSARILY_CLOSED) { expr.set_space_dimension(expr.space_dimension() + 1); - if (type == EQUALITY) + } + if (type == EQUALITY) { kind_ = LINE_OR_EQUALITY; - else + } + else { kind_ = RAY_OR_POINT_OR_INEQUALITY; + } strong_normalize(); PPL_ASSERT(OK()); } @@ -30249,8 +31114,9 @@ } } PPL_ASSERT(space_dimension() == space_dim); - if (expr.space_dimension() < old_expr_space_dim) + if (expr.space_dimension() < old_expr_space_dim) { strong_normalize(); + } } inline void @@ -30277,14 +31143,18 @@ inline Constraint::Type Constraint::type() const { - if (is_equality()) + if (is_equality()) { return EQUALITY; - if (is_necessarily_closed()) + } + if (is_necessarily_closed()) { return NONSTRICT_INEQUALITY; - if (epsilon_coefficient() < 0) + } + if (epsilon_coefficient() < 0) { return STRICT_INEQUALITY; - else + } + else { return NONSTRICT_INEQUALITY; + } } inline bool @@ -30309,8 +31179,9 @@ inline Coefficient_traits::const_reference Constraint::coefficient(const Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { throw_dimension_incompatible("coefficient(v)", "v", v); + } return expr.coefficient(v); } @@ -30360,8 +31231,9 @@ /*! \relates Constraint */ inline Constraint operator==(Variable v1, Variable v2) { - if (v1.space_dimension() > v2.space_dimension()) + if (v1.space_dimension() > v2.space_dimension()) { swap(v1, v2); + } PPL_ASSERT(v1.space_dimension() <= v2.space_dimension()); Linear_Expression diff(v1, Constraint::default_representation); @@ -30736,8 +31608,9 @@ L_Infinity_Distance_Specialization::combine(Temp& running, const Temp& current, Rounding_Dir) { - if (current > running) + if (current > running) { running = current; + } } template @@ -30863,11 +31736,11 @@ Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Dense_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Dense_Row& r) const; - //! Sets \p row to a copy of the row as adapted by \p *this. - void get_row(Sparse_Row& row) const; + //! Sets \p r to a copy of the row as adapted by \p *this. + void get_row(Sparse_Row& r) const; }; /* Automatically generated from PPL source file ../src/Expression_Hide_Inhomo_inlines.hh line 1. */ @@ -30905,10 +31778,12 @@ ::is_equal_to(const Expression& y) const { const dimension_type x_dim = this->space_dimension(); const dimension_type y_dim = y.space_dimension(); - if (x_dim != y_dim) + if (x_dim != y_dim) { return false; - if (y.inhomogeneous_term() != 0) + } + if (y.inhomogeneous_term() != 0) { return false; + } // Note that the inhomogeneous term is not compared. return this->inner().is_equal_to(y, 1, x_dim + 1); } @@ -30916,10 +31791,12 @@ template inline Coefficient_traits::const_reference Expression_Hide_Inhomo::get(dimension_type i) const { - if (i == 0) + if (i == 0) { return Coefficient_zero(); - else + } + else { return this->inner().get(i); + } } template @@ -30939,10 +31816,12 @@ inline bool Expression_Hide_Inhomo::all_zeroes(dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return true; - if (start == 0) + } + if (start == 0) { ++start; + } return this->inner().all_zeroes(start, end); } @@ -30950,8 +31829,9 @@ inline dimension_type Expression_Hide_Inhomo::num_zeroes(dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return 0; + } dimension_type nz = 0; if (start == 0) { ++start; @@ -30965,10 +31845,12 @@ inline Coefficient Expression_Hide_Inhomo::gcd(dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return Coefficient_zero(); - if (start == 0) + } + if (start == 0) { ++start; + } return this->inner().gcd(start, end); } @@ -30982,10 +31864,12 @@ inline dimension_type Expression_Hide_Inhomo::last_nonzero(dimension_type first, dimension_type last) const { - if (first == last) + if (first == last) { return last; - if (first == 0) + } + if (first == 0) { ++first; + } return this->inner().last_nonzero(first, last); } @@ -30993,10 +31877,12 @@ inline dimension_type Expression_Hide_Inhomo::first_nonzero(dimension_type first, dimension_type last) const { - if (first == last) + if (first == last) { return last; - if (first == 0) + } + if (first == 0) { ++first; + } return this->inner().first_nonzero(first, last); } @@ -31005,10 +31891,12 @@ Expression_Hide_Inhomo ::all_zeroes_except(const Variables_Set& vars, dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return true; - if (start == 0) + } + if (start == 0) { ++start; + } return this->inner().all_zeroes_except(vars, start, end); } @@ -31018,8 +31906,9 @@ ::has_a_free_dimension_helper(std::set& y) const { bool had_0 = (y.count(0) == 1); this->inner().has_a_free_dimension_helper(y); - if (had_0) + if (had_0) { y.insert(0); + } } template @@ -31028,10 +31917,12 @@ Expression_Hide_Inhomo ::is_equal_to(const Expression& y, dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return true; - if (start == 0) + } + if (start == 0) { ++start; + } return this->inner().is_equal_to(y, start, end); } @@ -31043,25 +31934,27 @@ Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const { - if (start == end) + if (start == end) { return true; - if (start == 0) + } + if (start == 0) { ++start; + } return this->inner().is_equal_to(y, c1, c2, start, end); } template inline void -Expression_Hide_Inhomo::get_row(Dense_Row& row) const { - this->inner().get_row(row); - row.reset(0); +Expression_Hide_Inhomo::get_row(Dense_Row& r) const { + this->inner().get_row(r); + r.reset(0); } template inline void -Expression_Hide_Inhomo::get_row(Sparse_Row& row) const { - this->inner().get_row(row); - row.reset(0); +Expression_Hide_Inhomo::get_row(Sparse_Row& r) const { + this->inner().get_row(r); + r.reset(0); } } // namespace Parma_Polyhedra_Library @@ -32108,8 +33001,9 @@ inline void Generator::set_topology(Topology x) { - if (topology() == x) + if (topology() == x) { return; + } if (topology() == NECESSARILY_CLOSED) { // Add a column for the epsilon dimension. expr.set_space_dimension(expr.space_dimension() + 1); @@ -32159,10 +33053,12 @@ : expr(r), kind_(kind), topology_(topology) { - if (is_necessarily_closed()) + if (is_necessarily_closed()) { expr.set_space_dimension(space_dim); - else + } + else { expr.set_space_dimension(space_dim + 1); + } PPL_ASSERT(space_dimension() == space_dim); PPL_ASSERT(OK()); } @@ -32172,12 +33068,15 @@ : topology_(topology) { PPL_ASSERT(type != CLOSURE_POINT || topology == NOT_NECESSARILY_CLOSED); swap(expr, e); - if (topology == NOT_NECESSARILY_CLOSED) + if (topology == NOT_NECESSARILY_CLOSED) { expr.set_space_dimension(expr.space_dimension() + 1); - if (type == LINE) + } + if (type == LINE) { kind_ = LINE_OR_EQUALITY; - else + } + else { kind_ = RAY_OR_POINT_OR_INEQUALITY; + } strong_normalize(); } @@ -32186,8 +33085,9 @@ : kind_(kind), topology_(topology) { swap(expr, e); - if (topology == NOT_NECESSARILY_CLOSED) + if (topology == NOT_NECESSARILY_CLOSED) { expr.set_space_dimension(expr.space_dimension() + 1); + } strong_normalize(); } @@ -32271,8 +33171,9 @@ } } PPL_ASSERT(space_dimension() == space_dim); - if (expr.space_dimension() < old_expr_space_dim) + if (expr.space_dimension() < old_expr_space_dim) { strong_normalize(); + } } inline void @@ -32308,18 +33209,23 @@ inline Generator::Type Generator::type() const { - if (is_line()) + if (is_line()) { return LINE; - if (is_line_or_ray()) + } + if (is_line_or_ray()) { return RAY; - if (is_necessarily_closed()) + } + if (is_necessarily_closed()) { return POINT; + } else { // Checking the value of the epsilon coefficient. - if (epsilon_coefficient() == 0) + if (epsilon_coefficient() == 0) { return CLOSURE_POINT; - else + } + else { return POINT; + } } } @@ -32345,17 +33251,19 @@ inline Coefficient_traits::const_reference Generator::coefficient(const Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { throw_dimension_incompatible("coefficient(v)", "v", v); + } return expr.coefficient(v); } inline Coefficient_traits::const_reference Generator::divisor() const { Coefficient_traits::const_reference d = expr.inhomogeneous_term(); - if (!is_ray_or_point() || d == 0) + if (!is_ray_or_point() || d == 0) { throw_invalid_argument("divisor()", "*this is neither a point nor a closure point"); + } return d; } @@ -32471,7 +33379,7 @@ expr.ascii_dump(s); s << " "; - + switch (type()) { case Generator::LINE: s << "L "; @@ -32486,10 +33394,12 @@ s << "C "; break; } - if (is_necessarily_closed()) + if (is_necessarily_closed()) { s << "(C)"; - else + } + else { s << "(NNC)"; + } s << "\n"; } @@ -32499,51 +33409,63 @@ expr.ascii_load(s); - if (!(s >> str)) + if (!(s >> str)) { return false; - if (str == "L") + } + if (str == "L") { set_is_line(); - else if (str == "R" || str == "P" || str == "C") + } + else if (str == "R" || str == "P" || str == "C") { set_is_ray_or_point(); - else + } + else { return false; + } std::string str2; - if (!(s >> str2)) + if (!(s >> str2)) { return false; + } if (str2 == "(C)") { - if (is_not_necessarily_closed()) + if (is_not_necessarily_closed()) { // TODO: Avoid using the mark_as_*() methods if possible. mark_as_necessarily_closed(); + } } else { if (str2 == "(NNC)") { - if (is_necessarily_closed()) + if (is_necessarily_closed()) { // TODO: Avoid using the mark_as_*() methods if possible. mark_as_not_necessarily_closed(); + } } - else + else { return false; + } } // Checking for equality of actual and declared types. switch (type()) { case Generator::LINE: - if (str != "L") + if (str != "L") { return false; + } break; case Generator::RAY: - if (str != "R") + if (str != "R") { return false; + } break; case Generator::POINT: - if (str != "P") + if (str != "P") { return false; + } break; case Generator::CLOSURE_POINT: - if (str != "C") + if (str != "C") { return false; + } break; } @@ -32572,12 +33494,14 @@ Temp& tmp2) { // Generator kind compatibility check: we only compute distances // between (closure) points. - if (x.is_line_or_ray() || y.is_line_or_ray()) + if (x.is_line_or_ray() || y.is_line_or_ray()) { return false; + } const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } // All zero-dim generators have distance zero. if (x_space_dim == 0) { @@ -33569,10 +34493,12 @@ inline Grid_Generator::Grid_Generator(Linear_Expression& e, Type type) { swap(expr, e); - if (type == LINE) + if (type == LINE) { kind_ = LINE_OR_EQUALITY; - else + } + else { kind_ = RAY_OR_POINT_OR_INEQUALITY; + } PPL_ASSERT(OK()); } @@ -33680,8 +34606,9 @@ inline Grid_Generator::Type Grid_Generator::type() const { - if (is_line()) + if (is_line()) { return LINE; + } return is_point() ? POINT : PARAMETER; } @@ -33713,20 +34640,25 @@ inline void Grid_Generator::set_divisor(Coefficient_traits::const_reference d) { PPL_ASSERT(!is_line()); - if (is_line_or_parameter()) + if (is_line_or_parameter()) { expr.set_coefficient(Variable(space_dimension()), d); - else + } + else { expr.set_inhomogeneous_term(d); + } } inline Coefficient_traits::const_reference Grid_Generator::divisor() const { - if (is_line()) + if (is_line()) { throw_invalid_argument("divisor()", "*this is a line"); - if (is_line_or_parameter()) + } + if (is_line_or_parameter()) { return expr.coefficient(Variable(space_dimension())); - else + } + else { return expr.inhomogeneous_term(); + } } inline bool @@ -33756,8 +34688,9 @@ inline Coefficient_traits::const_reference Grid_Generator::coefficient(const Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { throw_dimension_incompatible("coefficient(v)", "v", v); + } return expr.coefficient(v); } @@ -34482,18 +35415,21 @@ inline Congruence& Congruence::operator/=(Coefficient_traits::const_reference k) { - if (k >= 0) + if (k >= 0) { modulus_ *= k; - else + } + else { modulus_ *= -k; + } return *this; } /*! \relates Congruence */ inline bool operator==(const Congruence& x, const Congruence& y) { - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { return false; + } Congruence x_temp(x); Congruence y_temp(y); x_temp.strong_normalize(); @@ -34520,8 +35456,9 @@ inline Coefficient_traits::const_reference Congruence::coefficient(const Variable v) const { - if (v.space_dimension() > space_dimension()) + if (v.space_dimension() > space_dimension()) { throw_dimension_incompatible("coefficient(v)", "v", v); + } return expr.coefficient(v); } @@ -34691,8 +35628,9 @@ Coefficient_traits::const_reference c2) { PPL_ASSERT(c1 != 0); PPL_ASSERT(c2 != 0); - if (space_dimension() < y.space_dimension()) + if (space_dimension() < y.space_dimension()) { set_space_dimension(y.space_dimension()); + } linear_combine(y, c1, c2, 0, y.space_dimension() + 1); PPL_ASSERT(OK()); } @@ -34704,8 +35642,9 @@ ::linear_combine_lax(const Linear_Expression_Impl& y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2) { - if (space_dimension() < y.space_dimension()) + if (space_dimension() < y.space_dimension()) { set_space_dimension(y.space_dimension()); + } linear_combine_lax(y, c1, c2, 0, y.space_dimension() + 1); PPL_ASSERT(OK()); } @@ -34725,47 +35664,55 @@ while (i != i_end && j != j_end) { if (i.index() < j.index()) { const int s = sgn(*i); - if (s != 0) + if (s != 0) { return 2*s; + } ++i; continue; } if (i.index() > j.index()) { const int s = sgn(*j); - if (s != 0) + if (s != 0) { return -2*s; + } ++j; continue; } PPL_ASSERT(i.index() == j.index()); const int s = cmp(*i, *j); - if (s < 0) + if (s < 0) { return -2; - if (s > 0) + } + if (s > 0) { return 2; + } PPL_ASSERT(s == 0); ++i; ++j; } for ( ; i != i_end; ++i) { const int s = sgn(*i); - if (s != 0) + if (s != 0) { return 2*s; + } } for ( ; j != j_end; ++j) { const int s = sgn(*j); - if (s != 0) + if (s != 0) { return -2*s; + } } // If all the coefficients in `x' equal all the coefficients in `y' // (starting from position 1) we compare coefficients in position 0, // i.e., inhomogeneous terms. const int comp = cmp(x.row.get(0), y.row.get(0)); - if (comp > 0) + if (comp > 0) { return 1; - if (comp < 0) + } + if (comp < 0) { return -1; + } PPL_ASSERT(comp == 0); // `x' and `y' are equal. @@ -34774,11 +35721,12 @@ template Linear_Expression_Impl::Linear_Expression_Impl(const Variable v) { - if (v.space_dimension() > max_space_dimension()) + if (v.space_dimension() > max_space_dimension()) { throw std::length_error("Linear_Expression_Impl::" "Linear_Expression_Impl(v):\n" "v exceeds the maximum allowed " "space dimension."); + } set_space_dimension(v.space_dimension()); (*this) += v; PPL_ASSERT(OK()); @@ -34794,14 +35742,14 @@ template void -Linear_Expression_Impl::get_row(Dense_Row& row) const { - row = this->row; +Linear_Expression_Impl::get_row(Dense_Row& r) const { + r = this->row; } template void -Linear_Expression_Impl::get_row(Sparse_Row& row) const { - row = this->row; +Linear_Expression_Impl::get_row(Sparse_Row& r) const { + r = this->row; } template @@ -34809,8 +35757,9 @@ Linear_Expression_Impl ::permute_space_dimensions(const std::vector& cycle) { const dimension_type n = cycle.size(); - if (n < 2) + if (n < 2) { return; + } if (n == 2) { row.swap_coefficients(cycle[0].space_dimension(), @@ -34819,11 +35768,13 @@ else { PPL_DIRTY_TEMP_COEFFICIENT(tmp); tmp = row.get(cycle.back().space_dimension()); - for (dimension_type i = n - 1; i-- > 0; ) + for (dimension_type i = n - 1; i-- > 0; ) { row.swap_coefficients(cycle[i + 1].space_dimension(), cycle[i].space_dimension()); - if (tmp == 0) + } + if (tmp == 0) { row.reset(cycle[0].space_dimension()); + } else { using std::swap; swap(tmp, row[cycle[0].space_dimension()]); @@ -34845,16 +35796,19 @@ Linear_Expression_Impl& Linear_Expression_Impl::operator+=(const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) + if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) { throw std::length_error("Linear_Expression_Impl& " "operator+=(e, v):\n" "v exceeds the maximum allowed space dimension."); - if (space_dimension() < v_space_dim) + } + if (space_dimension() < v_space_dim) { set_space_dimension(v_space_dim); + } typename Row::iterator itr = row.insert(v_space_dim); ++(*itr); - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -34873,16 +35827,19 @@ Linear_Expression_Impl& Linear_Expression_Impl::operator-=(const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) + if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) { throw std::length_error("Linear_Expression_Impl& " "operator-=(e, v):\n" "v exceeds the maximum allowed space dimension."); - if (space_dimension() < v_space_dim) + } + if (space_dimension() < v_space_dim) { set_space_dimension(v_space_dim); + } typename Row::iterator itr = row.insert(v_space_dim); --(*itr); - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -34897,8 +35854,9 @@ return *this; } for (typename Row::iterator i = row.begin(), - i_end = row.end(); i != i_end; ++i) + i_end = row.end(); i != i_end; ++i) { (*i) *= n; + } PPL_ASSERT(OK()); return *this; } @@ -34911,10 +35869,12 @@ const typename Row::iterator& i_end = row.end(); while (i != i_end) { (*i) /= n; - if (*i == 0) + if (*i == 0) { i = row.reset(i); - else + } + else { ++i; + } } PPL_ASSERT(OK()); return *this; @@ -34925,8 +35885,9 @@ void Linear_Expression_Impl::negate() { for (typename Row::iterator i = row.begin(), - i_end = row.end(); i != i_end; ++i) + i_end = row.end(); i != i_end; ++i) { neg_assign(*i); + } PPL_ASSERT(OK()); } @@ -34936,18 +35897,22 @@ Linear_Expression_Impl::add_mul_assign(Coefficient_traits::const_reference n, const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) + if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) { throw std::length_error("Linear_Expression_Impl& " "add_mul_assign(e, n, v):\n" "v exceeds the maximum allowed space dimension."); - if (space_dimension() < v_space_dim) + } + if (space_dimension() < v_space_dim) { set_space_dimension(v_space_dim); - if (n == 0) + } + if (n == 0) { return *this; + } typename Row::iterator itr = row.insert(v_space_dim); (*itr) += n; - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -34959,18 +35924,22 @@ ::sub_mul_assign(Coefficient_traits::const_reference n, const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) + if (v_space_dim > Linear_Expression_Impl::max_space_dimension()) { throw std::length_error("Linear_Expression_Impl& " "sub_mul_assign(e, n, v):\n" "v exceeds the maximum allowed space dimension."); - if (space_dimension() < v_space_dim) + } + if (space_dimension() < v_space_dim) { set_space_dimension(v_space_dim); - if (n == 0) + } + if (n == 0) { return *this; + } typename Row::iterator itr = row.insert(v_space_dim); (*itr) -= n; - if (*itr == 0) + if (*itr == 0) { row.reset(itr); + } PPL_ASSERT(OK()); return *this; } @@ -34981,8 +35950,9 @@ Linear_Expression_Impl ::add_mul_assign(Coefficient_traits::const_reference factor, const Linear_Expression_Impl& y) { - if (factor != 0) + if (factor != 0) { linear_combine(y, Coefficient_one(), factor); + } } template @@ -34991,8 +35961,9 @@ Linear_Expression_Impl ::sub_mul_assign(Coefficient_traits::const_reference factor, const Linear_Expression_Impl& y) { - if (factor != 0) + if (factor != 0) { linear_combine(y, Coefficient_one(), -factor); + } } template @@ -35003,22 +35974,27 @@ for (typename Row::const_iterator i = row.lower_bound(1), i_end = row.end(); i != i_end; ++i) { ev = *i; - if (ev == 0) + if (ev == 0) { continue; + } if (!first) { - if (ev > 0) + if (ev > 0) { s << " + "; + } else { s << " - "; neg_assign(ev); } } - else + else { first = false; - if (ev == -1) + } + if (ev == -1) { s << "-"; - else if (ev != 1) + } + else if (ev != 1) { s << ev << "*"; + } IO_Operators::operator<<(s, Variable(i.index() - 1)); } // Inhomogeneous term. @@ -35026,21 +36002,24 @@ it = row[0]; if (it != 0) { if (!first) { - if (it > 0) + if (it > 0) { s << " + "; + } else { s << " - "; neg_assign(it); } } - else + else { first = false; + } s << it; } - if (first) + if (first) { // The null linear expression. s << Coefficient_zero(); + } } template @@ -35053,10 +36032,12 @@ void Linear_Expression_Impl ::set(dimension_type i, Coefficient_traits::const_reference n) { - if (n == 0) + if (n == 0) { row.reset(i); - else + } + else { row.insert(i, n); + } PPL_ASSERT(OK()); } @@ -35069,8 +36050,9 @@ // each of the resulting coefficients will be nonzero iff the initial // coefficient was. for (typename Row::iterator i = row.lower_bound(start), - i_end = row.lower_bound(end); i != i_end; ++i) + i_end = row.lower_bound(end); i != i_end; ++i) { Parma_Polyhedra_Library::exact_div_assign(*i, *i, c); + } PPL_ASSERT(OK()); } @@ -35082,13 +36064,16 @@ if (c == 0) { typename Row::iterator i = row.lower_bound(start); const typename Row::iterator& i_end = row.end(); - while (i != i_end && i.index() < end) + while (i != i_end && i.index() < end) { i = row.reset(i); + } } else { for (typename Row::iterator - i = row.lower_bound(start), i_end = row.lower_bound(end); i != i_end; ++i) + i = row.lower_bound(start), i_end = row.lower_bound(end); + i != i_end; ++i) { (*i) *= c; + } } PPL_ASSERT(OK()); } @@ -35122,8 +36107,9 @@ PPL_ASSERT(c2 == 0); typename Row::iterator i = row.lower_bound(start); const typename Row::iterator& i_end = row.end(); - while (i != i_end && i.index() < end) + while (i != i_end && i.index() < end) { i = row.reset(i); + } } else { PPL_ASSERT(c1 == 0); @@ -35152,8 +36138,9 @@ ++i; ++j; } - while (i != i_end && i.index() < end) + while (i != i_end && i.index() < end) { i = row.reset(i); + } while (j != j_last) { i = row.insert(i, j.index(), *j); (*i) *= c2; @@ -35167,8 +36154,9 @@ PPL_ASSERT(c1 != 0); PPL_ASSERT(c2 == 0); for (typename Row::iterator i = row.lower_bound(start), - i_end = row.lower_bound(end); i != i_end; ++i) + i_end = row.lower_bound(end); i != i_end; ++i) { (*i) *= c1; + } } else { PPL_ASSERT(c1 != 0); @@ -35185,17 +36173,21 @@ typename Row::iterator i = row.lower_bound(1); typename Row::iterator i_end = row.end(); - for ( ; i != i_end; ++i) - if (*i != 0) + for ( ; i != i_end; ++i) { + if (*i != 0) { break; + } + } if (i != i_end && *i < 0) { - for ( ; i != i_end; ++i) + for ( ; i != i_end; ++i) { neg_assign(*i); + } // Negate the first coefficient, too. typename Row::iterator first = row.begin(); - if (first != row.end() && first.index() == 0) + if (first != row.end() && first.index() == 0) { neg_assign(*first); + } } PPL_ASSERT(OK()); } @@ -35207,8 +36199,9 @@ PPL_ASSERT(last <= row.size()); typename Row::iterator i = row.lower_bound(first); typename Row::iterator i_end = row.lower_bound(last); - for ( ; i != i_end; ++i) + for ( ; i != i_end; ++i) { neg_assign(*i); + } PPL_ASSERT(OK()); } @@ -35297,31 +36290,38 @@ typename Row2::const_iterator j_end = y.row.lower_bound(end); while (i != i_end && j != j_end) { if (i.index() == j.index()) { - if (*i != *j) + if (*i != *j) { return false; + } ++i; ++j; } else { if (i.index() < j.index()) { - if (*i != 0) + if (*i != 0) { return false; + } ++i; } else { PPL_ASSERT(i.index() > j.index()); - if (*j != 0) + if (*j != 0) { return false; + } ++j; } } } - for ( ; i != i_end; ++i) - if (*i != 0) + for ( ; i != i_end; ++i) { + if (*i != 0) { return false; - for ( ; j != j_end; ++j) - if (*j != 0) + } + } + for ( ; j != j_end; ++j) { + if (*j != 0) { return false; + } + } return true; } @@ -35340,13 +36340,16 @@ // Deal with trivial cases. if (c1 == 0) { - if (c2 == 0) + if (c2 == 0) { return true; - else + } + else { return y.all_zeroes(start, end); + } } - if (c2 == 0) + if (c2 == 0) { return x.all_zeroes(start, end); + } PPL_ASSERT(c1 != 0); PPL_ASSERT(c2 != 0); @@ -35356,31 +36359,38 @@ typename Row2::const_iterator j_end = y.row.lower_bound(end); while (i != i_end && j != j_end) { if (i.index() == j.index()) { - if ((*i) * c1 != (*j) * c2) + if ((*i) * c1 != (*j) * c2) { return false; + } ++i; ++j; } else { if (i.index() < j.index()) { - if (*i != 0) + if (*i != 0) { return false; + } ++i; } else { PPL_ASSERT(i.index() > j.index()); - if (*j != 0) + if (*j != 0) { return false; + } ++j; } } } - for ( ; i != i_end; ++i) - if (*i != 0) + for ( ; i != i_end; ++i) { + if (*i != 0) { return false; - for ( ; j != j_end; ++j) - if (*j != 0) + } + } + for ( ; j != j_end; ++j) { + if (*j != 0) { return false; + } + } return true; } @@ -35774,8 +36784,8 @@ template Linear_Expression_Impl::const_iterator -::const_iterator(const Row& row1, dimension_type i) - : row(&row1), itr(row1.lower_bound(i)) { +::const_iterator(const Row& r, dimension_type i) + : row(&r), itr(r.lower_bound(i)) { skip_zeroes_forward(); } @@ -35835,8 +36845,9 @@ s << "size " << (space_dimension() + 1) << " "; for (dimension_type i = 0; i < row.size(); ++i) { s << row.get(i); - if (i != row.size() - 1) + if (i != row.size() - 1) { s << ' '; + } } } @@ -35845,14 +36856,17 @@ Linear_Expression_Impl::ascii_load(std::istream& s) { std::string str; - if (!(s >> str)) + if (!(s >> str)) { return false; - if (str != "size") + } + if (str != "size") { return false; + } dimension_type new_size; - if (!(s >> new_size)) + if (!(s >> new_size)) { return false; + } row.resize(0); row.resize(new_size); @@ -35860,10 +36874,12 @@ PPL_DIRTY_TEMP_COEFFICIENT(c); for (dimension_type j = 0; j < new_size; ++j) { - if (!(s >> c)) + if (!(s >> c)) { return false; - if (c != 0) + } + if (c != 0) { row.insert(j, c); + } } PPL_ASSERT(OK()); @@ -37633,10 +38649,11 @@ ::IO_Operators::operator<<<>(std::ostream& s, const Box& box); template - friend bool Parma_Polyhedra_Library::l_m_distance_assign - (Checked_Number& r, - const Box& x, const Box& y, const Rounding_Dir dir, - Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::l_m_distance_assign(Checked_Number& r, + const Box& x, const Box& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); //! The type of sequence used to implement the box. typedef std::vector Sequence; @@ -37744,7 +38761,7 @@ void reset(flags_t mask); }; -/* Automatically generated from PPL source file ../src/Box_defs.hh line 1768. */ +/* Automatically generated from PPL source file ../src/Box_defs.hh line 1769. */ #undef PPL_IN_Box_CLASS //! The status flags to keep track of the internal state. @@ -38218,7 +39235,8 @@ interval_relation(const ITV& i, const Constraint::Type constraint_type, Coefficient_traits::const_reference numer, - Coefficient_traits::const_reference denom = 1); + Coefficient_traits::const_reference denom + = Coefficient_one()); class Box_Helpers { public: @@ -38395,9 +39413,9 @@ namespace Boxes { // These are the keywords that indicate the individual assertions. -const std::string empty_up_to_date = "EUP"; -const std::string empty = "EM"; -const std::string universe = "UN"; +extern const char* empty_up_to_date; +extern const char* empty; +extern const char* universe; const char yes = '+'; const char no = '-'; const char separator = ' '; @@ -38410,12 +39428,13 @@ is on; it is set to false otherwise. */ inline bool -get_field(std::istream& s, const std::string& keyword, bool& positive) { +get_field(std::istream& s, const char* keyword, bool& positive) { std::string str; if (!(s >> str) || (str[0] != yes && str[0] != no) - || str.substr(1) != keyword) + || str.substr(1) != keyword) { return false; + } positive = (str[0] == yes); return true; } @@ -38441,22 +39460,28 @@ using namespace Implementation::Boxes; PPL_UNINITIALIZED(bool, positive); - if (!get_field(s, Implementation::Boxes::empty_up_to_date, positive)) + if (!get_field(s, Implementation::Boxes::empty_up_to_date, positive)) { return false; - if (positive) + } + if (positive) { set_empty_up_to_date(); + } - if (!get_field(s, Implementation::Boxes::empty, positive)) + if (!get_field(s, Implementation::Boxes::empty, positive)) { return false; - if (positive) + } + if (positive) { set_empty(); - - if (!get_field(s, universe, positive)) + } + if (!get_field(s, universe, positive)) { return false; - if (positive) + } + if (positive) { set_universe(); - else + } + else { reset_universe(); + } // Check invariants. PPL_ASSERT(OK()); @@ -38500,9 +39525,7 @@ } // namespace Parma_Polyhedra_Library /* Automatically generated from PPL source file ../src/Swapping_Vector_defs.hh line 29. */ - #include -/* Automatically generated from PPL source file ../src/Swapping_Vector_defs.hh line 32. */ namespace Parma_Polyhedra_Library { @@ -38572,6 +39595,8 @@ */ +/* Automatically generated from PPL source file ../src/Swapping_Vector_inlines.hh line 28. */ + namespace Parma_Polyhedra_Library { template @@ -38615,8 +39640,9 @@ using std::swap; // Steal the old elements. - for (dimension_type i = impl.size(); i-- > 0; ) + for (dimension_type i = impl.size(); i-- > 0; ) { swap(new_impl[i], impl[i]); + } // Put the new vector into place. swap(impl, new_impl); @@ -38704,8 +39730,9 @@ Swapping_Vector::external_memory_in_bytes() const { // Estimate the size of vector. memory_size_type n = impl.capacity() * sizeof(T); - for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) + for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) { n += i->external_memory_in_bytes(); + } return n; } @@ -38741,8 +39768,9 @@ const dimension_type old_i = itr - begin(); dimension_type i = old_i; ++i; - while (i != size()) + while (i != size()) { swap(impl[i-1], impl[i]); + } impl.pop_back(); return begin() + old_i; } @@ -38758,8 +39786,9 @@ const diff_t k = last - first; const dimension_type n = static_cast(end() - last); using std::swap; - for (dimension_type i = 0; i < n; ++i, ++first) + for (dimension_type i = 0; i < n; ++i, ++first) { swap(*first, *(first + k)); + } impl.erase(end() - k, end()); return old_first; } @@ -38779,7 +39808,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Swapping_Vector_defs.hh line 97. */ +/* Automatically generated from PPL source file ../src/Swapping_Vector_defs.hh line 95. */ /* Automatically generated from PPL source file ../src/Linear_System_defs.hh line 33. */ @@ -39952,8 +40981,9 @@ PPL_ASSERT(topology() == NOT_NECESSARILY_CLOSED); row_topology = NECESSARILY_CLOSED; ++space_dimension_; - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].mark_as_necessarily_closed(); + } } template @@ -39963,17 +40993,20 @@ PPL_ASSERT(space_dimension() > 0); row_topology = NOT_NECESSARILY_CLOSED; --space_dimension_; - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].mark_as_not_necessarily_closed(); + } } template inline void Linear_System::set_topology(Topology t) { - if (topology() == t) + if (topology() == t) { return; - for (dimension_type i = num_rows(); i-- > 0; ) + } + for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].set_topology(t); + } row_topology = t; PPL_ASSERT(OK()); } @@ -40054,8 +41087,9 @@ inline void Linear_System::set_representation(Representation r) { representation_ = r; - for (dimension_type i = 0; i < rows.size(); ++i) + for (dimension_type i = 0; i < rows.size(); ++i) { rows[i].set_representation(r); + } PPL_ASSERT(OK()); } @@ -40074,8 +41108,9 @@ template inline void Linear_System::set_space_dimension_no_ok(dimension_type space_dim) { - for (dimension_type i = rows.size(); i-- > 0; ) + for (dimension_type i = rows.size(); i-- > 0; ) { rows[i].set_space_dimension_no_ok(space_dim); + } space_dimension_ = space_dim; } @@ -40094,17 +41129,20 @@ const bool was_pending = (i >= index_first_pending); if (sorted && keep_sorted && !was_pending) { - for (dimension_type j = i + 1; j < rows.size(); ++j) + for (dimension_type j = i + 1; j < rows.size(); ++j) { swap(rows[j], rows[j-1]); + } rows.pop_back(); } else { - if (!was_pending) + if (!was_pending) { sorted = false; + } const bool last_row_is_pending = (num_rows() - 1 >= index_first_pending); - if (was_pending == last_row_is_pending) + if (was_pending == last_row_is_pending) { // Either both rows are pending or both rows are not pending. swap(rows[i], rows.back()); + } else { // Pending rows are stored after the non-pending ones. PPL_ASSERT(!was_pending); @@ -40119,9 +41157,10 @@ } rows.pop_back(); } - if (!was_pending) + if (!was_pending) { // A non-pending row has been removed. --index_first_pending; + } } template @@ -40141,8 +41180,9 @@ PPL_ASSERT(last <= num_rows()); const dimension_type n = last - first; - if (n == 0) + if (n == 0) { return; + } // All the rows that have to be removed must have the same (pending or // non-pending) status. @@ -40153,8 +41193,9 @@ // Move the rows in [first,last) at the end of the system. if (sorted && keep_sorted && !were_pending) { // Preserve the row ordering. - for (dimension_type i = last; i < rows.size(); ++i) + for (dimension_type i = last; i < rows.size(); ++i) { swap(rows[i], rows[i - n]); + } rows.resize(rows.size() - n); @@ -40251,16 +41292,19 @@ offset += k; } - if (first == last) + if (first == last) { // Nothing to do. return; + } - for (dimension_type i = first; i < last; ++i) + for (dimension_type i = first; i < last; ++i) { swap(rows[i], rows[i + offset]); + } - if (first < index_first_pending) + if (first < index_first_pending) { // The swaps involved not pending rows, so they may not be sorted anymore. set_sorted(false); + } PPL_ASSERT(OK()); } @@ -40277,13 +41321,15 @@ // Check that the last index (if any) is lower than num_rows(). // This guarantees that all indexes are in [0, num_rows()). - if (!indexes.empty()) + if (!indexes.empty()) { PPL_ASSERT(indexes.back() < num_rows()); + } } #endif - if (indexes.empty()) + if (indexes.empty()) { return; + } const dimension_type rows_size = rows.size(); typedef std::vector::const_iterator itr_t; @@ -40355,8 +41401,9 @@ Linear_System::remove_trailing_rows(const dimension_type n) { PPL_ASSERT(rows.size() >= n); rows.resize(rows.size() - n); - if (first_pending_row() > rows.size()) + if (first_pending_row() > rows.size()) { index_first_pending = rows.size(); + } PPL_ASSERT(OK()); } @@ -40364,8 +41411,9 @@ inline void Linear_System ::permute_space_dimensions(const std::vector& cycle) { - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { rows[i].permute_space_dimensions(cycle); + } sorted = false; PPL_ASSERT(OK()); } @@ -40376,8 +41424,9 @@ ::swap_space_dimensions(Variable v1, Variable v2) { PPL_ASSERT(v1.space_dimension() <= space_dimension()); PPL_ASSERT(v2.space_dimension() <= space_dimension()); - for (dimension_type k = num_rows(); k-- > 0; ) + for (dimension_type k = num_rows(); k-- > 0; ) { rows[k].swap_space_dimensions(v1, v2); + } sorted = false; PPL_ASSERT(OK()); } @@ -40591,8 +41640,8 @@ */ +/* Automatically generated from PPL source file ../src/Bit_Matrix_inlines.hh line 28. */ #include -/* Automatically generated from PPL source file ../src/Bit_Matrix_inlines.hh line 29. */ namespace Parma_Polyhedra_Library { @@ -40629,8 +41678,9 @@ // The number of rows to be erased cannot be greater // than the actual number of the rows of the matrix. PPL_ASSERT(n <= rows.size()); - if (n != 0) + if (n != 0) { rows.resize(rows.size() - n); + } PPL_ASSERT(OK()); } @@ -40645,9 +41695,8 @@ inline void Bit_Matrix::m_swap(Bit_Matrix& y) { - using std::swap; - swap(row_size, y.row_size); - swap(rows, y.rows); + std::swap(row_size, y.row_size); + std::swap(rows, y.rows); } inline Bit_Row& @@ -40676,8 +41725,7 @@ Bit_Matrix::clear() { // Clear `rows' and minimize its capacity. std::vector tmp; - using std::swap; - swap(tmp, rows); + std::swap(tmp, rows); row_size = 0; } @@ -41051,12 +42099,6 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Linear_System_templates.hh line 31. */ -#include -#include -#include -#include - /* Automatically generated from PPL source file ../src/swapping_sort_templates.hh line 1. */ /* Sorting objects for which copies cost more than swaps. */ @@ -41150,8 +42192,9 @@ PPL_ASSERT(num_elems >= 2); std::vector iv; iv.reserve(num_elems); - for (index_type i = 0, i_end = num_elems; i != i_end; ++i) + for (index_type i = 0, i_end = num_elems; i != i_end; ++i) { iv.push_back(i); + } typedef typename std::vector::iterator Iter; const Iter iv_begin = iv.begin(); @@ -41178,23 +42221,27 @@ } // Restore `iv' indices to 0 .. num_elems-1 for the call to unique. - for (index_type i = num_elems; i-- > 0; ) + for (index_type i = num_elems; i-- > 0; ) { iv[i] = i; + } // Unique `iv' by comparing the rows indexed by its elements. iv_end = std::unique(iv_begin, iv_end, unique_cmp); const index_type num_sorted = static_cast(iv_end - iv_begin); const index_type num_duplicates = num_elems - num_sorted; - if (num_duplicates == 0) + if (num_duplicates == 0) { return 0; + } // There were duplicates: swap the rows according to `iv'. index_type dst = 0; - while (dst < num_sorted && dst == iv[dst]) + while (dst < num_sorted && dst == iv[dst]) { ++dst; - if (dst == num_sorted) + } + if (dst == num_sorted) { return num_duplicates; + } do { const index_type src = iv[dst]; indirect_swap(src, dst); @@ -41214,7 +42261,11 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Linear_System_templates.hh line 37. */ +/* Automatically generated from PPL source file ../src/Linear_System_templates.hh line 32. */ +#include +#include +#include +#include namespace Parma_Polyhedra_Library { @@ -41224,9 +42275,11 @@ PPL_ASSERT(num_pending_rows() == 0); const Linear_System& x = *this; dimension_type n = 0; - for (dimension_type i = num_rows(); i-- > 0; ) - if (x[i].is_line_or_equality()) + for (dimension_type i = num_rows(); i-- > 0; ) { + if (x[i].is_line_or_equality()) { ++n; + } + } return n; } @@ -41258,9 +42311,10 @@ tmp.resize(tmp.size() + 1); swap(tmp.back(), x.rows[xi++]); tmp.back().set_representation(representation()); - if (comp == 0) + if (comp == 0) { // A duplicate element. ++yi; + } } else { // (comp > 0) @@ -41270,18 +42324,20 @@ } } // Insert what is left. - if (xi < x_num_rows) + if (xi < x_num_rows) { while (xi < x_num_rows) { tmp.resize(tmp.size() + 1); swap(tmp.back(), x.rows[xi++]); tmp.back().set_representation(representation()); } - else + } + else { while (yi < y_num_rows) { tmp.resize(tmp.size() + 1); Row copy(y[yi++], space_dimension(), representation()); swap(tmp.back(), copy); } + } // We get the result matrix and let the old one be destroyed. swap(tmp, rows); @@ -41308,8 +42364,9 @@ << "\n" << "index_first_pending " << first_pending_row() << "\n"; - for (dimension_type i = 0; i < rows.size(); ++i) + for (dimension_type i = 0; i < rows.size(); ++i) { rows[i].ascii_dump(s); + } } PPL_OUTPUT_TEMPLATE_DEFINITIONS_ASCII_ONLY(Row, Linear_System) @@ -41318,19 +42375,23 @@ bool Linear_System::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "topology") + if (!(s >> str) || str != "topology") { return false; - if (!(s >> str)) + } + if (!(s >> str)) { return false; + } clear(); Topology t; - if (str == "NECESSARILY_CLOSED") + if (str == "NECESSARILY_CLOSED") { t = NECESSARILY_CLOSED; + } else { - if (str != "NOT_NECESSARILY_CLOSED") + if (str != "NOT_NECESSARILY_CLOSED") { return false; + } t = NOT_NECESSARILY_CLOSED; } @@ -41338,31 +42399,39 @@ dimension_type nrows; dimension_type space_dims; - if (!(s >> nrows)) + if (!(s >> nrows)) { return false; - if (!(s >> str) || str != "x") + } + if (!(s >> str) || str != "x") { return false; - if (!(s >> space_dims)) + } + if (!(s >> space_dims)) { return false; + } space_dimension_ = space_dims; - if (!Parma_Polyhedra_Library::ascii_load(s, representation_)) + if (!Parma_Polyhedra_Library::ascii_load(s, representation_)) { return false; + } - if (!(s >> str) || (str != "(sorted)" && str != "(not_sorted)")) + if (!(s >> str) || (str != "(sorted)" && str != "(not_sorted)")) { return false; + } const bool sortedness = (str == "(sorted)"); dimension_type index; - if (!(s >> str) || str != "index_first_pending") + if (!(s >> str) || str != "index_first_pending") { return false; - if (!(s >> index)) + } + if (!(s >> index)) { return false; + } Row row; for (dimension_type i = 0; i < nrows; ++i) { - if (!row.ascii_load(s)) + if (!row.ascii_load(s)) { return false; + } insert(row, Recycle_Input()); } index_first_pending = index; @@ -41407,9 +42476,10 @@ // If it is not the greatest one then the system is no longer sorted. sorted = (compare(rows[nrows-2], rows[nrows-1]) <= 0); } - else + else { // A system having only one row is sorted. sorted = true; + } } unset_pending_rows(); @@ -41431,10 +42501,12 @@ r.set_representation(representation()); - if (space_dimension() < r.space_dimension()) + if (space_dimension() < r.space_dimension()) { set_space_dimension_no_ok(r.space_dimension()); - else + } + else { r.set_space_dimension_no_ok(space_dimension()); + } rows.resize(rows.size() + 1); swap(rows.back(), r); @@ -41470,8 +42542,9 @@ // Steal the rows of `y'. // This loop must use an increasing index (instead of a decreasing one) to // preserve the row ordering. - for (dimension_type i = 0; i < y.num_rows(); ++i) + for (dimension_type i = 0; i < y.num_rows(); ++i) { x.insert_pending(y.rows[i], Recycle_Input()); + } y.clear(); @@ -41491,18 +42564,21 @@ PPL_ASSERT(num_pending_rows() == 0); // Adding no rows is a no-op. - if (y.has_no_rows()) + if (y.has_no_rows()) { return; + } // Check if sortedness is preserved. if (is_sorted()) { - if (!y.is_sorted() || y.num_pending_rows() > 0) + if (!y.is_sorted() || y.num_pending_rows() > 0) { sorted = false; + } else { // `y' is sorted and has no pending rows. const dimension_type n_rows = num_rows(); - if (n_rows > 0) + if (n_rows > 0) { sorted = (compare(rows[n_rows-1], y[0]) <= 0); + } } } @@ -41526,8 +42602,9 @@ // The removal of no dimensions from any system is a no-op. This // case also captures the only legal removal of dimensions from a // 0-dim system. - if (vars.empty()) + if (vars.empty()) { return; + } // NOTE: num_rows() is *not* constant, because it may be decreased by // remove_row_no_ok(). @@ -41540,8 +42617,9 @@ // the old one. remove_row_no_ok(i, false); } - else + else { ++i; + } } space_dimension_ -= vars.size(); @@ -41555,8 +42633,9 @@ // NOTE: v.id() may be equal to the space dimension of the system // (when no space dimension need to be shifted). PPL_ASSERT(v.id() <= space_dimension()); - for (dimension_type i = rows.size(); i-- > 0; ) + for (dimension_type i = rows.size(); i-- > 0; ) { rows[i].shift_space_dimensions(v, n); + } space_dimension_ += n; PPL_ASSERT(OK()); } @@ -41583,8 +42662,9 @@ const dimension_type old_num_pending = num_pending_rows(); const dimension_type num_elems = last_row - first_row; - if (num_elems < 2) + if (num_elems < 2) { return; + } // Build the function objects implementing indirect sort comparison, // indirect unique comparison and indirect swap operation. @@ -41622,8 +42702,9 @@ Linear_System::strong_normalize() { const dimension_type nrows = rows.size(); // We strongly normalize also the pending rows. - for (dimension_type i = nrows; i-- > 0; ) + for (dimension_type i = nrows; i-- > 0; ) { rows[i].strong_normalize(); + } sorted = (nrows <= 1); PPL_ASSERT(OK()); } @@ -41633,8 +42714,9 @@ Linear_System::sign_normalize() { const dimension_type nrows = rows.size(); // We sign-normalize also the pending rows. - for (dimension_type i = nrows; i-- > 0; ) + for (dimension_type i = nrows; i-- > 0; ) { rows[i].sign_normalize(); + } sorted = (nrows <= 1); PPL_ASSERT(OK()); } @@ -41643,22 +42725,27 @@ template bool operator==(const Linear_System& x, const Linear_System& y) { - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { return false; + } const dimension_type x_num_rows = x.num_rows(); const dimension_type y_num_rows = y.num_rows(); - if (x_num_rows != y_num_rows) + if (x_num_rows != y_num_rows) { return false; - if (x.first_pending_row() != y.first_pending_row()) + } + if (x.first_pending_row() != y.first_pending_row()) { return false; + } // TODO: Check if the following comment is up to date. // Notice that calling operator==(const Swapping_Vector&, // const Swapping_Vector&) // would be wrong here, as equality of the type fields would // not be checked. - for (dimension_type i = x_num_rows; i-- > 0; ) - if (x[i] != y[i]) + for (dimension_type i = x_num_rows; i-- > 0; ) { + if (x[i] != y[i]) { return false; + } + } return true; } @@ -41691,8 +42778,9 @@ if (num_pending_rows() > 0) { // In this case, we must put the duplicates after the pending rows. const dimension_type n_rows = num_rows() - 1; - for (dimension_type i = 0; i < num_duplicates; ++i) + for (dimension_type i = 0; i < num_duplicates; ++i) { swap(rows[new_first_pending_row + i], rows[n_rows - i]); + } } // Erasing the duplicated rows... @@ -41716,8 +42804,9 @@ PPL_ASSERT(num_pending_rows() == 0); PPL_ASSERT(n_lines_or_equalities == num_lines_or_equalities()); #ifndef NDEBUG - for (dimension_type i = n_lines_or_equalities; i-- > 0; ) + for (dimension_type i = n_lines_or_equalities; i-- > 0; ) { PPL_ASSERT((*this)[i].is_line_or_equality()); + } #endif dimension_type rank = 0; @@ -41729,12 +42818,13 @@ // TODO: Consider exploiting the row (possible) sparseness of rows in the // following loop, if needed. It would probably make it more cache-efficient // for dense rows, too. - for (dimension_type j = num_cols; j-- > 0; ) + for (dimension_type j = num_cols; j-- > 0; ) { for (dimension_type i = rank; i < n_lines_or_equalities; ++i) { // Search for the first row having a non-zero coefficient // (the pivot) in the j-th column. - if ((*this)[i].expr.get(j) == 0) + if ((*this)[i].expr.get(j) == 0) { continue; + } // Pivot found: if needed, swap rows so that this one becomes // the rank-th row in the linear system. if (i > rank) { @@ -41756,8 +42846,10 @@ // Consider another column index `j'. break; } - if (changed) + } + if (changed) { sorted = false; + } PPL_ASSERT(OK()); return rank; @@ -41773,8 +42865,9 @@ PPL_ASSERT(num_pending_rows() == 0); PPL_ASSERT(n_lines_or_equalities <= num_lines_or_equalities()); #ifndef NDEBUG - for (dimension_type i = n_lines_or_equalities; i-- > 0; ) + for (dimension_type i = n_lines_or_equalities; i-- > 0; ) { PPL_ASSERT((*this)[i].is_line_or_equality()); + } #endif const dimension_type nrows = num_rows(); @@ -41783,8 +42876,9 @@ // This deque of Booleans will be used to flag those rows that, // before exiting, need to be re-checked for sortedness. std::deque check_for_sortedness; - if (still_sorted) + if (still_sorted) { check_for_sortedness.insert(check_for_sortedness.end(), nrows, false); + } for (dimension_type k = n_lines_or_equalities; k-- > 0; ) { // For each line or equality, starting from the last one, @@ -41805,8 +42899,9 @@ if (still_sorted) { // Trying to keep sortedness: remember which rows // have to be re-checked for sortedness at the end. - if (i > 0) + if (i > 0) { check_for_sortedness[i-1] = true; + } check_for_sortedness[i] = true; } } @@ -41818,8 +42913,9 @@ // by a negative factor, the coefficient of the pivot must be // forced to be positive. const bool have_to_negate = (row_k.expr.get(Variable(j - 1)) < 0); - if (have_to_negate) + if (have_to_negate) { neg_assign(row_k.expr); + } // NOTE: Here row_k will *not* be ok if we have negated it. @@ -41836,24 +42932,28 @@ if (still_sorted) { // Trying to keep sortedness: remember which rows // have to be re-checked for sortedness at the end. - if (i > n_lines_or_equalities) + if (i > n_lines_or_equalities) { check_for_sortedness[i-1] = true; + } check_for_sortedness[i] = true; } } } - if (have_to_negate) + if (have_to_negate) { // Negate `row_k' to restore strong-normalization. neg_assign(row_k.expr); + } PPL_ASSERT(row_k.OK()); } // Trying to keep sortedness. - for (dimension_type i = 0; still_sorted && i+1 < nrows; ++i) - if (check_for_sortedness[i]) + for (dimension_type i = 0; still_sorted && i+1 < nrows; ++i) { + if (check_for_sortedness[i]) { // Have to check sortedness of `(*this)[i]' with respect to `(*this)[i+1]'. still_sorted = (compare((*this)[i], (*this)[i+1]) <= 0); + } + } // Set the sortedness flag. sorted = still_sorted; @@ -41871,7 +42971,7 @@ const dimension_type old_nrows = num_rows(); dimension_type nrows = old_nrows; dimension_type n_lines_or_equalities = 0; - for (dimension_type i = 0; i < nrows; ++i) + for (dimension_type i = 0; i < nrows; ++i) { if ((*this)[i].is_line_or_equality()) { if (n_lines_or_equalities < i) { swap(rows[i], rows[n_lines_or_equalities]); @@ -41880,6 +42980,7 @@ } ++n_lines_or_equalities; } + } // Apply Gaussian elimination to the subsystem of lines/equalities. const dimension_type rank = gauss(n_lines_or_equalities); // Eliminate any redundant line/equality that has been detected. @@ -41889,11 +42990,13 @@ const dimension_type num_swaps = std::min(n_lines_or_equalities - rank, n_rays_or_points_or_inequalities); - for (dimension_type i = num_swaps; i-- > 0; ) + for (dimension_type i = num_swaps; i-- > 0; ) { swap(rows[--nrows], rows[rank + i]); + } remove_trailing_rows(old_nrows - nrows); - if (n_rays_or_points_or_inequalities > num_swaps) + if (n_rays_or_points_or_inequalities > num_swaps) { set_sorted(false); + } unset_pending_rows(); n_lines_or_equalities = rank; } @@ -41915,8 +43018,9 @@ set_space_dimension(space_dimension() + n); rows.resize(rows.size() + n); // The old system is moved to the bottom. - for (dimension_type i = old_n_rows; i-- > 0; ) + for (dimension_type i = old_n_rows; i-- > 0; ) { swap(rows[i], rows[i + n]); + } for (dimension_type i = n, c = old_space_dim; i-- > 0; ) { // The top right-hand sub-system (i.e., the system made of new // rows and columns) is set to the specular image of the identity @@ -41942,8 +43046,9 @@ } // If the old system was empty, the last row added is either // a positivity constraint or a point. - if (was_sorted) + if (was_sorted) { sorted = (compare(rows[n-1], rows[n]) <= 0); + } // If the system is not necessarily closed, move the epsilon coefficients to // the last column. @@ -42003,27 +43108,32 @@ // By initial sortedness, we can increment index `k1'. ++k1; // Do not increment `k2'; instead, swap there the next pending row. - if (k2 < num_rows) + if (k2 < num_rows) { swap(rows[k2], rows[k2 + num_duplicates]); + } } - else if (cmp < 0) + else if (cmp < 0) { // By initial sortedness, we can increment `k1'. ++k1; + } else { // Here `cmp > 0'. // Increment `k2' and, if we already found any duplicate, // swap the next pending row in position `k2'. ++k2; - if (num_duplicates > 0 && k2 < num_rows) + if (num_duplicates > 0 && k2 < num_rows) { swap(rows[k2], rows[k2 + num_duplicates]); + } } } // If needed, swap any duplicates found past the pending rows // that has not been considered yet; then erase the duplicates. if (num_duplicates > 0) { - if (k2 < num_rows) - for (++k2; k2 < num_rows; ++k2) + if (k2 < num_rows) { + for (++k2; k2 < num_rows; ++k2) { swap(rows[k2], rows[k2 + num_duplicates]); + } + } rows.resize(num_rows); } sorted = true; @@ -42033,9 +43143,11 @@ template bool Linear_System::check_sorted() const { - for (dimension_type i = first_pending_row(); i-- > 1; ) - if (compare(rows[i], rows[i-1]) < 0) + for (dimension_type i = first_pending_row(); i-- > 1; ) { + if (compare(rows[i], rows[i-1]) < 0) { return false; + } + } return true; } @@ -42064,7 +43176,7 @@ } } - for (dimension_type i = rows.size(); i-- > 0; ) + for (dimension_type i = rows.size(); i-- > 0; ) { if (rows[i].topology() != topology()) { #ifndef NDEBUG cerr << "Linear_System has a row with the wrong topology!" @@ -42073,6 +43185,7 @@ return false; } + } // `index_first_pending' must be less than or equal to `num_rows()'. if (first_pending_row() > num_rows()) { #ifndef NDEBUG @@ -42084,7 +43197,7 @@ // Check for topology mismatches. const dimension_type n_rows = num_rows(); - for (dimension_type i = 0; i < n_rows; ++i) + for (dimension_type i = 0; i < n_rows; ++i) { if (topology() != rows[i].topology()) { #ifndef NDEBUG cerr << "Topology mismatch between the system " @@ -42094,6 +43207,7 @@ return false; } + } if (sorted && !check_sorted()) { #ifndef NDEBUG cerr << "The system declares itself to be sorted but it is not!" @@ -42115,6 +43229,7 @@ /* Automatically generated from PPL source file ../src/Constraint_System_defs.hh line 38. */ #include #include +#include namespace Parma_Polyhedra_Library { @@ -42687,7 +43802,7 @@ class Parma_Polyhedra_Library::Constraint_System_const_iterator : public std::iterator { public: @@ -42939,9 +44054,10 @@ inline void Constraint_System::add_low_level_constraints() { - if (sys.is_necessarily_closed()) + if (sys.is_necessarily_closed()) { // The positivity constraint. insert(Constraint::zero_dim_positivity()); + } else { // Add the epsilon constraints. insert(Constraint::epsilon_leq_one()); @@ -43186,6 +44302,7 @@ /* Automatically generated from PPL source file ../src/Congruence_System_defs.hh line 35. */ #include +#include namespace Parma_Polyhedra_Library { @@ -43402,7 +44519,7 @@ class const_iterator : public std::iterator { public: @@ -43776,8 +44893,9 @@ space_dimension_(cgs.space_dimension_), representation_(r) { if (cgs.representation() != r) { - for (dimension_type i = 0; i < num_rows(); ++i) + for (dimension_type i = 0; i < num_rows(); ++i) { rows[i].set_representation(representation()); + } } } @@ -43806,11 +44924,13 @@ inline void Congruence_System::set_representation(Representation r) { - if (representation_ == r) + if (representation_ == r) { return; + } representation_ = r; - for (dimension_type i = 0; i < num_rows(); ++i) + for (dimension_type i = 0; i < num_rows(); ++i) { rows[i].set_representation(r); + } PPL_ASSERT(OK()); } @@ -44063,9 +45183,9 @@ template inline const ITV& Box::get_interval(const Variable var) const { - if (space_dimension() < var.space_dimension()) + if (space_dimension() < var.space_dimension()) { throw_dimension_incompatible("get_interval(v)", "v", var); - + } if (is_empty()) { static ITV empty_interval(EMPTY); return empty_interval; @@ -44078,14 +45198,15 @@ inline void Box::set_interval(const Variable var, const ITV& i) { const dimension_type space_dim = space_dimension(); - if (space_dim < var.space_dimension()) + if (space_dim < var.space_dimension()) { throw_dimension_incompatible("set_interval(v, i)", "v", var); + } - if (is_empty() && space_dim >= 2) + if (is_empty() && space_dim >= 2) { // If the box is empty, and has dimension >= 2, setting only one // interval will not make it non-empty. return; - + } seq[var.id()] = i; reset_empty_up_to_date(); @@ -44155,15 +45276,17 @@ const dimension_type m) { const dimension_type space_dim = space_dimension(); // `var' should be one of the dimensions of the vector space. - if (var.space_dimension() > space_dim) + if (var.space_dimension() > space_dim) { throw_dimension_incompatible("expand_space_dimension(v, m)", "v", var); + } // The space dimension of the resulting Box should not // overflow the maximum allowed space dimension. - if (m > max_space_dimension() - space_dim) + if (m > max_space_dimension() - space_dim) { throw_invalid_argument("expand_dimension(v, m)", "adding m new space dimensions exceeds " "the maximum allowed space dimension"); + } // To expand the space dimension corresponding to variable `var', // we append to the box `m' copies of the corresponding interval. @@ -44188,9 +45311,9 @@ PPL_ASSERT(k < seq.size()); const ITV& seq_k = seq[k]; - if (seq_k.lower_is_boundary_infinity()) + if (seq_k.lower_is_boundary_infinity()) { return false; - + } closed = !seq_k.lower_is_open(); PPL_DIRTY_TEMP(mpq_class, lr); @@ -44212,8 +45335,9 @@ PPL_ASSERT(k < seq.size()); const ITV& seq_k = seq[k]; - if (seq_k.upper_is_boundary_infinity()) + if (seq_k.upper_is_boundary_infinity()) { return false; + } closed = !seq_k.upper_is_open(); @@ -44230,8 +45354,9 @@ Box::add_constraint(const Constraint& c) { const dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dimension()) + if (c_space_dim > space_dimension()) { throw_dimension_incompatible("add_constraint(c)", c); + } add_constraint_no_check(c); } @@ -44240,8 +45365,9 @@ inline void Box::add_constraints(const Constraint_System& cs) { // Dimension-compatibility check. - if (cs.space_dimension() > space_dimension()) + if (cs.space_dimension() > space_dimension()) { throw_dimension_incompatible("add_constraints(cs)", cs); + } add_constraints_no_check(cs); } @@ -44257,8 +45383,9 @@ Box::add_congruence(const Congruence& cg) { const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dimension()) + if (cg_space_dim > space_dimension()) { throw_dimension_incompatible("add_congruence(cg)", cg); + } add_congruence_no_check(cg); } @@ -44266,8 +45393,9 @@ template inline void Box::add_congruences(const Congruence_System& cgs) { - if (cgs.space_dimension() > space_dimension()) + if (cgs.space_dimension() > space_dimension()) { throw_dimension_incompatible("add_congruences(cgs)", cgs); + } add_congruences_no_check(cgs); } @@ -44366,12 +45494,14 @@ Box::refine_with_constraint(const Constraint& c) { const dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dimension()) + if (c_space_dim > space_dimension()) { throw_dimension_incompatible("refine_with_constraint(c)", c); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; + } refine_no_check(c); } @@ -44380,13 +45510,14 @@ inline void Box::refine_with_constraints(const Constraint_System& cs) { // Dimension-compatibility check. - if (cs.space_dimension() > space_dimension()) + if (cs.space_dimension() > space_dimension()) { throw_dimension_incompatible("refine_with_constraints(cs)", cs); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; - + } refine_no_check(cs); } @@ -44395,13 +45526,13 @@ Box::refine_with_congruence(const Congruence& cg) { const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dimension()) + if (cg_space_dim > space_dimension()) { throw_dimension_incompatible("refine_with_congruence(cg)", cg); - + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; - + } refine_no_check(cg); } @@ -44409,12 +45540,14 @@ inline void Box::refine_with_congruences(const Congruence_System& cgs) { // Dimension-compatibility check. - if (cgs.space_dimension() > space_dimension()) + if (cgs.space_dimension() > space_dimension()) { throw_dimension_incompatible("refine_with_congruences(cgs)", cgs); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; + } refine_no_check(cgs); } @@ -44424,13 +45557,14 @@ Box::propagate_constraint(const Constraint& c) { const dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dimension()) + if (c_space_dim > space_dimension()) { throw_dimension_incompatible("propagate_constraint(c)", c); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; - + } propagate_constraint_no_check(c); } @@ -44439,12 +45573,14 @@ Box::propagate_constraints(const Constraint_System& cs, const dimension_type max_iterations) { // Dimension-compatibility check. - if (cs.space_dimension() > space_dimension()) + if (cs.space_dimension() > space_dimension()) { throw_dimension_incompatible("propagate_constraints(cs)", cs); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; + } propagate_constraints_no_check(cs, max_iterations); } @@ -44454,20 +45590,24 @@ Box::unconstrain(const Variable var) { const dimension_type var_id = var.id(); // Dimension-compatibility check. - if (space_dimension() < var_id + 1) + if (space_dimension() < var_id + 1) { throw_dimension_incompatible("unconstrain(var)", var_id + 1); + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; + } // Here the box might still be empty (but we haven't detected it yet): // check emptiness of the interval for `var' before cylindrification. ITV& seq_var = seq[var_id]; - if (seq_var.is_empty()) + if (seq_var.is_empty()) { set_empty(); - else + } + else { seq_var.assign(UNIVERSE); + } PPL_ASSERT(OK()); } @@ -44839,6 +45979,7 @@ /* Automatically generated from PPL source file ../src/Generator_System_defs.hh line 35. */ #include +#include namespace Parma_Polyhedra_Library { @@ -45485,7 +46626,7 @@ class Parma_Polyhedra_Library::Generator_System_const_iterator : public std::iterator { public: @@ -45626,13 +46767,15 @@ const dimension_type old_space_dim = space_dimension(); sys.set_space_dimension_no_ok(space_dim); - if (space_dim < old_space_dim) + if (space_dim < old_space_dim) { // We may have invalid lines and rays now. remove_invalid_lines_and_rays(); + } #ifndef NDEBUG - for (dimension_type i = 0; i < sys.num_rows(); ++i) + for (dimension_type i = 0; i < sys.num_rows(); ++i) { PPL_ASSERT(sys[i].OK()); + } #endif PPL_ASSERT(sys.OK()); PPL_ASSERT(OK()); @@ -45848,8 +46991,9 @@ inline Generator_System_const_iterator& Generator_System_const_iterator::operator++() { ++i; - if (!gsp->is_necessarily_closed()) + if (!gsp->is_necessarily_closed()) { skip_forward(); + } return *this; } @@ -45890,8 +47034,9 @@ inline Generator_System::const_iterator Generator_System::begin() const { const_iterator i(sys.begin(), *this); - if (!sys.is_necessarily_closed()) + if (!sys.is_necessarily_closed()) { i.skip_forward(); + } return i; } @@ -49140,9 +50285,10 @@ inline void Polyhedron::Status::reset_zero_dim_univ() { // This is a no-op if the current status is not zero-dim. - if (flags == ZERO_DIM_UNIV) + if (flags == ZERO_DIM_UNIV) { // In the zero-dim space, if it is not the universe it is empty. flags = EMPTY; + } } inline void @@ -49368,8 +50514,9 @@ inline void Polyhedron::m_swap(Polyhedron& y) { - if (topology() != y.topology()) + if (topology() != y.topology()) { throw_topology_incompatible("swap(y)", "y", y); + } using std::swap; swap(con_sys, y.con_sys); swap(gen_sys, y.gen_sys); @@ -49454,13 +50601,15 @@ inline bool Polyhedron::is_empty() const { - if (marked_empty()) + if (marked_empty()) { return true; + } // Try a fast-fail test: if generators are up-to-date and // there are no pending constraints, then the generator system // (since it is well formed) contains a point. - if (generators_are_up_to_date() && !has_pending_constraints()) + if (generators_are_up_to_date() && !has_pending_constraints()) { return false; + } return !minimize(); } @@ -49568,8 +50717,9 @@ PPL_ASSERT(space_dim > 0 && !marked_empty()); PPL_ASSERT(has_something_pending()); - if (has_pending_constraints()) + if (has_pending_constraints()) { return process_pending_constraints(); + } PPL_ASSERT(has_pending_generators()); process_pending_generators(); @@ -49620,10 +50770,12 @@ Polyhedron::simplified_constraints() const { PPL_ASSERT(constraints_are_up_to_date()); Constraint_System cs(con_sys); - if (cs.num_pending_rows() > 0) + if (cs.num_pending_rows() > 0) { cs.unset_pending_rows(); - if (has_pending_constraints() || !constraints_are_minimized()) + } + if (has_pending_constraints() || !constraints_are_minimized()) { cs.simplify(); + } return cs; } @@ -50343,16 +51495,18 @@ template Matrix::Matrix(dimension_type n) : rows(n), num_columns_(n) { - for (dimension_type i = 0; i < rows.size(); ++i) + for (dimension_type i = 0; i < rows.size(); ++i) { rows[i].resize(num_columns_); + } PPL_ASSERT(OK()); } template Matrix::Matrix(dimension_type num_rows, dimension_type num_columns) : rows(num_rows), num_columns_(num_columns) { - for (dimension_type i = 0; i < rows.size(); ++i) + for (dimension_type i = 0; i < rows.size(); ++i) { rows[i].resize(num_columns_); + } PPL_ASSERT(OK()); } @@ -50362,19 +51516,22 @@ const dimension_type old_num_rows = rows.size(); rows.resize(num_rows); if (old_num_rows < num_rows) { - for (dimension_type i = old_num_rows; i < num_rows; ++i) + for (dimension_type i = old_num_rows; i < num_rows; ++i) { rows[i].resize(num_columns); + } if (num_columns_ != num_columns) { num_columns_ = num_columns; - for (dimension_type i = 0; i < old_num_rows; ++i) + for (dimension_type i = 0; i < old_num_rows; ++i) { rows[i].resize(num_columns); + } } } else if (num_columns_ != num_columns) { num_columns_ = num_columns; - for (dimension_type i = 0; i < num_rows; ++i) + for (dimension_type i = 0; i < num_rows; ++i) { rows[i].resize(num_columns); + } } PPL_ASSERT(OK()); } @@ -50389,20 +51546,24 @@ Row& rows_k = (*this)[k]; for (dimension_type i = 0, j = 0; i < n; i = ++j) { // Make `j' be the index of the next cycle terminator. - while (cycles[j] != 0) + while (cycles[j] != 0) { ++j; + } // Cycles of length less than 2 are not allowed. PPL_ASSERT(j - i >= 2); - if (j - i == 2) + if (j - i == 2) { // For cycles of length 2 no temporary is needed, just a swap. rows_k.swap_coefficients(cycles[i], cycles[i + 1]); + } else { // Longer cycles need a temporary. tmp = rows_k.get(cycles[j - 1]); - for (dimension_type l = (j - 1); l > i; --l) + for (dimension_type l = (j - 1); l > i; --l) { rows_k.swap_coefficients(cycles[l-1], cycles[l]); - if (tmp == 0) + } + if (tmp == 0) { rows_k.reset(cycles[i]); + } else { using std::swap; swap(tmp, rows_k[cycles[i]]); @@ -50415,15 +51576,17 @@ template void Matrix::swap_columns(dimension_type i, dimension_type j) { - for (dimension_type k = num_rows(); k-- > 0; ) + for (dimension_type k = num_rows(); k-- > 0; ) { (*this)[k].swap_coefficients(i, j); + } } template void Matrix::add_zero_columns(dimension_type n, dimension_type i) { - for (dimension_type j = rows.size(); j-- > 0; ) + for (dimension_type j = rows.size(); j-- > 0; ) { rows[j].add_zeroes_and_shift(n, i); + } num_columns_ += n; PPL_ASSERT(OK()); } @@ -50431,8 +51594,9 @@ template void Matrix::remove_column(dimension_type i) { - for (dimension_type j = rows.size(); j-- > 0; ) + for (dimension_type j = rows.size(); j-- > 0; ) { rows[j].delete_element_and_shift(i); + } --num_columns_; PPL_ASSERT(OK()); } @@ -50442,8 +51606,9 @@ Matrix::ascii_dump(std::ostream& s) const { s << num_rows() << " x "; s << num_columns() << "\n"; - for (const_iterator i = begin(), i_end = end(); i !=i_end; ++i) + for (const_iterator i = begin(), i_end = end(); i !=i_end; ++i) { i->ascii_dump(s); + } } PPL_OUTPUT_TEMPLATE_DEFINITIONS_ASCII_ONLY(Row, Matrix) @@ -50454,21 +51619,28 @@ std::string str; dimension_type new_num_rows; dimension_type new_num_cols; - if (!(s >> new_num_rows)) + if (!(s >> new_num_rows)) { return false; - if (!(s >> str) || str != "x") + } + if (!(s >> str) || str != "x") { return false; - if (!(s >> new_num_cols)) + } + if (!(s >> new_num_cols)) { return false; + } - for (iterator i = rows.begin(), i_end = rows.end(); i != i_end; ++i) + for (iterator i = rows.begin(), i_end = rows.end(); + i != i_end; ++i) { i->clear(); + } resize(new_num_rows, new_num_cols); - for (dimension_type row = 0; row < new_num_rows; ++row) - if (!rows[row].ascii_load(s)) + for (dimension_type row = 0; row < new_num_rows; ++row) { + if (!rows[row].ascii_load(s)) { return false; + } + } // Check invariants. PPL_ASSERT(OK()); @@ -50484,9 +51656,11 @@ template bool Matrix::OK() const { - for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) - if (i->size() != num_columns_) + for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) { + if (i->size() != num_columns_) { return false; + } + } return true; } @@ -50494,13 +51668,17 @@ template bool operator==(const Matrix& x, const Matrix& y) { - if (x.num_rows() != y.num_rows()) + if (x.num_rows() != y.num_rows()) { return false; - if (x.num_columns() != y.num_columns()) + } + if (x.num_columns() != y.num_columns()) { return false; - for (dimension_type i = x.num_rows(); i-- > 0; ) - if (x[i] != y[i]) + } + for (dimension_type i = x.num_rows(); i-- > 0; ) { + if (x[i] != y[i]) { return false; + } + } return true; } @@ -50724,6 +51902,7 @@ private: typedef Constraint_Sequence::const_iterator Base; typedef std::iterator_traits Base_Traits; + public: typedef Base_Traits::iterator_category iterator_category; typedef Base_Traits::difference_type difference_type; @@ -50780,7 +51959,7 @@ private: //! Constructor from a Base iterator. - explicit const_iterator(Base base); + explicit const_iterator(Base b); //! The Base iterator on the Constraint_Sequence. Base itr; @@ -51492,8 +52671,9 @@ i_variables(y.i_variables) { input_cs.reserve(y.input_cs.size()); for (Constraint_Sequence::const_iterator i = y.input_cs.begin(), - i_end = y.input_cs.end(); i != i_end; ++i) + i_end = y.input_cs.end(); i != i_end; ++i) { add_constraint_helper(*(*i)); + } PPL_ASSERT(OK()); } @@ -51525,9 +52705,10 @@ const dimension_type size = input_cs.size(); if (size == input_cs.capacity()) { const dimension_type max_size = input_cs.max_size(); - if (size == max_size) + if (size == max_size) { throw std::length_error("MIP_Problem::add_constraint(): " "too many constraints"); + } // Use an exponential grow policy to avoid too many reallocations. input_cs.reserve(compute_capacity(size + 1, max_size)); } @@ -51543,8 +52724,9 @@ // (and will eventually be deleted) by ancestors. for (Constraint_Sequence::const_iterator i = nth_iter(input_cs, inherited_constraints), - i_end = input_cs.end(); i != i_end; ++i) + i_end = input_cs.end(); i != i_end; ++i) { delete *i; + } } @@ -51552,8 +52734,9 @@ MIP_Problem::set_optimization_mode(const Optimization_Mode mode) { if (opt_mode != mode) { opt_mode = mode; - if (status == UNBOUNDED || status == OPTIMIZED) + if (status == UNBOUNDED || status == OPTIMIZED) { status = SATISFIABLE; + } PPL_ASSERT(OK()); } } @@ -51649,8 +52832,9 @@ n += input_cs.capacity() * sizeof(Constraint*); for (Constraint_Sequence::const_iterator i = nth_iter(input_cs, inherited_constraints), - i_end = input_cs.end(); i != i_end; ++i) + i_end = input_cs.end(); i != i_end; ++i) { n += ((*i)->total_memory_in_bytes()); + } // Adding the external memory for `base'. n += base.capacity() * sizeof(dimension_type); @@ -51665,8 +52849,8 @@ } inline -MIP_Problem::const_iterator::const_iterator(Base base) - : itr(base) { +MIP_Problem::const_iterator::const_iterator(Base b) + : itr(b) { } inline MIP_Problem::const_iterator::difference_type @@ -51794,11 +52978,12 @@ } // Check for space dimension overflow. - if (dim > max_space_dimension()) + if (dim > max_space_dimension()) { throw std::length_error("PPL::MIP_Problem:: MIP_Problem(dim, first, " "last, int_vars, obj, mode):\n" "dim exceeds the maximum allowed" "space dimension."); + } // Check the objective function. if (obj.space_dimension() > dim) { std::ostringstream s; @@ -51811,11 +52996,12 @@ // Check the constraints. try { for (In i = first; i != last; ++i) { - if (i->is_strict_inequality()) + if (i->is_strict_inequality()) { throw std::invalid_argument("PPL::MIP_Problem::" "MIP_Problem(dim, first, last, int_vars," "obj, mode):\nrange [first, last) contains" "a strict inequality constraint."); + } if (i->space_dimension() > dim) { std::ostringstream s; s << "PPL::MIP_Problem::" @@ -51831,8 +53017,10 @@ // Delete the allocated constraints, to avoid memory leaks. for (Constraint_Sequence::const_iterator - i = input_cs.begin(), i_end = input_cs.end(); i != i_end; ++i) + i = input_cs.begin(), i_end = input_cs.end(); + i != i_end; ++i) { delete *i; + } throw; } @@ -51861,11 +53049,12 @@ last_generator(point()), i_variables() { // Check for space dimension overflow. - if (dim > max_space_dimension()) + if (dim > max_space_dimension()) { throw std::length_error("PPL::MIP_Problem::" "MIP_Problem(dim, first, last, obj, mode):\n" "dim exceeds the maximum allowed space " "dimension."); + } // Check the objective function. if (obj.space_dimension() > dim) { std::ostringstream s; @@ -51878,12 +53067,13 @@ // Check the constraints. try { for (In i = first; i != last; ++i) { - if (i->is_strict_inequality()) + if (i->is_strict_inequality()) { throw std::invalid_argument("PPL::MIP_Problem::" "MIP_Problem(dim, first, last, obj, mode):" "\n" "range [first, last) contains a strict " "inequality constraint."); + } if (i->space_dimension() > dim) { std::ostringstream s; s << "PPL::MIP_Problem::" @@ -51899,8 +53089,10 @@ // Delete the allocated constraints, to avoid memory leaks. for (Constraint_Sequence::const_iterator - i = input_cs.begin(), i_end = input_cs.end(); i != i_end; ++i) + i = input_cs.begin(), i_end = input_cs.end(); + i != i_end; ++i) { delete *i; + } throw; } @@ -51909,7 +53101,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/MIP_Problem_defs.hh line 974. */ +/* Automatically generated from PPL source file ../src/MIP_Problem_defs.hh line 975. */ /* Automatically generated from PPL source file ../src/Polyhedron_templates.hh line 31. */ // For static method overflows. @@ -52125,13 +53317,15 @@ inline bool Floating_Point_Expression ::overflows(const FP_Linear_Form& lf) { - if (!lf.inhomogeneous_term().is_bounded()) + if (!lf.inhomogeneous_term().is_bounded()) { return true; + } dimension_type dimension = lf.space_dimension(); for (dimension_type i = 0; i < dimension; ++i) { - if (!lf.coefficient(Variable(i)).is_bounded()) + if (!lf.coefficient(Variable(i)).is_bounded()) { return true; + } } return false; @@ -52285,12 +53479,14 @@ con_sys.insert(l_d * v_k == l_n); } else { - if (l_bounded) + if (l_bounded) { // Add the constraint `l_d*v_k >= l_n'. con_sys.insert(l_d * v_k >= l_n); - if (u_bounded) + } + if (u_bounded) { // Add the constraint `u_d*v_k <= u_n'. con_sys.insert(u_d * v_k <= u_n); + } } } } @@ -52315,21 +53511,25 @@ else { // Check if a lower bound constraint is required. if (l_bounded) { - if (l_closed) + if (l_closed) { // Add the constraint `l_d*v_k >= l_n'. con_sys.insert(l_d * v_k >= l_n); - else + } + else { // Add the constraint `l_d*v_k > l_n'. con_sys.insert(l_d * v_k > l_n); + } } // Check if an upper bound constraint is required. if (u_bounded) { - if (u_closed) + if (u_closed) { // Add the constraint `u_d*v_k <= u_n'. con_sys.insert(u_d * v_k <= u_n); - else + } + else { // Add the constraint `u_d*v_k < u_n'. con_sys.insert(u_d * v_k < u_n); + } } } } @@ -52346,9 +53546,9 @@ template void Polyhedron::map_space_dimensions(const Partial_Function& pfunc) { - if (space_dim == 0) + if (space_dim == 0) { return; - + } if (pfunc.has_empty_codomain()) { // All dimensions vanish: the polyhedron becomes zero_dimensional. if (marked_empty() @@ -52359,9 +53559,10 @@ space_dim = 0; con_sys.clear(); } - else + else { // Removing all dimensions from a non-empty polyhedron. set_zero_dim_univ(); + } PPL_ASSERT_HEAVY(OK()); return; @@ -52382,19 +53583,22 @@ std::deque visited(space_dim); for (dimension_type i = space_dim; i-- > 0; ) { - if (visited[i]) + if (visited[i]) { continue; + } dimension_type j = i; do { visited[j] = true; // The following initialization is only to make the compiler happy. dimension_type k = 0; - if (!pfunc.maps(j, k)) + if (!pfunc.maps(j, k)) { throw_invalid_argument("map_space_dimensions(pfunc)", " pfunc is inconsistent"); - if (k == j) + } + if (k == j) { break; + } cycle.push_back(Variable(j)); // Go along the cycle. @@ -52406,11 +53610,13 @@ // Permute all that is up-to-date. Notice that the contents of // the saturation matrices is unaffected by the permutation of // columns: they remain valid, if they were so. - if (constraints_are_up_to_date()) + if (constraints_are_up_to_date()) { con_sys.permute_space_dimensions(cycle); + } - if (generators_are_up_to_date()) + if (generators_are_up_to_date()) { gen_sys.permute_space_dimensions(cycle); + } cycle.clear(); } @@ -52437,8 +53643,9 @@ std::vector pfunc_maps(space_dim, not_a_dimension()); for (dimension_type j = space_dim; j-- > 0; ) { dimension_type pfunc_j; - if (pfunc.maps(j, pfunc_j)) + if (pfunc.maps(j, pfunc_j)) { pfunc_maps[j] = pfunc_j; + } } Generator_System new_gensys; @@ -52459,12 +53666,14 @@ } switch (old_g.type()) { case Generator::LINE: - if (!all_zeroes) + if (!all_zeroes) { new_gensys.insert(line(expr)); + } break; case Generator::RAY: - if (!all_zeroes) + if (!all_zeroes) { new_gensys.insert(ray(expr)); + } break; case Generator::POINT: // A point in the origin has all zero homogeneous coefficients. @@ -52497,14 +53706,16 @@ // The dimensions of left and right should not be greater than the // dimension of *this. const dimension_type left_space_dim = left.space_dimension(); - if (space_dim < left_space_dim) + if (space_dim < left_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(l1, l2, s)", "l1", left); + } const dimension_type right_space_dim = right.space_dimension(); - if (space_dim < right_space_dim) + if (space_dim < right_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(l1, l2, s)", "l2", right); + } // We assume that the analyzer will not refine an unreachable test. PPL_ASSERT(!marked_empty()); @@ -52513,36 +53724,42 @@ typedef Linear_Form FP_Linear_Form; if (Floating_Point_Expression:: - overflows(left)) + overflows(left)) { return; + } if (Floating_Point_Expression:: - overflows(right)) + overflows(right)) { return; + } // Overapproximate left - right. FP_Linear_Form left_minus_right(left); left_minus_right -= right; if (Floating_Point_Expression:: - overflows(left_minus_right)) + overflows(left_minus_right)) { return; + } dimension_type lf_space_dim = left_minus_right.space_dimension(); FP_Linear_Form lf_approx; overapproximate_linear_form(left_minus_right, lf_space_dim, lf_approx); if (Floating_Point_Expression:: - overflows(lf_approx)) + overflows(lf_approx)) { return; + } // Normalize left - right. Linear_Expression lf_approx_le; convert_to_integer_expression(lf_approx, lf_space_dim, lf_approx_le); // Finally, do the refinement. - if (!is_strict || is_necessarily_closed()) + if (!is_strict || is_necessarily_closed()) { refine_with_constraint(lf_approx_le <= 0); - else + } + else { refine_with_constraint(lf_approx_le < 0); + } } template @@ -52558,13 +53775,15 @@ // Dimension compatibility checks. // The dimension of lf should not be greater than the dimension of *this. const dimension_type lf_space_dim = lf.space_dimension(); - if (space_dim < lf_space_dim) + if (space_dim < lf_space_dim) { throw_dimension_incompatible("affine_form_image(v, l, s)", "l", lf); + } // `var' should be one of the dimensions of the polyhedron. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("affine_form_image(v, l, s)", "v", var); + } // We assume that the analyzer will not perform an unreachable assignment. PPL_ASSERT(!marked_empty()); @@ -52603,10 +53822,10 @@ template void -Polyhedron::overapproximate_linear_form -(const Linear_Form >& lf, - const dimension_type lf_dimension, - Linear_Form >& result) { +Polyhedron +::overapproximate_linear_form(const Linear_Form >& lf, + const dimension_type lf_dimension, + Linear_Form >& result) { // Check that FP_Format is indeed a floating point type. PPL_COMPILE_TIME_CHECK(!std::numeric_limits::is_exact, @@ -52667,14 +53886,16 @@ // FIXME: are these checks numerator[i] != 0 really necessary? numer_denom(b.lower(), numerators[lf_dimension], denominators[lf_dimension]); - if (numerators[lf_dimension] != 0) + if (numerators[lf_dimension] != 0) { lcm_assign(lcm, lcm, denominators[lf_dimension]); + } for (dimension_type i = 0; i < lf_dimension; ++i) { const FP_Interval_Type& curr_int = lf.coefficient(Variable(i)); numer_denom(curr_int.lower(), numerators[i], denominators[i]); - if (numerators[i] != 0) + if (numerators[i] != 0) { lcm_assign(lcm, lcm, denominators[i]); + } } for (dimension_type i = 0; i < lf_dimension; ++i) { @@ -52713,19 +53934,22 @@ const FP_Interval_Type& b = lf.inhomogeneous_term(); numer_denom(b.lower(), numerators[lf_dimension], denominators[lf_dimension]); // FIXME: are these checks numerator[i] != 0 really necessary? - if (numerators[lf_dimension] != 0) + if (numerators[lf_dimension] != 0) { lcm_assign(lcm, lcm, denominators[lf_dimension]); + } numer_denom(b.upper(), numerators[lf_dimension+1], denominators[lf_dimension+1]); - if (numerators[lf_dimension+1] != 0) + if (numerators[lf_dimension+1] != 0) { lcm_assign(lcm, lcm, denominators[lf_dimension+1]); + } for (dimension_type i = 0; i < lf_dimension; ++i) { const FP_Interval_Type& curr_int = lf.coefficient(Variable(i)); numer_denom(curr_int.lower(), numerators[i], denominators[i]); - if (numerators[i] != 0) + if (numerators[i] != 0) { lcm_assign(lcm, lcm, denominators[i]); + } } for (dimension_type i = 0; i < lf_dimension; ++i) { @@ -52742,8 +53966,9 @@ numerators[lf_dimension] *= denominators[lf_dimension]; res_low_coeff = numerators[lf_dimension]; } - else - res_low_coeff = Coefficient(0); + else { + res_low_coeff = 0; + } if (numerators[lf_dimension+1] != 0) { exact_div_assign(denominators[lf_dimension+1], @@ -52751,8 +53976,9 @@ numerators[lf_dimension+1] *= denominators[lf_dimension+1]; res_hi_coeff = numerators[lf_dimension+1]; } - else - res_hi_coeff = Coefficient(0); + else { + res_hi_coeff = 0; + } } template @@ -52792,9 +54018,6 @@ Bit_Matrix& sat1, Bit_Matrix& sat2, dimension_type add_dim) { - - typedef typename Linear_System2::row_type sys2_row_type; - PPL_ASSERT(sys1.topology() == sys2.topology()); PPL_ASSERT(sys1.space_dimension() == sys2.space_dimension()); PPL_ASSERT(add_dim != 0); @@ -52810,8 +54033,9 @@ // because the polyhedron has not been embedded in the new space. sat1.resize(sat1.num_rows() + add_dim, sat1.num_columns()); // The old matrix is moved to the end of the new matrix. - for (dimension_type i = sat1.num_rows() - add_dim; i-- > 0; ) + for (dimension_type i = sat1.num_rows() - add_dim; i-- > 0; ) { swap(sat1[i], sat1[i+add_dim]); + } // Computes the "sat_c", too. sat2.transpose_assign(sat1); } @@ -52828,6 +54052,20 @@ #include #include +// This flag turns on the quick non-adjacency test; +// the performance impact of this test was evaluated by H. Le Verge (1994); +// see also Corollary 4.2 in B. Genov's PhD thesis (2014). +#ifndef PPL_QUICK_NON_ADJ_TEST +#define PPL_QUICK_NON_ADJ_TEST 1 +#endif + +// This flag turns on the quick adjacency test; +// for a justification, see Corollary 4.3 in B. Genov's PhD thesis (2014), +// where it is also said that the test was implemented in cddlib. +#ifndef PPL_QUICK_ADJ_TEST +#define PPL_QUICK_ADJ_TEST 1 +#endif + namespace Parma_Polyhedra_Library { /*! @@ -53187,11 +54425,28 @@ // This will contain the row indexes of the redundant rows of `source'. std::vector redundant_source_rows; +#if PPL_QUICK_ADJ_TEST + // This will contain the number of ones in each row of `sat'. + PPL_DIRTY_TEMP(std::vector, sat_num_ones); + sat_num_ones.resize(dest_num_rows, 0); + for (dimension_type i = dest_num_rows; i-- > 0; ) { + sat_num_ones[i] = sat[i].count_ones(); + } +#endif // PPL_QUICK_ADJ_TEST + // Converting the sub-system of `source' having rows with indexes // from `start' to the last one (i.e., `source_num_rows' - 1). for (dimension_type k = start; k < source_num_rows; ++k) { const source_row_type& source_k = source[k]; +#ifndef NDEBUG +#if PPL_QUICK_ADJ_TEST + for (dimension_type i = dest_num_rows; i-- > 0; ) { + PPL_ASSERT(sat_num_ones[i] == sat[i].count_ones()); + } +#endif // PPL_QUICK_ADJ_TEST +#endif // NDEBUG + // `scalar_prod[i]' will contain the scalar product of the // constraint `source_k' and the generator `dest_rows[i]'. This // product is 0 if and only if the generator saturates the @@ -53211,9 +54466,10 @@ source_k, dest.sys.rows[index_non_zero]); WEIGHT_ADD_MUL(17, source_space_dim); - if (scalar_prod[index_non_zero] != 0) + if (scalar_prod[index_non_zero] != 0) { // The generator does not saturate the constraint. break; + } // Check if the client has requested abandoning all expensive // computations. If so, the exception specified by the client // is thrown now. @@ -53362,12 +54618,16 @@ // the constraint is an inequality, we set to 1 the // corresponding element of `sat' ... Bit_Row& sat_nle = sat[num_lines_or_equalities]; - if (source_k.is_ray_or_point_or_inequality()) + if (source_k.is_ray_or_point_or_inequality()) { sat_nle.set(k - redundant_source_rows.size()); - // ... otherwise, the constraint is an equality which is - // violated by the generator `dest_nle': the generator has to be - // removed from `dest_rows'. +#if PPL_QUICK_ADJ_TEST + ++sat_num_ones[num_lines_or_equalities]; +#endif // PPL_QUICK_ADJ_TEST + } else { + // ... otherwise, the constraint is an equality which is + // violated by the generator `dest_nle': the generator has to be + // removed from `dest_rows'. --dest_num_rows; swap(dest.sys.rows[num_lines_or_equalities], dest.sys.rows[dest_num_rows]); @@ -53378,291 +54638,352 @@ swap(scalar_prod_nle, scalar_prod[dest_num_rows]); swap(sat_nle, sat[dest_num_rows]); +#if PPL_QUICK_ADJ_TEST + swap(sat_num_ones[num_lines_or_equalities], + sat_num_ones[dest_num_rows]); +#endif // PPL_QUICK_ADJ_TEST // dest_sorted has already been set to false. } + // Finished handling the line or equality case: + // continue with next `k'. + continue; } - // Here we have `index_non_zero' >= `num_lines_or_equalities', - // so that all the lines in `dest_rows' saturate the constraint `source_k'. - else { - // First, we reorder the generators in `dest_rows' as follows: - // -# all the lines should have indexes between 0 and - // `num_lines_or_equalities' - 1 (this already holds); - // -# all the rays that saturate the constraint should have - // indexes between `num_lines_or_equalities' and - // `lines_or_equal_bound' - 1; these rays form the set Q=. - // -# all the rays that have a positive scalar product with the - // constraint should have indexes between `lines_or_equal_bound' - // and `sup_bound' - 1; these rays form the set Q+. - // -# all the rays that have a negative scalar product with the - // constraint should have indexes between `sup_bound' and - // `dest_num_rows' - 1; these rays form the set Q-. - dimension_type lines_or_equal_bound = num_lines_or_equalities; - dimension_type inf_bound = dest_num_rows; - // While we find saturating generators, we simply increment - // `lines_or_equal_bound'. - while (inf_bound > lines_or_equal_bound - && scalar_prod[lines_or_equal_bound] == 0) + + // Here all the lines in `dest_rows' saturate the constraint `source_k'. + PPL_ASSERT(index_non_zero >= num_lines_or_equalities); + // First, we reorder the generators in `dest_rows' as follows: + // -# all the lines should have indexes between 0 and + // `num_lines_or_equalities' - 1 (this already holds); + // -# all the rays that saturate the constraint should have + // indexes between `num_lines_or_equalities' and + // `lines_or_equal_bound' - 1; these rays form the set Q=. + // -# all the rays that have a positive scalar product with the + // constraint should have indexes between `lines_or_equal_bound' + // and `sup_bound' - 1; these rays form the set Q+. + // -# all the rays that have a negative scalar product with the + // constraint should have indexes between `sup_bound' and + // `dest_num_rows' - 1; these rays form the set Q-. + dimension_type lines_or_equal_bound = num_lines_or_equalities; + dimension_type inf_bound = dest_num_rows; + // While we find saturating generators, we simply increment + // `lines_or_equal_bound'. + while (inf_bound > lines_or_equal_bound + && scalar_prod[lines_or_equal_bound] == 0) { + ++lines_or_equal_bound; + } + dimension_type sup_bound = lines_or_equal_bound; + while (inf_bound > sup_bound) { + const int sp_sign = sgn(scalar_prod[sup_bound]); + if (sp_sign == 0) { + // This generator has to be moved in Q=. + swap(dest.sys.rows[sup_bound], dest.sys.rows[lines_or_equal_bound]); + swap(scalar_prod[sup_bound], scalar_prod[lines_or_equal_bound]); + swap(sat[sup_bound], sat[lines_or_equal_bound]); +#if PPL_QUICK_ADJ_TEST + swap(sat_num_ones[sup_bound], sat_num_ones[lines_or_equal_bound]); +#endif // PPL_QUICK_ADJ_TEST ++lines_or_equal_bound; - dimension_type sup_bound = lines_or_equal_bound; - while (inf_bound > sup_bound) { - const int sp_sign = sgn(scalar_prod[sup_bound]); - if (sp_sign == 0) { - // This generator has to be moved in Q=. - swap(dest.sys.rows[sup_bound], dest.sys.rows[lines_or_equal_bound]); - swap(scalar_prod[sup_bound], scalar_prod[lines_or_equal_bound]); - swap(sat[sup_bound], sat[lines_or_equal_bound]); - ++lines_or_equal_bound; - ++sup_bound; - dest_sorted = false; - } - else if (sp_sign < 0) { - // This generator has to be moved in Q-. - --inf_bound; - swap(dest.sys.rows[sup_bound], dest.sys.rows[inf_bound]); - swap(sat[sup_bound], sat[inf_bound]); - swap(scalar_prod[sup_bound], scalar_prod[inf_bound]); - dest_sorted = false; - } - else - // sp_sign > 0: this generator has to be moved in Q+. - ++sup_bound; + ++sup_bound; + dest_sorted = false; + } + else if (sp_sign < 0) { + // This generator has to be moved in Q-. + --inf_bound; + swap(dest.sys.rows[sup_bound], dest.sys.rows[inf_bound]); + swap(sat[sup_bound], sat[inf_bound]); + swap(scalar_prod[sup_bound], scalar_prod[inf_bound]); +#if PPL_QUICK_ADJ_TEST + swap(sat_num_ones[sup_bound], sat_num_ones[inf_bound]); +#endif // PPL_QUICK_ADJ_TEST + dest_sorted = false; } + else { + // sp_sign > 0: this generator has to be moved in Q+. + ++sup_bound; + } + } - if (sup_bound == dest_num_rows) { - // Here the set Q- is empty. - // If the constraint is an inequality, then all the generators - // in Q= and Q+ satisfy the constraint. The constraint is redundant - // and it can be safely removed from the constraint system. - // This is why the `source' parameter is not declared `const'. - if (source_k.is_ray_or_point_or_inequality()) { - redundant_source_rows.push_back(k); - } - else { - // The constraint is an equality, so that all the generators - // in Q+ violate it. Since the set Q- is empty, we can simply - // remove from `dest_rows' all the generators of Q+. - PPL_ASSERT(dest_num_rows >= lines_or_equal_bound); - while (dest_num_rows != lines_or_equal_bound) { - recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); - swap(dest.sys.rows.back(), recyclable_dest_rows.back()); - dest.sys.rows.pop_back(); - --dest_num_rows; - } - PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); - } + if (sup_bound == dest_num_rows) { + // Here the set Q- is empty. + // If the constraint is an inequality, then all the generators + // in Q= and Q+ satisfy the constraint. The constraint is redundant + // and it can be safely removed from the constraint system. + // This is why the `source' parameter is not declared `const'. + if (source_k.is_ray_or_point_or_inequality()) { + redundant_source_rows.push_back(k); } else { - // The set Q- is not empty, i.e., at least one generator - // violates the constraint `source_k'. - // We have to further distinguish two cases: - if (sup_bound == num_lines_or_equalities) { - // The set Q+ is empty, so that all generators that satisfy - // the constraint also saturate it. - // We can simply remove from `dest_rows' all the generators in Q-. - PPL_ASSERT(dest_num_rows >= sup_bound); - while (dest_num_rows != sup_bound) { - recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); - swap(dest.sys.rows.back(), recyclable_dest_rows.back()); - dest.sys.rows.pop_back(); - --dest_num_rows; + // The constraint is an equality, so that all the generators + // in Q+ violate it. Since the set Q- is empty, we can simply + // remove from `dest_rows' all the generators of Q+. + PPL_ASSERT(dest_num_rows >= lines_or_equal_bound); + while (dest_num_rows != lines_or_equal_bound) { + recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); + swap(dest.sys.rows.back(), recyclable_dest_rows.back()); + dest.sys.rows.pop_back(); + --dest_num_rows; } - PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); + PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); + } + // Finished handling the case when Q- is empty: + // continue with next `k'. + continue; + } + + // The set Q- is not empty, i.e., at least one generator + // violates the constraint `source_k'. + if (sup_bound == num_lines_or_equalities) { + // The set Q+ is empty, so that all generators that satisfy + // the constraint also saturate it. + // We can simply remove from `dest_rows' all the generators in Q-. + PPL_ASSERT(dest_num_rows >= sup_bound); + while (dest_num_rows != sup_bound) { + recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); + swap(dest.sys.rows.back(), recyclable_dest_rows.back()); + dest.sys.rows.pop_back(); + --dest_num_rows; + } + PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); + // Finished handling the case when Q+ is empty: + // continue with next `k'. + continue; + } + + // The sets Q+ and Q- are both non-empty. + // The generators of the new pointed cone are all those satisfying + // the constraint `source_k' plus a set of new rays enjoying + // the following properties: + // -# they lie on the hyper-plane represented by the constraint + // -# they are obtained as a positive combination of two + // adjacent rays, the first taken from Q+ and the second + // taken from Q-. + + const dimension_type bound = dest_num_rows; + +#if PPL_QUICK_NON_ADJ_TEST + // For the quick non-adjacency test, we refer to the definition + // of a minimal proper face (see comments in Polyhedron_defs.hh): + // an extremal ray saturates at least `n' - `t' - 1 constraints, + // where `n' is the dimension of the space and `t' is the dimension + // of the lineality space. Since `n == source_num_columns - 1' and + // `t == num_lines_or_equalities', we obtain that an extremal ray + // saturates at least `source_num_columns - num_lines_or_equalities - 2' + // constraints. + const dimension_type min_saturators + = source_num_columns - num_lines_or_equalities - 2; + // NOTE: we are treating the `k'-th constraint. + const dimension_type max_saturators = k - redundant_source_rows.size(); +#endif // PPL_QUICK_NON_ADJ_TEST + + // In the following loop, + // `i' runs through the generators in the set Q+ and + // `j' runs through the generators in the set Q-. + for (dimension_type i = lines_or_equal_bound; i < sup_bound; ++i) { + for (dimension_type j = sup_bound; j < bound; ++j) { + // Checking if generators `dest_rows[i]' and `dest_rows[j]' are + // adjacent. + // If there exist another generator that saturates + // all the constraints saturated by both `dest_rows[i]' and + // `dest_rows[j]', then they are NOT adjacent. + PPL_ASSERT(sat[i].last() == C_Integer::max + || sat[i].last() < k); + PPL_ASSERT(sat[j].last() == C_Integer::max + || sat[j].last() < k); + + // Being the union of `sat[i]' and `sat[j]', + // `new_satrow' corresponds to a ray that saturates all the + // constraints saturated by both `dest_rows[i]' and + // `dest_rows[j]'. + Bit_Row new_satrow(sat[i], sat[j]); + + // Even before actually creating the new ray as a + // positive combination of `dest_rows[i]' and `dest_rows[j]', + // we exploit saturation information to perform: + // - a quick non-adjacency test; + // - a quick adjacency test. + +#if (PPL_QUICK_NON_ADJ_TEST || PPL_QUICK_ADJ_TEST) + // Compute the number of common saturators. + dimension_type new_satrow_ones = new_satrow.count_ones(); +#endif // (PPL_QUICK_NON_ADJ_TEST || PPL_QUICK_ADJ_TEST) + +#if PPL_QUICK_NON_ADJ_TEST + const dimension_type num_common_satur + = max_saturators - new_satrow_ones; + if (num_common_satur < min_saturators) { + // Quick non-adjacency test succeded: consider next `j'. + continue; } - else { - // The sets Q+ and Q- are both non-empty. - // The generators of the new pointed cone are all those satisfying - // the constraint `source_k' plus a set of new rays enjoying - // the following properties: - // -# they lie on the hyper-plane represented by the constraint - // -# they are obtained as a positive combination of two - // adjacent rays, the first taken from Q+ and the second - // taken from Q-. - - // The adjacency property is necessary to have an irredundant - // set of new rays (see proposition 2). - const dimension_type bound = dest_num_rows; - - // In the following loop, - // `i' runs through the generators in the set Q+ and - // `j' runs through the generators in the set Q-. - for (dimension_type i = lines_or_equal_bound; i < sup_bound; ++i) { - for(dimension_type j = sup_bound; j < bound; ++j) { - // Checking if generators `dest_rows[i]' and `dest_rows[j]' are - // adjacent. - // If there exist another generator that saturates - // all the constraints saturated by both `dest_rows[i]' and - // `dest_rows[j]', then they are NOT adjacent. - PPL_ASSERT(sat[i].last() == C_Integer::max - || sat[i].last() < k); - PPL_ASSERT(sat[j].last() == C_Integer::max - || sat[j].last() < k); - - // Being the union of `sat[i]' and `sat[j]', - // `new_satrow' corresponds to a ray that saturates all the - // constraints saturated by both `dest_rows[i]' and - // `dest_rows[j]'. - Bit_Row new_satrow(sat[i], sat[j]); - - // Compute the number of common saturators. - // NOTE: this number has to be less than `k' because - // we are treating the `k'-th constraint. - const dimension_type num_common_satur - = k - redundant_source_rows.size() - new_satrow.count_ones(); - - // Even before actually creating the new ray as a - // positive combination of `dest_rows[i]' and `dest_rows[j]', - // we exploit saturation information to check if - // it can be an extremal ray. To this end, we refer - // to the definition of a minimal proper face - // (see comments in Polyhedron_defs.hh): - // an extremal ray saturates at least `n' - `t' - 1 - // constraints, where `n' is the dimension of the space - // and `t' is the dimension of the lineality space. - // Since `n == source_num_columns - 1' and - // `t == num_lines_or_equalities', we obtain that - // an extremal ray saturates at least - // `source_num_columns - num_lines_or_equalities - 2' - // constraints. - if (num_common_satur - >= source_num_columns - num_lines_or_equalities - 2) { - // The minimal proper face rule is satisfied. - // Now we actually check for redundancy by computing - // adjacency information. - bool redundant = false; - WEIGHT_BEGIN(); - for (dimension_type - l = num_lines_or_equalities; l < bound; ++l) - if (l != i && l != j - && subset_or_equal(sat[l], new_satrow)) { - // Found another generator saturating all the - // constraints saturated by both `dest_rows[i]' and - // `dest_rows[j]'. - redundant = true; - break; - } - PPL_ASSERT(bound >= num_lines_or_equalities); - WEIGHT_ADD_MUL(15, bound - num_lines_or_equalities); - if (!redundant) { - // Adding the new ray to `dest_rows' and the corresponding - // saturation row to `sat'. - dest_row_type new_row; - if (recyclable_dest_rows.empty()) { - sat.add_recycled_row(new_satrow); - } - else { - swap(new_row, recyclable_dest_rows.back()); - recyclable_dest_rows.pop_back(); - new_row.set_space_dimension_no_ok(source_space_dim); - swap(sat[dest_num_rows], new_satrow); - } +#endif // PPL_QUICK_NON_ADJ_TEST - // The following fragment optimizes the computation of - // - // - // Coefficient scale = scalar_prod[i]; - // scale.gcd_assign(scalar_prod[j]); - // Coefficient normalized_sp_i = scalar_prod[i] / scale; - // Coefficient normalized_sp_j = scalar_prod[j] / scale; - // for (dimension_type c = dest_num_columns; c-- > 0; ) { - // new_row[c] = normalized_sp_i * dest[j][c]; - // new_row[c] -= normalized_sp_j * dest[i][c]; - // } - // - normalize2(scalar_prod[i], - scalar_prod[j], - normalized_sp_i, - normalized_sp_o); - WEIGHT_BEGIN(); - - neg_assign(normalized_sp_o); - new_row = dest.sys.rows[j]; - // TODO: Check if the following assertions hold. - PPL_ASSERT(normalized_sp_i != 0); - PPL_ASSERT(normalized_sp_o != 0); - new_row.expr.linear_combine(dest.sys.rows[i].expr, - normalized_sp_i, normalized_sp_o); - - WEIGHT_ADD_MUL(86, source_space_dim); - new_row.strong_normalize(); - // Don't assert new_row.OK() here, because it may fail if - // the parameter `dest' contained a row that wasn't ok. - // Since we added a new generator to `dest_rows', - // we also add a new element to `scalar_prod'; - // by construction, the new ray lies on the hyper-plane - // represented by the constraint `source_k'. - // Thus, the added scalar product is 0. - PPL_ASSERT(scalar_prod.size() >= dest_num_rows); - if (scalar_prod.size() <= dest_num_rows) - scalar_prod.push_back(Coefficient_zero()); - else - scalar_prod[dest_num_rows] = Coefficient_zero(); - - dest.sys.rows.resize(dest.sys.rows.size() + 1); - swap(dest.sys.rows.back(), new_row); - // Increment the number of generators. - ++dest_num_rows; - } // if (!redundant) - } +#if PPL_QUICK_ADJ_TEST + // If either `sat[i]' or `sat[j]' has exactly one more zeroes + // than `new_satrow', then `dest_rows[i]' and `dest_rows[j]' + // are adjacent. Equivalently, adjacency holds if `new_satrow_ones' + // is equal to 1 plus the maximum of `sat_num_ones[i]' and + // `sat_num_ones[j]'. + const dimension_type max_ones_i_j + = std::max(sat_num_ones[i], sat_num_ones[j]); + if (max_ones_i_j + 1 == new_satrow_ones) { + // Quick adjacency test succeded: skip the full test. + goto are_adjacent; + } +#endif // PPL_QUICK_ADJ_TEST + + // Perform the full (combinatorial) adjacency test. + { + bool redundant = false; + WEIGHT_BEGIN(); + for (dimension_type l = num_lines_or_equalities; l < bound; ++l) { + if (l != i && l != j + && subset_or_equal(sat[l], new_satrow)) { + // Found another generator saturating all the constraints + // saturated by both `dest_rows[i]' and `dest_rows[j]'. + redundant = true; + break; } - // Check if the client has requested abandoning all expensive - // computations. If so, the exception specified by the client - // is thrown now. - maybe_abandon(); - } - // Now we substitute the rays in Q- (i.e., the rays violating - // the constraint) with the newly added rays. - dimension_type j; - if (source_k.is_ray_or_point_or_inequality()) { - // The constraint is an inequality: - // the violating generators are those in Q-. - j = sup_bound; - // For all the generators in Q+, set to 1 the corresponding - // entry for the constraint `source_k' in the saturation matrix. - - // After the removal of redundant rows in `source', the k-th - // row will have index `new_k'. - const dimension_type new_k = k - redundant_source_rows.size(); - for (dimension_type l = lines_or_equal_bound; l < sup_bound; ++l) - sat[l].set(new_k); - } - else - // The constraint is an equality: - // the violating generators are those in the union of Q+ and Q-. - j = lines_or_equal_bound; - - // Swapping the newly added rays - // (index `i' running through `dest_num_rows - 1' down-to `bound') - // with the generators violating the constraint - // (index `j' running through `j' up-to `bound - 1'). - dimension_type i = dest_num_rows; - while (j < bound && i > bound) { - --i; - swap(dest.sys.rows[i], dest.sys.rows[j]); - swap(scalar_prod[i], scalar_prod[j]); - swap(sat[i], sat[j]); - ++j; - dest_sorted = false; - } - // Setting the number of generators in `dest': - // - if the number of generators violating the constraint - // is less than or equal to the number of the newly added - // generators, we assign `i' to `dest_num_rows' because - // all generators above this index are significant; - // - otherwise, we assign `j' to `dest_num_rows' because - // all generators below index `j-1' violates the constraint. - const dimension_type new_num_rows = (j == bound) ? i : j; - PPL_ASSERT(dest_num_rows >= new_num_rows); - while (dest_num_rows != new_num_rows) { - recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); - swap(dest.sys.rows.back(), recyclable_dest_rows.back()); - dest.sys.rows.pop_back(); - --dest_num_rows; } - PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); + PPL_ASSERT(bound >= num_lines_or_equalities); + WEIGHT_ADD_MUL(15, bound - num_lines_or_equalities); + if (redundant) { + // Full non-adjacency test succeded: consider next `j'. + continue; + } + } + +#if PPL_QUICK_ADJ_TEST + are_adjacent: +#endif // PPL_QUICK_ADJ_TEST + // Adding the new ray to `dest_rows' and the corresponding + // saturation row to `sat'. + dest_row_type new_row; + if (recyclable_dest_rows.empty()) { + sat.add_recycled_row(new_satrow); +#if PPL_QUICK_ADJ_TEST + sat_num_ones.push_back(new_satrow_ones); +#endif // PPL_QUICK_ADJ_TEST } + else { + swap(new_row, recyclable_dest_rows.back()); + recyclable_dest_rows.pop_back(); + new_row.set_space_dimension_no_ok(source_space_dim); + swap(sat[dest_num_rows], new_satrow); +#if PPL_QUICK_ADJ_TEST + swap(sat_num_ones[dest_num_rows], new_satrow_ones); +#endif // PPL_QUICK_ADJ_TEST + } + + // The following fragment optimizes the computation of + // + // + // Coefficient scale = scalar_prod[i]; + // scale.gcd_assign(scalar_prod[j]); + // Coefficient normalized_sp_i = scalar_prod[i] / scale; + // Coefficient normalized_sp_j = scalar_prod[j] / scale; + // for (dimension_type c = dest_num_columns; c-- > 0; ) { + // new_row[c] = normalized_sp_i * dest[j][c]; + // new_row[c] -= normalized_sp_j * dest[i][c]; + // } + // + normalize2(scalar_prod[i], + scalar_prod[j], + normalized_sp_i, + normalized_sp_o); + WEIGHT_BEGIN(); + + neg_assign(normalized_sp_o); + new_row = dest.sys.rows[j]; + // TODO: Check if the following assertions hold. + PPL_ASSERT(normalized_sp_i != 0); + PPL_ASSERT(normalized_sp_o != 0); + new_row.expr.linear_combine(dest.sys.rows[i].expr, + normalized_sp_i, normalized_sp_o); + + WEIGHT_ADD_MUL(86, source_space_dim); + new_row.strong_normalize(); + // Don't assert new_row.OK() here, because it may fail if + // the parameter `dest' contained a row that wasn't ok. + // Since we added a new generator to `dest_rows', + // we also add a new element to `scalar_prod'; + // by construction, the new ray lies on the hyper-plane + // represented by the constraint `source_k'. + // Thus, the added scalar product is 0. + PPL_ASSERT(scalar_prod.size() >= dest_num_rows); + if (scalar_prod.size() <= dest_num_rows) { + scalar_prod.push_back(Coefficient_zero()); + } + else { + scalar_prod[dest_num_rows] = Coefficient_zero(); + } + dest.sys.rows.resize(dest.sys.rows.size() + 1); + swap(dest.sys.rows.back(), new_row); + // Increment the number of generators. + ++dest_num_rows; + } // End of loop on `j'. + // Check if the client has requested abandoning all expensive + // computations. If so, the exception specified by the client + // is thrown now. + maybe_abandon(); + } // End of loop on `i'. + // Now we substitute the rays in Q- (i.e., the rays violating + // the constraint) with the newly added rays. + dimension_type j; + if (source_k.is_ray_or_point_or_inequality()) { + // The constraint is an inequality: + // the violating generators are those in Q-. + j = sup_bound; + // For all the generators in Q+, set to 1 the corresponding + // entry for the constraint `source_k' in the saturation matrix. + + // After the removal of redundant rows in `source', the k-th + // row will have index `new_k'. + const dimension_type new_k = k - redundant_source_rows.size(); + for (dimension_type l = lines_or_equal_bound; + l < sup_bound; ++l) { + sat[l].set(new_k); +#if PPL_QUICK_ADJ_TEST + ++sat_num_ones[l]; +#endif // PPL_PPL_QUICK_ADJ_TEST } } - } + else { + // The constraint is an equality: + // the violating generators are those in the union of Q+ and Q-. + j = lines_or_equal_bound; + } + // Swapping the newly added rays + // (index `i' running through `dest_num_rows - 1' down-to `bound') + // with the generators violating the constraint + // (index `j' running through `j' up-to `bound - 1'). + dimension_type i = dest_num_rows; + while (j < bound && i > bound) { + --i; + swap(dest.sys.rows[i], dest.sys.rows[j]); + swap(scalar_prod[i], scalar_prod[j]); + swap(sat[i], sat[j]); +#if PPL_QUICK_ADJ_TEST + swap(sat_num_ones[i], sat_num_ones[j]); +#endif // PPL_QUICK_ADJ_TEST + ++j; + dest_sorted = false; + } + // Setting the number of generators in `dest': + // - if the number of generators violating the constraint + // is less than or equal to the number of the newly added + // generators, we assign `i' to `dest_num_rows' because + // all generators above this index are significant; + // - otherwise, we assign `j' to `dest_num_rows' because + // all generators below index `j-1' violates the constraint. + const dimension_type new_num_rows = (j == bound) ? i : j; + PPL_ASSERT(dest_num_rows >= new_num_rows); + while (dest_num_rows != new_num_rows) { + recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1); + swap(dest.sys.rows.back(), recyclable_dest_rows.back()); + dest.sys.rows.pop_back(); + --dest_num_rows; + } + PPL_ASSERT(dest_num_rows == dest.sys.rows.size()); + } // End of loop on `k'. // We may have identified some redundant constraints in `source', // which have been swapped at the end of the system. @@ -53678,8 +54999,9 @@ // `start == source_num_rows' (i.e., the second sub-system is empty) // or the row ordering holds for the two rows at the boundary between // the two sub-systems. - if (start > 0 && start < source.num_rows()) + if (start > 0 && start < source.num_rows()) { source.set_sorted(compare(source[start - 1], source[start]) <= 0); + } // There are no longer pending constraints in `source'. source.unset_pending_rows(); @@ -53689,21 +55011,24 @@ const dimension_type num_removed_rows = recyclable_dest_rows.size(); sat.remove_trailing_rows(num_removed_rows); } - if (dest_sorted) + if (dest_sorted) { // If the non-pending generators in `dest' are still declared to be // sorted, then we have to also check for the sortedness of the // pending generators. - for (dimension_type i = dest_first_pending_row; i < dest_num_rows; ++i) + for (dimension_type i = dest_first_pending_row; + i < dest_num_rows; ++i) { if (compare(dest.sys.rows[i - 1], dest.sys.rows[i]) > 0) { dest_sorted = false; break; } - + } + } #ifndef NDEBUG // The previous code can modify the rows' fields, exploiting the friendness. // Check that all rows are OK now. - for (dimension_type i = dest.num_rows(); i-- > 0; ) + for (dimension_type i = dest.num_rows(); i-- > 0; ) { PPL_ASSERT(dest.sys.rows[i].OK()); + } #endif dest.sys.index_first_pending = dest.num_rows(); @@ -53780,9 +55105,9 @@ PPL_ASSERT(!source.has_no_rows()); // Sort the source system, if necessary. - if (!source.is_sorted()) + if (!source.is_sorted()) { source.sort_rows(); - + } // Initialization of the system of generators `dest'. // The algorithm works incrementally and we haven't seen any // constraint yet: as a consequence, `dest' should describe @@ -53801,13 +55126,16 @@ for (dimension_type i = 0; i < dest_num_rows; ++i) { Linear_Expression expr; expr.set_space_dimension(dest_num_rows - 1); - if (i == 0) + if (i == 0) { expr += 1; - else + } + else { expr += Variable(i - 1); + } dest_row_type dest_i(expr, dest_row_type::LINE_OR_EQUALITY, NECESSARILY_CLOSED); - if (dest.topology() == NOT_NECESSARILY_CLOSED) + if (dest.topology() == NOT_NECESSARILY_CLOSED) { dest_i.mark_as_not_necessarily_closed(); + } dest.sys.insert_no_ok(dest_i, Recycle_Input()); } // The identity matrix `dest' is not sorted (see the sorting rules @@ -53844,8 +55172,9 @@ dest_num_rows = dest.num_rows(); #ifndef NDEBUG - for (dimension_type i = dest.num_rows(); i-- > 0; ) + for (dimension_type i = dest.num_rows(); i-- > 0; ) { PPL_ASSERT(dest[i].OK()); + } #endif // Checking if the generators in `dest' represent an empty polyhedron: @@ -53858,22 +55187,27 @@ if (dest.is_necessarily_closed()) { for (first_point = num_lines_or_equalities; first_point < dest_num_rows; - ++first_point) - if (dest[first_point].expr.inhomogeneous_term() > 0) + ++first_point) { + if (dest[first_point].expr.inhomogeneous_term() > 0) { break; + } + } } else { for (first_point = num_lines_or_equalities; first_point < dest_num_rows; - ++first_point) - if (dest[first_point].expr.get(Variable(dest.space_dimension())) > 0) + ++first_point) { + if (dest[first_point].expr.get(Variable(dest.space_dimension())) > 0) { break; + } + } } - if (first_point == dest_num_rows) - if (con_to_gen) + if (first_point == dest_num_rows) { + if (con_to_gen) { // No point has been found: the polyhedron is empty. return true; + } else { // Here `con_to_gen' is false: `dest' is a system of constraints. // In this case the condition `first_point == dest_num_rows' @@ -53886,6 +55220,7 @@ PPL_UNREACHABLE; return false; } + } else { // A point has been found: the polyhedron is not empty. // Now invoking simplify() to remove all the redundant constraints @@ -53984,9 +55319,10 @@ // we can increment index `k1' too. ++k1; } - else if (cmp < 0) + else if (cmp < 0) { // By sortedness, we can increment `k1'. ++k1; + } else { // Here `cmp > 0'. // By sortedness, `source2[k2]' cannot be in `source1'. @@ -53997,19 +55333,21 @@ } } // Have we scanned all the rows in `source2'? - if (k2 < source2_num_rows) + if (k2 < source2_num_rows) { // By sortedness, all the rows in `source2' having indexes // greater than or equal to `k2' were not in `source1'. // We add them as pending rows of 'source1' (sortedness not affected). - for ( ; k2 < source2_num_rows; ++k2) + for ( ; k2 < source2_num_rows; ++k2) { source1.add_pending_row(source2[k2]); + } + } - if (source1.num_pending_rows() == 0) + if (source1.num_pending_rows() == 0) { // No row was appended to `source1', because all the constraints // in `source2' were already in `source1'. // There is nothing left to do ... return false; - + } return add_and_minimize(con_to_gen, source1, dest, sat); } @@ -54083,22 +55421,27 @@ if (dest.is_necessarily_closed()) { for (first_point = num_lines_or_equalities; first_point < dest_num_rows; - ++first_point) - if (dest[first_point].expr.inhomogeneous_term() > 0) + ++first_point) { + if (dest[first_point].expr.inhomogeneous_term() > 0) { break; + } + } } else { for (first_point = num_lines_or_equalities; first_point < dest_num_rows; - ++first_point) - if (dest[first_point].expr.get(Variable(dest.space_dimension())) > 0) + ++first_point) { + if (dest[first_point].expr.get(Variable(dest.space_dimension())) > 0) { break; + } + } } - if (first_point == dest_num_rows) - if (con_to_gen) + if (first_point == dest_num_rows) { + if (con_to_gen) { // No point has been found: the polyhedron is empty. return true; + } else { // Here `con_to_gen' is false: `dest' is a system of constraints. // In this case the condition `first_point == dest_num_rows' @@ -54111,6 +55454,7 @@ PPL_UNREACHABLE; return false; } + } else { // A point has been found: the polyhedron is not empty. // Now invoking `simplify()' to remove all the redundant constraints @@ -54191,9 +55535,6 @@ template dimension_type Polyhedron::simplify(Linear_System1& sys, Bit_Matrix& sat) { - - typedef typename Linear_System1::row_type sys_row_type; - dimension_type num_rows = sys.num_rows(); const dimension_type num_cols_sat = sat.num_columns(); @@ -54202,8 +55543,9 @@ // Looking for the first inequality in `sys'. dimension_type num_lines_or_equalities = 0; while (num_lines_or_equalities < num_rows - && sys[num_lines_or_equalities].is_line_or_equality()) + && sys[num_lines_or_equalities].is_line_or_equality()) { ++num_lines_or_equalities; + } // `num_saturators[i]' will contain the number of generators // that saturate the constraint `sys[i]'. @@ -54243,11 +55585,12 @@ // `sys' is no longer sorted. sys_sorted = false; } - else + else { // There exists a generator which does not saturate `sys[i]', // so that `sys[i]' is indeed an inequality. // We store the number of its saturators. num_saturators[i] = num_cols_sat - sat[i].count_ones(); + } } sys.set_sorted(sys_sorted); @@ -54350,8 +55693,9 @@ swap(sat[i], sat[num_rows]); swap(num_saturators[i], num_saturators[num_rows]); } - else + else { ++i; + } } // Now we check the independence rule. @@ -54364,9 +55708,10 @@ // than `i' and also doing the test `strict_subset(sat[i], // sat[k])'. for (dimension_type j = num_lines_or_equalities; j < num_rows; ) { - if (i == j) + if (i == j) { // We want to compare different rows of `sys'. ++j; + } else { // Let us recall that each generator lies on a facet of the // polyhedron (see the Introduction). @@ -54377,7 +55722,7 @@ // on the latter but not on the former, then `c_2' is more // restrictive than `c_1', i.e., `c_1' is redundant. bool strict_subset; - if (subset_or_equal(sat[j], sat[i], strict_subset)) + if (subset_or_equal(sat[j], sat[i], strict_subset)) { if (strict_subset) { // All the saturators of the inequality `sys[i]' are // saturators of the inequality `sys[j]' too, @@ -54398,11 +55743,13 @@ swap(sat[j], sat[num_rows]); swap(num_saturators[j], num_saturators[num_rows]); } - else + } + else { // If we reach this point then we know that `sat[i]' does // not contain (and is different from) `sat[j]', so that // `sys[i]' is not made redundant by inequality `sys[j]'. ++j; + } } } if (redundant) { @@ -54413,9 +55760,10 @@ swap(sat[i], sat[num_rows]); swap(num_saturators[i], num_saturators[num_rows]); } - else + else { // The inequality `sys[i]' is not redundant. ++i; + } } // Here we physically remove the `sat' rows corresponding to the redundant @@ -54428,8 +55776,9 @@ // `num_rows' - 1) represent the irredundant inequalities. #ifndef NDEBUG // Check if the flag is set (that of the equalities is already set). - for (dimension_type i = num_lines_or_equalities; i < num_rows; ++i) + for (dimension_type i = num_lines_or_equalities; i < num_rows; ++i) { PPL_ASSERT(sys[i].is_ray_or_point_or_inequality()); + } #endif // Finally, since now the sub-system (of `sys') of the irredundant @@ -54462,6 +55811,7 @@ /* Automatically generated from PPL source file ../src/Grid_Generator_System_defs.hh line 33. */ #include +#include namespace Parma_Polyhedra_Library { @@ -54708,7 +56058,7 @@ class const_iterator : public std::iterator { public: @@ -58014,9 +59364,10 @@ inline void Grid::Status::reset_zero_dim_univ() { // This is a no-op if the current status is not zero-dim. - if (flags == ZERO_DIM_UNIV) + if (flags == ZERO_DIM_UNIV) { // In the zero-dim space, if it is not the universe it is empty. flags = EMPTY; + } } inline void @@ -58401,19 +59752,22 @@ inline void Grid::add_congruence(const Congruence& cg) { // Dimension-compatibility check. - if (space_dim < cg.space_dimension()) + if (space_dim < cg.space_dimension()) { throw_dimension_incompatible("add_congruence(cg)", "cg", cg); + } - if (!marked_empty()) + if (!marked_empty()) { add_congruence_no_check(cg); + } } inline void Grid::add_congruences(const Congruence_System& cgs) { // TODO: this is just an executable specification. // Space dimension compatibility check. - if (space_dim < cgs.space_dimension()) + if (space_dim < cgs.space_dimension()) { throw_dimension_incompatible("add_congruences(cgs)", "cgs", cgs); + } if (!marked_empty()) { Congruence_System cgs_copy = cgs; @@ -58444,10 +59798,12 @@ inline void Grid::add_constraint(const Constraint& c) { // Space dimension compatibility check. - if (space_dim < c.space_dimension()) + if (space_dim < c.space_dimension()) { throw_dimension_incompatible("add_constraint(c)", "c", c); - if (!marked_empty()) + } + if (!marked_empty()) { add_constraint_no_check(c); + } } inline void @@ -58553,8 +59909,9 @@ return; } - if (space_dim == 0) + if (space_dim == 0) { set_zero_dim_univ(); + } else { // Initialize the space dimension as indicated by the box. con_sys.set_space_dimension(space_dim); @@ -58570,7 +59927,7 @@ bool closed = false; // TODO: Consider producing the system(s) in minimized form. if (box.has_lower_bound(v_k, l_n, l_d, closed)) { - if (box.has_upper_bound(v_k, u_n, u_d, closed)) + if (box.has_upper_bound(v_k, u_n, u_d, closed)) { if (l_n * u_d == u_n * l_d) { // A point interval sets dimension k of every point to a // single value. @@ -58586,13 +59943,15 @@ gcd_assign(u_n, l_d, point_divisor); // `u_n' now holds the gcd. exact_div_assign(u_n, point_divisor, u_n); - if (l_d < 0) + if (l_d < 0) { neg_assign(u_n); + } // l_d * u_n == abs(l_d * (point_divisor / gcd(l_d, point_divisor))) point.scale_to_divisor(l_d * u_n); // Set dimension k of the point to the lower bound. - if (l_d < 0) + if (l_d < 0) { neg_assign(u_n); + } // point[k + 1] = l_n * point_divisor / gcd(l_d, point_divisor) point.expr.set(Variable(k), l_n * u_n); PPL_ASSERT(point.OK()); @@ -58601,6 +59960,7 @@ continue; } + } } // A universe interval allows any value in dimension k. gen_sys.insert(grid_line(v_k)); @@ -58615,8 +59975,9 @@ template void Grid::map_space_dimensions(const Partial_Function& pfunc) { - if (space_dim == 0) + if (space_dim == 0) { return; + } if (pfunc.has_empty_codomain()) { // All dimensions vanish: the grid becomes zero_dimensional. @@ -58626,9 +59987,10 @@ space_dim = 0; set_empty(); } - else + else { // Removing all dimensions from a non-empty grid. set_zero_dim_univ(); + } PPL_ASSERT(OK()); return; @@ -58655,11 +60017,13 @@ visited[j] = true; // The following initialization is only to make the compiler happy. dimension_type k = 0; - if (!pfunc.maps(j, k)) + if (!pfunc.maps(j, k)) { throw_invalid_argument("map_space_dimensions(pfunc)", " pfunc is inconsistent"); - if (k == j) + } + if (k == j) { break; + } cycle.push_back(Variable(j)); // Go along the cycle. @@ -58708,8 +60072,9 @@ std::vector pfunc_maps(space_dim, not_a_dimension()); for (dimension_type j = space_dim; j-- > 0; ) { dimension_type pfunc_j; - if (pfunc.maps(j, pfunc_j)) + if (pfunc.maps(j, pfunc_j)) { pfunc_maps[j] = pfunc_j; + } } Grid_Generator_System new_gensys; @@ -58718,9 +60083,11 @@ // Get the divisor of the first point. Grid_Generator_System::const_iterator i; Grid_Generator_System::const_iterator old_gensys_end = old_gensys.end(); - for (i = old_gensys.begin(); i != old_gensys_end; ++i) - if (i->is_point()) + for (i = old_gensys.begin(); i != old_gensys_end; ++i) { + if (i->is_point()) { break; + } + } PPL_ASSERT(i != old_gensys_end); const Coefficient& system_divisor = i->divisor(); for (i = old_gensys.begin(); i != old_gensys_end; ++i) { @@ -58739,12 +60106,14 @@ } switch (old_g.type()) { case Grid_Generator::LINE: - if (!all_zeroes) + if (!all_zeroes) { new_gensys.insert(grid_line(expr)); + } break; case Grid_Generator::PARAMETER: - if (!all_zeroes) + if (!all_zeroes) { new_gensys.insert(parameter(expr, system_divisor)); + } break; case Grid_Generator::POINT: new_gensys.insert(grid_point(expr, old_g.divisor())); @@ -58775,8 +60144,9 @@ const M_row_type& pivot = rows[pivot_index]; const Coefficient& pivot_dim = pivot.expr.get(dim); - if (pivot_dim == 0) + if (pivot_dim == 0) { return; + } PPL_DIRTY_TEMP_COEFFICIENT(pivot_dim_half); pivot_dim_half = (pivot_dim + 1) / 2; @@ -58791,14 +60161,16 @@ if (generators) { --kinds_index; // Move over any virtual rows. - while (sys_dim_kinds[kinds_index] == GEN_VIRTUAL) + while (sys_dim_kinds[kinds_index] == GEN_VIRTUAL) { --kinds_index; + } } else { ++kinds_index; // Move over any virtual rows. - while (sys_dim_kinds[kinds_index] == CON_VIRTUAL) + while (sys_dim_kinds[kinds_index] == CON_VIRTUAL) { ++kinds_index; + } } // row_kind CONGRUENCE is included as PARAMETER @@ -58817,21 +60189,23 @@ // -5 < row_dim <= 5. row_dim_remainder = row_dim % pivot_dim; if (row_dim_remainder < 0) { - if (row_dim_remainder <= -pivot_dim_half) + if (row_dim_remainder <= -pivot_dim_half) { --num_rows_to_subtract; + } } - else if (row_dim_remainder > 0 && row_dim_remainder > pivot_dim_half) + else if (row_dim_remainder > 0 && row_dim_remainder > pivot_dim_half) { ++num_rows_to_subtract; - + } // Subtract num_rows_to_subtract copies of pivot from row i. Only the // entries from dim need to be subtracted, as the preceding // entries are all zero. // If num_rows_to_subtract is negative, these copies of pivot are // added to row i. - if (num_rows_to_subtract != 0) + if (num_rows_to_subtract != 0) { row.expr.linear_combine(pivot.expr, Coefficient_one(), -num_rows_to_subtract, start, end + 1); + } } } } @@ -59045,9 +60419,6 @@ */ -#include -/* Automatically generated from PPL source file ../src/Ptr_Iterator_inlines.hh line 29. */ - namespace Parma_Polyhedra_Library { namespace Implementation { @@ -59806,11 +61177,12 @@ DB_Row& x = *this; PPL_ASSERT(capacity <= max_size()); #if !PPL_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS - if (capacity == 0) + if (capacity == 0) { ++capacity; + } #endif PPL_ASSERT(x.impl == 0); - x.impl = new (capacity) typename DB_Row_Impl_Handler::Impl(); + x.impl = new(capacity) typename DB_Row_Impl_Handler::Impl(); #if PPL_DB_ROW_EXTRA_DEBUG PPL_ASSERT(x.capacity_ == 0); x.capacity_ = capacity; @@ -60099,7 +61471,7 @@ #endif // Construct in direct order: will destroy in reverse order. for (dimension_type i = size(); i < new_size; ++i) { - new (&vec_[i]) T(PLUS_INFINITY, ROUND_NOT_NEEDED); + new(&vec_[i]) T(PLUS_INFINITY, ROUND_NOT_NEEDED); bump_size(); } } @@ -60113,13 +61485,15 @@ set_size(new_size); #if !PPL_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS // Make sure we do not try to destroy vec_[0]. - if (new_size == 0) + if (new_size == 0) { ++new_size; + } #endif // We assume construction was done "forward". // We thus perform destruction "backward". - for (dimension_type i = old_size; i-- > new_size; ) + for (dimension_type i = old_size; i-- > new_size; ) { vec_[i].~T(); + } } template @@ -60129,7 +61503,7 @@ #if PPL_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS // Construct in direct order: will destroy in reverse order. for (dimension_type i = 0; i < y_size; ++i) { - new (&vec_[i]) T(y.vec_[i]); + new(&vec_[i]) T(y.vec_[i]); bump_size(); } #else // PPL_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS @@ -60138,7 +61512,7 @@ bump_size(); // Construct in direct order: will destroy in reverse order. for (dimension_type i = 1; i < y_size; ++i) { - new (&vec_[i]) T(y.vec_[i]); + new(&vec_[i]) T(y.vec_[i]); bump_size(); } } @@ -60149,8 +61523,9 @@ memory_size_type DB_Row_Impl_Handler::Impl::external_memory_in_bytes() const { memory_size_type n = 0; - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { n += Parma_Polyhedra_Library::external_memory_in_bytes(vec_[i]); + } return n; } @@ -60235,11 +61610,14 @@ template bool operator==(const DB_Row& x, const DB_Row& y) { - if (x.size() != y.size()) + if (x.size() != y.size()) { return false; - for (dimension_type i = x.size(); i-- > 0; ) - if (x[i] != y[i]) + } + for (dimension_type i = x.size(); i-- > 0; ) { + if (x[i] != y[i]) { return false; + } + } return true; } @@ -60730,8 +62108,9 @@ Temp& tmp1, Temp& tmp2) { const dimension_type x_num_rows = x.num_rows(); - if (x_num_rows != y.num_rows()) + if (x_num_rows != y.num_rows()) { return false; + } assign_r(tmp0, 0, ROUND_NOT_NEEDED); for (dimension_type i = x_num_rows; i-- > 0; ) { const DB_Row& x_i = x[i]; @@ -60740,17 +62119,18 @@ const T& x_i_j = x_i[j]; const T& y_i_j = y_i[j]; if (is_plus_infinity(x_i_j)) { - if (is_plus_infinity(y_i_j)) + if (is_plus_infinity(y_i_j)) { continue; + } else { pinf: assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); return true; } } - else if (is_plus_infinity(y_i_j)) + else if (is_plus_infinity(y_i_j)) { goto pinf; - + } const Temp* tmp1p; const Temp* tmp2p; if (x_i_j > y_i_j) { @@ -60856,8 +62236,9 @@ row_size(n_rows), row_capacity(compute_capacity(n_rows, max_num_columns())) { // Construct in direct order: will destroy in reverse order. - for (dimension_type i = 0; i < n_rows; ++i) + for (dimension_type i = 0; i < n_rows; ++i) { rows[i].construct(n_rows, row_capacity); + } PPL_ASSERT(OK()); } @@ -60868,8 +62249,9 @@ row_size(y.row_size), row_capacity(compute_capacity(y.row_size, max_num_columns())) { // Construct in direct order: will destroy in reverse order. - for (dimension_type i = 0, n_rows = rows.size(); i < n_rows; ++i) + for (dimension_type i = 0, n_rows = rows.size(); i < n_rows; ++i) { rows[i].construct_upward_approximation(y[i], row_capacity); + } PPL_ASSERT(OK()); } @@ -60889,12 +62271,14 @@ new_rows.insert(new_rows.end(), new_n_rows, DB_Row()); // Construct the new rows. dimension_type i = new_n_rows; - while (i-- > old_n_rows) + while (i-- > old_n_rows) { new_rows[i].construct(new_n_rows, row_capacity); + } // Steal the old rows. ++i; - while (i-- > 0) + while (i-- > 0) { swap(new_rows[i], rows[i]); + } // Put the new vector into place. using std::swap; swap(rows, new_rows); @@ -60902,8 +62286,9 @@ else { // Reallocation will NOT take place. rows.insert(rows.end(), new_n_rows - old_n_rows, DB_Row()); - for (dimension_type i = new_n_rows; i-- > old_n_rows; ) + for (dimension_type i = new_n_rows; i-- > old_n_rows; ) { rows[i].construct(new_n_rows, row_capacity); + } } } else { @@ -60916,9 +62301,10 @@ new_matrix.row_capacity = compute_capacity(new_n_rows, max_num_columns()); dimension_type i = new_n_rows; - while (i-- > old_n_rows) + while (i-- > old_n_rows) { new_matrix.rows[i].construct(new_matrix.row_size, new_matrix.row_capacity); + } // Copy the old rows. ++i; while (i-- > 0) { @@ -60936,10 +62322,12 @@ // Here we have the right number of rows. if (new_n_rows > row_size) { // We need more columns. - if (new_n_rows <= row_capacity) + if (new_n_rows <= row_capacity) { // But we have enough capacity: we resize existing rows. - for (dimension_type i = old_n_rows; i-- > 0; ) + for (dimension_type i = old_n_rows; i-- > 0; ) { rows[i].expand_within_capacity(new_n_rows); + } + } else { // Capacity exhausted: we must reallocate the rows and // make sure all the rows have the same capacity. @@ -60974,12 +62362,14 @@ // Construct the new rows (be careful: each new row must have // the same capacity as each one of the old rows). dimension_type i = new_n_rows; - while (i-- > old_n_rows) + while (i-- > old_n_rows) { new_rows[i].construct(new_n_rows, row_capacity); // Steal the old rows. + } ++i; - while (i-- > 0) + while (i-- > 0) { swap(new_rows[i], rows[i]); + } // Put the new vector into place. using std::swap; swap(rows, new_rows); @@ -60989,8 +62379,9 @@ rows.insert(rows.end(), new_n_rows - old_n_rows, DB_Row()); // Be careful: each new row must have // the same capacity as each one of the old rows. - for (dimension_type i = new_n_rows; i-- > old_n_rows; ) + for (dimension_type i = new_n_rows; i-- > old_n_rows; ) { rows[i].construct(new_n_rows, row_capacity); + } } } else { @@ -61004,17 +62395,20 @@ // Drop some rows. rows.resize(new_n_rows); // Shrink the existing rows. - for (dimension_type i = new_n_rows; i-- > 0; ) + for (dimension_type i = new_n_rows; i-- > 0; ) { rows[i].shrink(new_n_rows); + } old_n_rows = new_n_rows; } // Here we have the right number of rows. if (new_n_rows > row_size) { // We need more columns. - if (new_n_rows <= row_capacity) + if (new_n_rows <= row_capacity) { // But we have enough capacity: we resize existing rows. - for (dimension_type i = old_n_rows; i-- > 0; ) + for (dimension_type i = old_n_rows; i-- > 0; ) { rows[i].expand_within_capacity(new_n_rows); + } + } else { // Capacity exhausted: we must reallocate the rows and // make sure all the rows have the same capacity. @@ -61053,16 +62447,19 @@ bool DB_Matrix::ascii_load(std::istream& s) { dimension_type nrows; - if (!(s >> nrows)) + if (!(s >> nrows)) { return false; + } resize_no_copy(nrows); DB_Matrix& x = *this; - for (dimension_type i = 0; i < nrows; ++i) + for (dimension_type i = 0; i < nrows; ++i) { for (dimension_type j = 0; j < nrows; ++j) { Result r = input(x[i][j], s, ROUND_CHECK); - if (result_relation(r) != VR_EQ || is_minus_infinity(x[i][j])) + if (result_relation(r) != VR_EQ || is_minus_infinity(x[i][j])) { return false; + } } + } // Check invariants. PPL_ASSERT(OK()); @@ -61076,11 +62473,14 @@ bool operator==(const DB_Matrix& x, const DB_Matrix& y) { const dimension_type x_num_rows = x.num_rows(); - if (x_num_rows != y.num_rows()) + if (x_num_rows != y.num_rows()) { return false; - for (dimension_type i = x_num_rows; i-- > 0; ) - if (x[i] != y[i]) + } + for (dimension_type i = x_num_rows; i-- > 0; ) { + if (x[i] != y[i]) { return false; + } + } return true; } @@ -61088,8 +62488,9 @@ memory_size_type DB_Matrix::external_memory_in_bytes() const { memory_size_type n = rows.capacity() * sizeof(DB_Row); - for (dimension_type i = num_rows(); i-- > 0; ) + for (dimension_type i = num_rows(); i-- > 0; ) { n += rows[i].external_memory_in_bytes(row_capacity); + } return n; } @@ -61115,8 +62516,9 @@ const DB_Matrix& x = *this; const dimension_type n_rows = x.num_rows(); for (dimension_type i = 0; i < n_rows; ++i) { - if (!x[i].OK(row_size, row_capacity)) + if (!x[i].OK(row_size, row_capacity)) { return false; + } } // All checks passed. @@ -61131,8 +62533,9 @@ IO_Operators::operator<<(std::ostream& s, const DB_Matrix& c) { const dimension_type n = c.num_rows(); for (dimension_type i = 0; i < n; ++i) { - for (dimension_type j = 0; j < n; ++j) + for (dimension_type j = 0; j < n; ++j) { s << c[i][j] << " "; + } s << "\n"; } return s; @@ -61280,14 +62683,16 @@ inline void WRD_Extended_Number_Policy::handle_result(Result r) { - if (result_class(r) == VC_NAN) + if (result_class(r) == VC_NAN) { throw_result_exception(r); + } } inline void Debug_WRD_Extended_Number_Policy::handle_result(Result r) { - if (result_class(r) == VC_NAN) + if (result_class(r) == VC_NAN) { throw_result_exception(r); + } } } // namespace Parma_Polyhedra_Library @@ -63160,20 +64565,23 @@ friend bool operator==(const BD_Shape& x, const BD_Shape& y); template - friend bool Parma_Polyhedra_Library::rectilinear_distance_assign - (Checked_Number& r, - const BD_Shape& x, const BD_Shape& y, const Rounding_Dir dir, - Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::rectilinear_distance_assign(Checked_Number& r, + const BD_Shape& x, const BD_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); template - friend bool Parma_Polyhedra_Library::euclidean_distance_assign - (Checked_Number& r, - const BD_Shape& x, const BD_Shape& y, const Rounding_Dir dir, - Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::euclidean_distance_assign(Checked_Number& r, + const BD_Shape& x, const BD_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); template - friend bool Parma_Polyhedra_Library::l_infinity_distance_assign - (Checked_Number& r, - const BD_Shape& x, const BD_Shape& y, const Rounding_Dir dir, - Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::l_infinity_distance_assign(Checked_Number& r, + const BD_Shape& x, const BD_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); private: template friend class Parma_Polyhedra_Library::BD_Shape; @@ -63278,7 +64686,7 @@ void reset(flags_t mask); }; -/* Automatically generated from PPL source file ../src/BD_Shape_defs.hh line 1941. */ +/* Automatically generated from PPL source file ../src/BD_Shape_defs.hh line 1944. */ #undef PPL_IN_BD_Shape_CLASS //! The status flags to keep track of the internal state. @@ -63568,45 +64976,45 @@ image" that handle the general case: \f$l = ax + c\f$ */ template - void one_variable_affine_form_image - (const dimension_type& var_id, - const Interval& b, - const Interval& w_coeff, - const dimension_type& w_id, - const dimension_type& space_dim); + void + one_variable_affine_form_image(const dimension_type& var_id, + const Interval& b, + const Interval& w_coeff, + const dimension_type& w_id, + const dimension_type& space_dim); /*! \brief Auxiliary function for \ref affine_form_relation "affine form image" that handle the general case: \f$l = ax + by + c\f$ */ template - void two_variables_affine_form_image - (const dimension_type& var_id, - const Linear_Form >& lf, - const dimension_type& space_dim); + void + two_variables_affine_form_image(const dimension_type& var_id, + const Linear_Form >& lf, + const dimension_type& space_dim); /*! \brief Auxiliary function for refine with linear form that handle the general case: \f$l = ax + c\f$ */ template - void left_inhomogeneous_refine - (const dimension_type& right_t, - const dimension_type& right_w_id, - const Linear_Form >& left, - const Linear_Form >& right); + void + left_inhomogeneous_refine(const dimension_type& right_t, + const dimension_type& right_w_id, + const Linear_Form >& left, + const Linear_Form >& right); /*! \brief Auxiliary function for refine with linear form that handle the general case: \f$ax + b = cy + d\f$ */ template - void left_one_var_refine - (const dimension_type& left_w_id, - const dimension_type& right_t, - const dimension_type& right_w_id, - const Linear_Form >& left, - const Linear_Form >& right); + void + left_one_var_refine(const dimension_type& left_w_id, + const dimension_type& right_t, + const dimension_type& right_w_id, + const Linear_Form >& left, + const Linear_Form >& right); /*! \brief Auxiliary function for refine with linear form that handle @@ -63758,9 +65166,10 @@ inline void BD_Shape::Status::reset_zero_dim_univ() { // This is a no-op if the current status is not zero-dim. - if (flags == ZERO_DIM_UNIV) + if (flags == ZERO_DIM_UNIV) { // In the zero-dim space, if it is not the universe it is empty. flags = EMPTY; + } } template @@ -63829,15 +65238,17 @@ template bool BD_Shape::Status::OK() const { - if (test_zero_dim_univ()) + if (test_zero_dim_univ()) { // Zero-dim universe is OK. return true; + } if (test_empty()) { Status copy = *this; copy.reset_empty(); - if (copy.test_zero_dim_univ()) + if (copy.test_zero_dim_univ()) { return true; + } else { #ifndef NDEBUG std::cerr << "The empty flag is incompatible with any other one." @@ -63849,8 +65260,9 @@ // Shortest-path reduction implies shortest-path closure. if (test_shortest_path_reduced()) { - if (test_shortest_path_closed()) + if (test_shortest_path_closed()) { return true; + } else { #ifndef NDEBUG std::cerr << "The shortest-path reduction flag should also imply " @@ -63871,10 +65283,10 @@ namespace BD_Shapes { // These are the keywords that indicate the individual assertions. -const std::string zero_dim_univ = "ZE"; -const std::string empty = "EM"; -const std::string sp_closed = "SPC"; -const std::string sp_reduced = "SPR"; +extern const char* zero_dim_univ; +extern const char* empty; +extern const char* sp_closed; +extern const char* sp_reduced; const char yes = '+'; const char no = '-'; const char separator = ' '; @@ -63887,12 +65299,13 @@ is on; it is set to false otherwise. */ inline bool -get_field(std::istream& s, const std::string& keyword, bool& positive) { +get_field(std::istream& s, const char* keyword, bool& positive) { std::string str; if (!(s >> str) || (str[0] != yes && str[0] != no) - || str.substr(1) != keyword) + || str.substr(1) != keyword) { return false; + } positive = (str[0] == yes); return true; } @@ -63920,29 +65333,39 @@ using namespace Implementation::BD_Shapes; PPL_UNINITIALIZED(bool, positive); - if (!get_field(s, zero_dim_univ, positive)) + if (!get_field(s, zero_dim_univ, positive)) { return false; - if (positive) + } + if (positive) { set_zero_dim_univ(); + } - if (!get_field(s, empty, positive)) + if (!get_field(s, empty, positive)) { return false; - if (positive) + } + if (positive) { set_empty(); + } - if (!get_field(s, sp_closed, positive)) + if (!get_field(s, sp_closed, positive)) { return false; - if (positive) + } + if (positive) { set_shortest_path_closed(); - else + } + else { reset_shortest_path_closed(); + } - if (!get_field(s, sp_reduced, positive)) + if (!get_field(s, sp_reduced, positive)) { return false; - if (positive) + } + if (positive) { set_shortest_path_reduced(); - else + } + else { reset_shortest_path_reduced(); + } // Check invariants. PPL_ASSERT(OK()); @@ -65135,8 +66558,9 @@ OR_Matrix::any_row_iterator::operator++() { ++e; dimension_type increment = e; - if (e % 2 != 0) + if (e % 2 != 0) { ++increment; + } #if PPL_OR_MATRIX_EXTRA_DEBUG else { value.size_ += 2; @@ -65189,8 +66613,9 @@ difference_type e_dt = static_cast(e); difference_type i_dt = static_cast(i); difference_type increment = m + (m * m) / 2 + m * e_dt; - if (e_dt % 2 == 0 && m % 2 != 0) + if (e_dt % 2 == 0 && m % 2 != 0) { ++increment; + } e_dt += m; i_dt += increment; e = static_cast(e_dt); @@ -65213,8 +66638,9 @@ OR_Matrix::any_row_iterator::operator+=(Unsigned m) { dimension_type n = m; dimension_type increment = n + (n*n)/2 + n*e; - if (e % 2 == 0 && n % 2 != 0) + if (e % 2 == 0 && n % 2 != 0) { ++increment; + } e += n; i += increment; value.first += increment; @@ -65533,8 +66959,9 @@ OR_Matrix new_matrix(new_dim); element_iterator j = new_matrix.element_begin(); for (element_iterator i = element_begin(), - mend = element_end(); i != mend; ++i, ++j) + mend = element_end(); i != mend; ++i, ++j) { assign_or_swap(*j, *i); + } m_swap(new_matrix); } } @@ -65565,8 +66992,9 @@ m_swap(new_matrix); } } - else if (new_dim < space_dim) + else if (new_dim < space_dim) { shrink(new_dim); + } } #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS @@ -65581,8 +67009,9 @@ Temp& tmp0, Temp& tmp1, Temp& tmp2) { - if (x.num_rows() != y.num_rows()) + if (x.num_rows() != y.num_rows()) { return false; + } assign_r(tmp0, 0, ROUND_NOT_NEEDED); for (typename OR_Matrix::const_element_iterator i = x.element_begin(), j = y.element_begin(), @@ -65590,17 +67019,18 @@ const T& x_i = *i; const T& y_i = *j; if (is_plus_infinity(x_i)) { - if (is_plus_infinity(y_i)) + if (is_plus_infinity(y_i)) { continue; + } else { pinf: assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); return true; } } - else if (is_plus_infinity(y_i)) + else if (is_plus_infinity(y_i)) { goto pinf; - + } const Temp* tmp1p; const Temp* tmp2p; if (x_i > y_i) { @@ -65725,8 +67155,9 @@ } // The underlying DB_Row should be OK. - if (!vec.OK(vec.size(), vec_capacity)) + if (!vec.OK(vec.size(), vec_capacity)) { return false; + } // All checks passed. return true; @@ -65757,8 +67188,9 @@ bool OR_Matrix::ascii_load(std::istream& s) { dimension_type space; - if (!(s >> space)) + if (!(s >> space)) { return false; + } resize_no_copy(space); for (row_iterator i = row_begin(), this_row_end = row_end(); i != this_row_end; ++i) { @@ -65766,8 +67198,9 @@ const dimension_type rs = i.row_size(); for (dimension_type j = 0; j < rs; ++j) { Result r = input(r_i[j], s, ROUND_CHECK); - if (result_relation(r) != VR_EQ || is_minus_infinity(r_i[j])) + if (result_relation(r) != VR_EQ || is_minus_infinity(r_i[j])) { return false; + } } } PPL_ASSERT(OK()); @@ -65784,8 +67217,9 @@ m_end = m.row_end(); m_iter != m_end; ++m_iter) { typename OR_Matrix::const_row_reference_type r_m = *m_iter; const dimension_type mr_size = m_iter.row_size(); - for (dimension_type j = 0; j < mr_size; ++j) + for (dimension_type j = 0; j < mr_size; ++j) { s << r_m[j] << " "; + } s << "\n"; } return s; @@ -67636,20 +69070,26 @@ operator==(const Octagonal_Shape& x, const Octagonal_Shape& y); template - friend bool Parma_Polyhedra_Library::rectilinear_distance_assign - (Checked_Number& r, - const Octagonal_Shape& x, const Octagonal_Shape& y, - const Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::rectilinear_distance_assign(Checked_Number& r, + const Octagonal_Shape& x, + const Octagonal_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); template - friend bool Parma_Polyhedra_Library::euclidean_distance_assign - (Checked_Number& r, - const Octagonal_Shape& x, const Octagonal_Shape& y, - const Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::euclidean_distance_assign(Checked_Number& r, + const Octagonal_Shape& x, + const Octagonal_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); template - friend bool Parma_Polyhedra_Library::l_infinity_distance_assign - (Checked_Number& r, - const Octagonal_Shape& x, const Octagonal_Shape& y, - const Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2); + friend bool Parma_Polyhedra_Library + ::l_infinity_distance_assign(Checked_Number& r, + const Octagonal_Shape& x, + const Octagonal_Shape& y, + const Rounding_Dir dir, + Temp& tmp0, Temp& tmp1, Temp& tmp2); private: template friend class Parma_Polyhedra_Library::Octagonal_Shape; @@ -67758,7 +69198,7 @@ }; -/* Automatically generated from PPL source file ../src/Octagonal_Shape_defs.hh line 1923. */ +/* Automatically generated from PPL source file ../src/Octagonal_Shape_defs.hh line 1929. */ #undef PPL_IN_Octagonal_Shape_CLASS //! The status flags to keep track of the internal state. @@ -68209,9 +69649,10 @@ inline void Octagonal_Shape::Status::reset_zero_dim_univ() { // This is a no-op if the current status is not zero-dim. - if (flags == ZERO_DIM_UNIV) + if (flags == ZERO_DIM_UNIV) { // In the zero-dim space, if it is not the universe it is empty. flags = EMPTY; + } } template @@ -68260,15 +69701,17 @@ template inline bool Octagonal_Shape::Status::OK() const { - if (test_zero_dim_univ()) + if (test_zero_dim_univ()) { // Zero-dim universe is OK. return true; + } if (test_empty()) { Status copy = *this; copy.reset_empty(); - if (copy.test_zero_dim_univ()) + if (copy.test_zero_dim_univ()) { return true; + } else { #ifndef NDEBUG std::cerr << "The empty flag is incompatible with any other one." @@ -68287,9 +69730,9 @@ namespace Octagonal_Shapes { // These are the keywords that indicate the individual assertions. -const std::string zero_dim_univ = "ZE"; -const std::string empty = "EM"; -const std::string strong_closed = "SC"; +extern const char* zero_dim_univ; +extern const char* empty; +extern const char* strong_closed; const char yes = '+'; const char no = '-'; const char separator = ' '; @@ -68302,12 +69745,13 @@ is on; it is set to false otherwise. */ inline bool -get_field(std::istream& s, const std::string& keyword, bool& positive) { +get_field(std::istream& s, const char* keyword, bool& positive) { std::string str; if (!(s >> str) || (str[0] != yes && str[0] != no) - || str.substr(1) != keyword) + || str.substr(1) != keyword) { return false; + } positive = (str[0] == yes); return true; } @@ -68335,23 +69779,30 @@ using namespace Implementation::Octagonal_Shapes; PPL_UNINITIALIZED(bool, positive); - if (!get_field(s, zero_dim_univ, positive)) + if (!get_field(s, zero_dim_univ, positive)) { return false; - if (positive) + } + if (positive) { set_zero_dim_univ(); + } - if (!get_field(s, empty, positive)) + if (!get_field(s, empty, positive)) { return false; - if (positive) + } + + if (positive) { set_empty(); + } - if (!get_field(s, strong_closed, positive)) + if (!get_field(s, strong_closed, positive)) { return false; - if (positive) + } + if (positive) { set_strongly_closed(); - else + } + else { reset_strongly_closed(); - + } // Check invariants. PPL_ASSERT(OK()); return true; @@ -68420,14 +69871,17 @@ // Refine `p' with all the constraints in `cs' not depending // on variables in `vars'. - if (vars.empty()) + if (vars.empty()) { p.refine_with_constraints(cs); + } else { for (Constraint_System::const_iterator j = cs.begin(), - cs_end = cs.end(); j != cs_end; ++j) - if (j->expression().all_zeroes(vars)) + cs_end = cs.end(); j != cs_end; ++j) { + if (j->expression().all_zeroes(vars)) { // `*j' does not depend on variables in `vars'. p.refine_with_constraint(*j); + } + } } p.refine_with_constraint(min_value <= x); p.refine_with_constraint(x <= max_value); @@ -68451,8 +69905,9 @@ Coefficient& tmp) { if (first == end) { PSET p(src); - if (cs_p != 0) + if (cs_p != 0) { p.refine_with_constraints(*cs_p); + } for (Variables_Set::const_iterator i = vars.begin(), vars_end = vars.end(); i != vars_end; ++i) { const Variable x(*i); @@ -68476,9 +69931,10 @@ wrap_assign_col(dest, p, vars, first+1, end, w, min_value, max_value, cs_p, tmp); } - else + else { wrap_assign_col(dest, src, vars, first+1, end, w, min_value, max_value, cs_p, tmp); + } } } } @@ -68528,8 +69984,9 @@ // Wrapping no variable only requires refining with *cs_p, if any. if (vars.empty()) { - if (cs_p != 0) + if (cs_p != 0) { pointset.refine_with_constraints(*cs_p); + } return; } @@ -68544,9 +70001,9 @@ } // Wrapping an empty polyhedron is a no-op. - if (pointset.is_empty()) + if (pointset.is_empty()) { return; - + } // Set `min_value' and `max_value' to the minimum and maximum values // a variable of width `w' and signedness `s' can take. PPL_DIRTY_TEMP_COEFFICIENT(min_value); @@ -68611,8 +70068,9 @@ continue; } - if (!pointset.maximize(x, u_n, u_d, extremum)) + if (!pointset.maximize(x, u_n, u_d, extremum)) { goto set_full_range; + } div_assign_r(l_n, l_n, l_d, ROUND_DOWN); div_assign_r(u_n, u_n, u_d, ROUND_DOWN); @@ -68624,35 +70082,41 @@ const Coefficient& last_quadrant = u_n; // Special case: this variable does not need wrapping. - if (first_quadrant == 0 && last_quadrant == 0) + if (first_quadrant == 0 && last_quadrant == 0) { continue; + } // If overflow is impossible, try not to add useless constraints. if (o == OVERFLOW_IMPOSSIBLE) { - if (first_quadrant < 0) + if (first_quadrant < 0) { full_range_bounds.insert(min_value <= x); - if (last_quadrant > 0) + } + if (last_quadrant > 0) { full_range_bounds.insert(x <= max_value); + } continue; } - if (o == OVERFLOW_UNDEFINED || collective_wrap_too_complex) + if (o == OVERFLOW_UNDEFINED || collective_wrap_too_complex) { goto set_full_range; + } Coefficient& quadrants = u_d; quadrants = last_quadrant - first_quadrant + 1; PPL_UNINITIALIZED(unsigned, extension); Result res = assign_r(extension, quadrants, ROUND_IGNORE); - if (result_overflow(res) != 0 || extension > complexity_threshold) + if (result_overflow(res) != 0 || extension > complexity_threshold) { goto set_full_range; + } if (!wrap_individually && !collective_wrap_too_complex) { res = mul_assign_r(collective_wrap_complexity, collective_wrap_complexity, extension, ROUND_IGNORE); if (result_overflow(res) != 0 - || collective_wrap_complexity > complexity_threshold) + || collective_wrap_complexity > complexity_threshold) { collective_wrap_too_complex = true; + } if (collective_wrap_too_complex) { // Set all the dimensions in `translations' to full range. for (Wrap_Translations::const_iterator j = translations.begin(), @@ -68709,8 +70173,9 @@ } } - if (cs_p != 0) + if (cs_p != 0) { pointset.refine_with_constraints(*cs_p); + } pointset.refine_with_constraints(full_range_bounds); } @@ -68793,11 +70258,13 @@ Octagonal_Shape::Octagonal_Shape(const dimension_type num_dimensions, const Degenerate_Element kind) : matrix(num_dimensions), space_dim(num_dimensions), status() { - if (kind == EMPTY) + if (kind == EMPTY) { set_empty(); - else if (num_dimensions > 0) + } + else if (num_dimensions > 0) { // A (non zero-dim) universe octagon is strongly closed. set_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -68818,10 +70285,12 @@ space_dim(y.space_dim), status() { // TODO: handle flags properly, possibly taking special cases into account. - if (y.marked_empty()) + if (y.marked_empty()) { set_empty(); - else if (y.marked_zero_dim_univ()) + } + else if (y.marked_zero_dim_univ()) { set_zero_dim_univ(); + } } template @@ -68830,9 +70299,10 @@ : matrix(cs.space_dimension()), space_dim(cs.space_dimension()), status() { - if (cs.space_dimension() > 0) + if (cs.space_dimension() > 0) { // A (non zero-dim) universe octagon is strongly closed. set_strongly_closed(); + } add_constraints(cs); } @@ -68842,9 +70312,10 @@ : matrix(cgs.space_dimension()), space_dim(cgs.space_dimension()), status() { - if (cgs.space_dimension() > 0) + if (cgs.space_dimension() > 0) { // A (non zero-dim) universe octagon is strongly closed. set_strongly_closed(); + } add_congruences(cgs); } @@ -68857,8 +70328,9 @@ space_dim(box.space_dimension()), status() { // Check for emptiness for maximum precision. - if (box.is_empty()) + if (box.is_empty()) { set_empty(); + } else if (box.space_dimension() > 0) { // A (non zero-dim) universe OS is strongly closed. set_strongly_closed(); @@ -68873,9 +70345,10 @@ : matrix(grid.space_dimension()), space_dim(grid.space_dimension()), status() { - if (grid.space_dimension() > 0) + if (grid.space_dimension() > 0) { // A (non zero-dim) universe OS is strongly closed. set_strongly_closed(); + } // Taking minimized congruences ensures maximum precision. refine_with_congruences(grid.minimized_congruences()); } @@ -68889,8 +70362,9 @@ space_dim(bd.space_dimension()), status() { // Check for emptiness for maximum precision. - if (bd.is_empty()) + if (bd.is_empty()) { set_empty(); + } else if (bd.space_dimension() > 0) { // A (non zero-dim) universe OS is strongly closed. set_strongly_closed(); @@ -69007,26 +70481,30 @@ template inline bool operator==(const Octagonal_Shape& x, const Octagonal_Shape& y) { - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { // Dimension-incompatible OSs are different. return false; - + } // Zero-dim OSs are equal if and only if they are both empty or universe. if (x.space_dim == 0) { - if (x.marked_empty()) + if (x.marked_empty()) { return y.marked_empty(); - else + } + else { return !y.marked_empty(); + } } x.strong_closure_assign(); y.strong_closure_assign(); // If one of two octagons is empty, then they are equal if and only if // the other octagon is empty too. - if (x.marked_empty()) + if (x.marked_empty()) { return y.marked_empty(); - if (y.marked_empty()) + } + if (y.marked_empty()) { return false; + } // Strong closure is a canonical form. return x.matrix == y.matrix; } @@ -69081,8 +70559,9 @@ N& r_i_j = matrix[i][j]; if (r_i_j > k) { r_i_j = k; - if (marked_strongly_closed()) + if (marked_strongly_closed()) { reset_strongly_closed(); + } } } @@ -69109,8 +70588,9 @@ inline void Octagonal_Shape::add_constraints(const Constraint_System& cs) { for (Constraint_System::const_iterator i = cs.begin(), - i_end = cs.end(); i != i_end; ++i) + i_end = cs.end(); i != i_end; ++i) { add_constraint(*i); + } } template @@ -69129,32 +70609,37 @@ inline void Octagonal_Shape::add_congruences(const Congruence_System& cgs) { for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); i != cgs_end; ++i) + cgs_end = cgs.end(); i != cgs_end; ++i) { add_congruence(*i); + } } template inline void Octagonal_Shape::refine_with_constraint(const Constraint& c) { // Dimension-compatibility check. - if (c.space_dimension() > space_dimension()) + if (c.space_dimension() > space_dimension()) { throw_dimension_incompatible("refine_with_constraint(c)", c); + } - if (!marked_empty()) + if (!marked_empty()) { refine_no_check(c); + } } template inline void Octagonal_Shape::refine_with_constraints(const Constraint_System& cs) { // Dimension-compatibility check. - if (cs.space_dimension() > space_dimension()) + if (cs.space_dimension() > space_dimension()) { throw_invalid_argument("refine_with_constraints(cs)", "cs and *this are space-dimension incompatible"); + } for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) + cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) { refine_no_check(*i); + } } template @@ -69162,24 +70647,27 @@ Octagonal_Shape::refine_with_congruence(const Congruence& cg) { const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dimension()) + if (cg_space_dim > space_dimension()) { throw_dimension_incompatible("refine_with_congruence(cg)", cg); - - if (!marked_empty()) + } + if (!marked_empty()) { refine_no_check(cg); + } } template void Octagonal_Shape::refine_with_congruences(const Congruence_System& cgs) { // Dimension-compatibility check. - if (cgs.space_dimension() > space_dimension()) + if (cgs.space_dimension() > space_dimension()) { throw_invalid_argument("refine_with_congruences(cgs)", "cgs and *this are space-dimension incompatible"); + } for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) + cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) { refine_no_check(*i); + } } template @@ -69189,8 +70677,9 @@ PPL_ASSERT(cg.space_dimension() <= space_dimension()); if (cg.is_proper_congruence()) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { set_empty(); + } // Other proper congruences are just ignored. return; } @@ -69217,9 +70706,10 @@ Octagonal_Shape ::remove_higher_space_dimensions(const dimension_type new_dimension) { // Dimension-compatibility check. - if (new_dimension > space_dim) + if (new_dimension > space_dim) { throw_dimension_incompatible("remove_higher_space_dimension(nd)", new_dimension); + } // The removal of no dimensions from any octagon is a no-op. // Note that this case also captures the only legal removal of // dimensions from an octagon in a 0-dim space. @@ -69232,8 +70722,9 @@ matrix.shrink(new_dimension); // When we remove all dimensions from a non-empty octagon, // we obtain the zero-dimensional universe octagon. - if (new_dimension == 0 && !marked_empty()) + if (new_dimension == 0 && !marked_empty()) { set_zero_dim_univ(); + } space_dim = new_dimension; PPL_ASSERT(OK()); } @@ -69281,8 +70772,9 @@ inline void Octagonal_Shape::time_elapse_assign(const Octagonal_Shape& y) { // Dimension-compatibility check. - if (space_dimension() != y.space_dimension()) + if (space_dimension() != y.space_dimension()) { throw_dimension_incompatible("time_elapse_assign(y)", y); + } // Compute time-elapse on polyhedra. // TODO: provide a direct implementation. C_Polyhedron ph_x(constraints()); @@ -69357,15 +70849,17 @@ Temp& tmp1, Temp& tmp2) { // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { return false; - + } // Zero-dim OSs are equal if and only if they are both empty or universe. if (x.space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -69376,10 +70870,12 @@ // If one of two OSs is empty, then they are equal if and only if // the other OS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -69422,15 +70918,18 @@ Temp& tmp1, Temp& tmp2) { // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { return false; + } // Zero-dim OSs are equal if and only if they are both empty or universe. if (x.space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -69441,10 +70940,12 @@ // If one of two OSs is empty, then they are equal if and only if // the other OS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -69487,15 +70988,17 @@ Temp& tmp1, Temp& tmp2) { // Dimension-compatibility check. - if (x.space_dim != y.space_dim) + if (x.space_dim != y.space_dim) { return false; - + } // Zero-dim OSs are equal if and only if they are both empty or universe. if (x.space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -69506,10 +71009,12 @@ // If one of two OSs is empty, then they are equal if and only if // the other OS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -69631,11 +71136,12 @@ // See if there is at least one inconsistent constraint in `ph.con_sys'. for (Constraint_System::const_iterator i = ph.con_sys.begin(), - cs_end = ph.con_sys.end(); i != cs_end; ++i) + cs_end = ph.con_sys.end(); i != cs_end; ++i) { if (i->is_inconsistent()) { *this = Octagonal_Shape(num_dimensions, EMPTY); return; } + } // If `complexity' allows it, use simplex to derive the exact (modulo // the fact that our OSs are topologically closed) variable bounds. @@ -69644,9 +71150,10 @@ lp.set_optimization_mode(MAXIMIZATION); const Constraint_System& ph_cs = ph.constraints(); - if (!ph_cs.has_strict_inequalities()) + if (!ph_cs.has_strict_inequalities()) { lp.add_constraints(ph_cs); - else + } + else { // Adding to `lp' a topologically closed version of `ph_cs'. for (Constraint_System::const_iterator i = ph_cs.begin(), ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) { @@ -69655,9 +71162,11 @@ Linear_Expression expr(c.expression()); lp.add_constraint(expr >= 0); } - else + else { lp.add_constraint(c); + } } + } // Check for unsatisfiability. if (!lp.is_satisfiable()) { @@ -69693,8 +71202,9 @@ } // Evaluate optimal upper bound for `x - y <= ub'. for (dimension_type j = 0; j < num_dimensions; ++j) { - if (i == j) + if (i == j) { continue; + } Variable y(j); lp.set_objective_function(x - y); if (lp.solve() == OPTIMIZED_MIP_PROBLEM) { @@ -69708,8 +71218,9 @@ } // Evaluate optimal upper bound for `y - x <= ub'. for (dimension_type j = 0; j < num_dimensions; ++j) { - if (i == j) + if (i == j) { continue; + } Variable y(j); lp.set_objective_function(x - y); if (lp.solve() == OPTIMIZED_MIP_PROBLEM) { @@ -69851,11 +71362,12 @@ } } - if (!point_seen) + if (!point_seen) { // The generator system is not empty, but contains no points. throw_invalid_argument("Octagonal_Shape(gs)", "the non-empty generator system gs " "contains no points."); + } // Going through all the lines and rays. for (Generator_System::const_iterator k = gs_begin; k != gs_end; ++k) { @@ -69906,26 +71418,32 @@ const dimension_type dj = 2*j; // Set for any ray the right limit in the case // of the binary constraints. - if (g_i < g_j) + if (g_i < g_j) { // Hyperplane: X_i - X_j >= +Inf. assign_r(x_i[dj], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i > g_j) + } + if (g_i > g_j) { // Hyperplane: X_i - X_j <= +Inf. assign_r(x_ii[dj + 1], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i < -g_j) + } + if (g_i < -g_j) { // Hyperplane: X_i + X_j >= +Inf. assign_r(x_i[dj + 1], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i > -g_j) + } + if (g_i > -g_j) { // Hyperplane: X_i + X_j <= +Inf. assign_r(x_ii[dj], PLUS_INFINITY, ROUND_NOT_NEEDED); + } } // Case: unary constraints. - if (g_i < 0) + if (g_i < 0) { // Hyperplane: X_i = +Inf. assign_r(x_i[di + 1], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i > 0) + } + if (g_i > 0) { // Hyperplane: X_i = +Inf. assign_r(x_ii[di], PLUS_INFINITY, ROUND_NOT_NEEDED); + } } break; default: @@ -69942,17 +71460,18 @@ Octagonal_Shape::add_constraint(const Constraint& c) { const dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dim) + if (c_space_dim > space_dim) { throw_dimension_incompatible("add_constraint(c)", c); - + } // Get rid of strict inequalities. if (c.is_strict_inequality()) { if (c.is_inconsistent()) { set_empty(); return; } - if (c.is_tautological()) + if (c.is_tautological()) { return; + } // Nontrivial strict inequalities are not allowed. throw_invalid_argument("add_constraint(c)", "strict inequalities are not allowed"); @@ -69966,15 +71485,17 @@ // Constraints that are not octagonal differences are not allowed. if (!Octagonal_Shape_Helper ::extract_octagonal_difference(c, c_space_dim, num_vars, - i, j, coeff, term)) + i, j, coeff, term)) { throw_invalid_argument("add_constraint(c)", "c is not an octagonal constraint"); + } if (num_vars == 0) { // Dealing with a trivial constraint (not a strict inequality). if (c.inhomogeneous_term() < 0 - || (c.is_equality() && c.inhomogeneous_term() != 0)) + || (c.is_equality() && c.inhomogeneous_term() != 0)) { set_empty(); + } return; } @@ -69983,8 +71504,9 @@ typename OR_Matrix::row_reference_type m_i = *i_iter; N& m_i_j = m_i[j]; // Set `coeff' to the absolute value of itself. - if (coeff < 0) + if (coeff < 0) { neg_assign(coeff); + } bool is_oct_changed = false; // Compute the bound for `m_i_j', rounding towards plus infinity. @@ -69997,10 +71519,12 @@ if (c.is_equality()) { // Select the cell to be modified for the ">=" part of constraint. - if (i % 2 == 0) + if (i % 2 == 0) { ++i_iter; - else + } + else { --i_iter; + } typename OR_Matrix::row_reference_type m_ci = *i_iter; using namespace Implementation::Octagonal_Shapes; @@ -70016,8 +71540,9 @@ } // This method does not preserve closure. - if (is_oct_changed && marked_strongly_closed()) + if (is_oct_changed && marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -70027,13 +71552,15 @@ const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check: // the dimension of `cg' can not be greater than space_dim. - if (space_dimension() < cg_space_dim) + if (space_dimension() < cg_space_dim) { throw_dimension_incompatible("add_congruence(cg)", cg); + } // Handle the case of proper congruences first. if (cg.is_proper_congruence()) { - if (cg.is_tautological()) + if (cg.is_tautological()) { return; + } if (cg.is_inconsistent()) { set_empty(); return; @@ -70067,15 +71594,16 @@ // The dimensions of `left' and `right' should not be greater than the // dimension of `*this'. const dimension_type left_space_dim = left.space_dimension(); - if (space_dim < left_space_dim) + if (space_dim < left_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(left, right)", "left", left); + } const dimension_type right_space_dim = right.space_dimension(); - if (space_dim < right_space_dim) + if (space_dim < right_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(left, right)", "right", right); - + } // Number of non-zero coefficients in `left': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type left_t = 0; @@ -70088,27 +71616,31 @@ dimension_type right_w_id = 0; // Get information about the number of non-zero coefficients in `left'. - for (dimension_type i = left_space_dim; i-- > 0; ) + for (dimension_type i = left_space_dim; i-- > 0; ) { if (left.coefficient(Variable(i)) != 0) { - if (left_t++ == 1) + if (left_t++ == 1) { break; - else + } + else { left_w_id = i; + } } + } // Get information about the number of non-zero coefficients in `right'. - for (dimension_type i = right_space_dim; i-- > 0; ) + for (dimension_type i = right_space_dim; i-- > 0; ) { if (right.coefficient(Variable(i)) != 0) { - if (right_t++ == 1) + if (right_t++ == 1) { break; - else + } + else { right_w_id = i; + } } + } typedef typename OR_Matrix::row_iterator row_iterator; typedef typename OR_Matrix::row_reference_type row_reference; - typedef typename OR_Matrix::const_row_iterator Row_iterator; - typedef typename OR_Matrix::const_row_reference_type Row_reference; typedef Interval FP_Interval_Type; // FIXME: there is plenty of duplicate code in the following lines. We could @@ -70246,11 +71778,13 @@ const FP_Interval_Type& right_c = right.inhomogeneous_term(); sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(), ROUND_UP); - if (left_w_id < right_w_id) + if (left_w_id < right_w_id) { add_octagonal_constraint(n_right, n_left, c_plus_minus_a_minus); - else + } + else { add_octagonal_constraint(n_left + 1, n_right + 1, c_plus_minus_a_minus); + } PPL_ASSERT(OK()); return; } @@ -70262,10 +71796,12 @@ const FP_Interval_Type& right_c = right.inhomogeneous_term(); sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(), ROUND_UP); - if (left_w_id < right_w_id) + if (left_w_id < right_w_id) { add_octagonal_constraint(n_right + 1, n_left, c_plus_minus_a_minus); - else + } + else { add_octagonal_constraint(n_left + 1, n_right, c_plus_minus_a_minus); + } PPL_ASSERT(OK()); return; } @@ -70277,10 +71813,12 @@ const FP_Interval_Type& right_c = right.inhomogeneous_term(); sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(), ROUND_UP); - if (left_w_id < right_w_id) + if (left_w_id < right_w_id) { add_octagonal_constraint(n_right, n_left + 1, c_plus_minus_a_minus); - else + } + else { add_octagonal_constraint(n_left, n_right + 1, c_plus_minus_a_minus); + } PPL_ASSERT(OK()); return; } @@ -70292,11 +71830,13 @@ const FP_Interval_Type& right_c = right.inhomogeneous_term(); sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(), ROUND_UP); - if (left_w_id < right_w_id) + if (left_w_id < right_w_id) { add_octagonal_constraint(n_right + 1, n_left + 1, c_plus_minus_a_minus); - else + } + else { add_octagonal_constraint(n_left, n_right, c_plus_minus_a_minus); + } PPL_ASSERT(OK()); return; } @@ -70336,13 +71876,15 @@ if (low_coeff != 0 || high_coeff != 0) { assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } } else { @@ -70351,13 +71893,15 @@ if (low_coeff != 0 || high_coeff != 0) { assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } } } @@ -70395,13 +71939,15 @@ bool do_update = false; assign_r(low_coeff, lv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } if (do_update) { @@ -70457,16 +72003,18 @@ // Constraints that are not octagonal differences are ignored. if (!Octagonal_Shape_Helper ::extract_octagonal_difference(c, c_space_dim, num_vars, - i, j, coeff, term)) + i, j, coeff, term)) { return; + } if (num_vars == 0) { const Coefficient& c_inhomo = c.inhomogeneous_term(); // Dealing with a trivial constraint (maybe a strict inequality). if (c_inhomo < 0 || (c_inhomo != 0 && c.is_equality()) - || (c_inhomo == 0 && c.is_strict_inequality())) + || (c_inhomo == 0 && c.is_strict_inequality())) { set_empty(); + } return; } @@ -70475,8 +72023,9 @@ typename OR_Matrix::row_reference_type m_i = *i_iter; N& m_i_j = m_i[j]; // Set `coeff' to the absolute value of itself. - if (coeff < 0) + if (coeff < 0) { neg_assign(coeff); + } bool is_oct_changed = false; // Compute the bound for `m_i_j', rounding towards plus infinity. @@ -70489,10 +72038,12 @@ if (c.is_equality()) { // Select the cell to be modified for the ">=" part of constraint. - if (i % 2 == 0) + if (i % 2 == 0) { ++i_iter; - else + } + else { --i_iter; + } typename OR_Matrix::row_reference_type m_ci = *i_iter; using namespace Implementation::Octagonal_Shapes; @@ -70508,8 +72059,9 @@ } // This method does not preserve closure. - if (is_oct_changed && marked_strongly_closed()) + if (is_oct_changed && marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -70518,14 +72070,16 @@ Octagonal_Shape::affine_dimension() const { const dimension_type n_rows = matrix.num_rows(); // A zero-space-dim shape always has affine dimension zero. - if (n_rows == 0) + if (n_rows == 0) { return 0; + } // Strong closure is necessary to detect emptiness // and all (possibly implicit) equalities. strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return 0; + } // The vector `leaders' is used to represent non-singular // equivalence classes: @@ -70537,10 +72091,12 @@ // Due to the splitting of variables, the affine dimension is the // number of non-singular positive zero-equivalence classes. dimension_type affine_dim = 0; - for (dimension_type i = 0; i < n_rows; i += 2) + for (dimension_type i = 0; i < n_rows; i += 2) { // Note: disregard the singular equivalence class. - if (leaders[i] == i && leaders[i + 1] == i + 1) + if (leaders[i] == i && leaders[i + 1] == i + 1) { ++affine_dim; + } + } return affine_dim; } @@ -70551,12 +72107,12 @@ // Strong closure is necessary to detect emptiness // and all (possibly implicit) equalities. strong_closure_assign(); - const dimension_type space_dim = space_dimension(); Congruence_System cgs(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cgs = Congruence_System::zero_dim_empty(); + } return cgs; } @@ -70576,21 +72132,25 @@ for (dimension_type i = 0, i_end = 2*space_dim; i != i_end; i += 2) { const dimension_type lead_i = leaders[i]; if (i == lead_i) { - if (leaders[i + 1] == i) + if (leaders[i + 1] == i) { // `i' is the leader of the singular equivalence class. goto singular; - else + } + else { // `i' is the leader of a non-singular equivalence class. continue; + } } else { // `i' is not a leader. - if (leaders[i + 1] == lead_i) + if (leaders[i + 1] == lead_i) { // `i' belongs to the singular equivalence class. goto singular; - else + } + else { // `i' does not belong to the singular equivalence class. goto non_singular; + } } singular: @@ -70622,10 +72182,12 @@ const Variable x(lead_i/2); const Variable y(i/2); numer_denom(c_i_li, numer, denom); - if (lead_i % 2 == 0) + if (lead_i % 2 == 0) { cgs.insert(denom*x - denom*y == numer); - else + } + else { cgs.insert(denom*x + denom*y + numer == 0); + } } continue; } @@ -70638,8 +72200,9 @@ // If `y' is an empty 0-dim space octagon, let `*this' become empty. // If `y' is an universal 0-dim space octagon, we simply return. if (y.space_dim == 0) { - if (y.marked_empty()) + if (y.marked_empty()) { set_empty(); + } return; } @@ -70667,13 +72230,15 @@ matrix_row_end = matrix.row_end(); i != matrix_row_end; ++i) { typename OR_Matrix::row_reference_type r = *i; dimension_type rs_i = i.row_size(); - for (dimension_type j = old_num_rows; j < rs_i; ++j, ++y_it) + for (dimension_type j = old_num_rows; j < rs_i; ++j, ++y_it) { r[j] = *y_it; + } } // The concatenation does not preserve the closure. - if (marked_strongly_closed()) + if (marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -70681,8 +72246,9 @@ bool Octagonal_Shape::contains(const Octagonal_Shape& y) const { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("contains(y)", y); + } if (space_dim == 0) { // The zero-dimensional empty octagon only contains another @@ -70695,21 +72261,25 @@ // `y' needs to be transitively closed. y.strong_closure_assign(); // An empty octagon is in any other dimension-compatible octagons. - if (y.marked_empty()) + if (y.marked_empty()) { return true; + } // If `*this' is empty it can not contain `y' (which is not empty). - if (is_empty()) + if (is_empty()) { return false; + } // `*this' contains `y' if and only if every element of `*this' // is greater than or equal to the correspondent one of `y'. for (typename OR_Matrix::const_element_iterator i = matrix.element_begin(), j = y.matrix.element_begin(), matrix_element_end = matrix.element_end(); - i != matrix_element_end; ++i, ++j) - if (*i < *j) + i != matrix_element_end; ++i, ++j) { + if (*i < *j) { return false; + } + } return true; } @@ -70717,16 +72287,19 @@ bool Octagonal_Shape::is_disjoint_from(const Octagonal_Shape& y) const { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("is_disjoint_from(y)", y); + } // If one Octagonal_Shape is empty, the Octagonal_Shapes are disjoint. strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return true; + } y.strong_closure_assign(); - if (y.marked_empty()) + if (y.marked_empty()) { return true; + } // Two Octagonal_Shapes are disjoint if and only if their // intersection is empty, i.e., if and only if there exists a @@ -70760,8 +72333,9 @@ row_reference y_j = *(y_begin + j); const N& y_ci_cj = (j < rs_i) ? y_ci[cj] : y_j[i]; neg_assign_r(neg_y_ci_cj, y_ci_cj, ROUND_UP); - if (m_i_j < neg_y_ci_cj) + if (m_i_j < neg_y_ci_cj) { return true; + } } } return false; @@ -70771,21 +72345,25 @@ bool Octagonal_Shape::is_universe() const { // An empty octagon is not universe. - if (marked_empty()) + if (marked_empty()) { return false; + } // If the octagon is non-empty and zero-dimensional, // then it is necessarily the universe octagon. - if (space_dim == 0) + if (space_dim == 0) { return true; + } // An universe octagon can only contains trivial constraints. for (typename OR_Matrix::const_element_iterator i = matrix.element_begin(), matrix_element_end = matrix.element_end(); i != matrix_element_end; - ++i) - if (!is_plus_infinity(*i)) + ++i) { + if (!is_plus_infinity(*i)) { return false; + } + } return true; } @@ -70795,18 +72373,22 @@ Octagonal_Shape::is_bounded() const { strong_closure_assign(); // A zero-dimensional or empty octagon is bounded. - if (marked_empty() || space_dim == 0) + if (marked_empty() || space_dim == 0) { return true; + } // A bounded octagon never can contains trivial constraints. for (typename OR_Matrix::const_row_iterator i = matrix.row_begin(), matrix_row_end = matrix.row_end(); i != matrix_row_end; ++i) { typename OR_Matrix::const_row_reference_type x_i = *i; const dimension_type i_index = i.index(); - for (dimension_type j = i.row_size(); j-- > 0; ) - if (i_index != j) - if (is_plus_infinity(x_i[j])) + for (dimension_type j = i.row_size(); j-- > 0; ) { + if (i_index != j) { + if (is_plus_infinity(x_i[j])) { return false; + } + } + } } return true; @@ -70816,16 +72398,17 @@ bool Octagonal_Shape::contains_integer_point() const { // Force strong closure. - if (is_empty()) + if (is_empty()) { return false; - const dimension_type space_dim = space_dimension(); - if (space_dim == 0) + } + if (space_dim == 0) { return true; - + } // A strongly closed and consistent Octagonal_Shape defined by // integer constraints can only be empty due to tight coherence. - if (std::numeric_limits::is_integer) + if (std::numeric_limits::is_integer) { return !tight_coherence_would_make_empty(); + } // Build an integer Octagonal_Shape oct_z with bounds at least as // tight as those in *this and then recheck for emptiness, also @@ -70840,24 +72423,28 @@ z_i = oct_z.matrix.element_begin(), z_end = oct_z.matrix.element_end(); z_i != z_end; ++z_i, ++x_i) { const N& d = *x_i; - if (is_plus_infinity(d)) + if (is_plus_infinity(d)) { continue; - if (is_integer(d)) + } + if (is_integer(d)) { assign_r(*z_i, d, ROUND_NOT_NEEDED); + } else { all_integers = false; assign_r(*z_i, d, ROUND_DOWN); } } // Restore strong closure. - if (all_integers) + if (all_integers) { // oct_z unchanged, so it is still strongly closed. oct_z.set_strongly_closed(); + } else { // oct_z changed: recompute strong closure. oct_z.strong_closure_assign(); - if (oct_z.marked_empty()) + if (oct_z.marked_empty()) { return false; + } } return !oct_z.tight_coherence_would_make_empty(); } @@ -70867,10 +72454,10 @@ Octagonal_Shape::frequency(const Linear_Expression& expr, Coefficient& freq_n, Coefficient& freq_d, Coefficient& val_n, Coefficient& val_d) const { - dimension_type space_dim = space_dimension(); // The dimension of `expr' must be at most the dimension of *this. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("frequency(e, ...)", "e", expr); + } // Check if `expr' has a constant value. // If it is constant, set the frequency `freq_n' to 0 @@ -70880,8 +72467,9 @@ // Space dimension is 0: if empty, then return false; // otherwise the frequency is 0 and the value is the inhomogeneous term. if (space_dim == 0) { - if (is_empty()) + if (is_empty()) { return false; + } freq_n = 0; freq_d = 1; val_n = expr.inhomogeneous_term(); @@ -70891,8 +72479,9 @@ strong_closure_assign(); // For an empty Octagonal shape, we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; + } // The Octagonal shape has at least 1 dimension and is not empty. PPL_DIRTY_TEMP_COEFFICIENT(coeff); @@ -70950,9 +72539,10 @@ dimension_type j = j_iter.index(); const Variable vj(j/2); coeff_j = le.coefficient(vj); - if (coeff_j == 0) + if (coeff_j == 0) { // The coefficient in `le' is 0, so do nothing. continue; + } const dimension_type cj = coherent_index(j); const dimension_type cjj = coherent_index(j + 1); @@ -70994,14 +72584,16 @@ break; } } - if (!constant_v) + if (!constant_v) { // The expression `expr' is not constant. return false; + } } } - if (!constant_v) + if (!constant_v) { // The expression `expr' is not constant. return false; + } // The expression 'expr' is constant. freq_n = 0; @@ -71017,13 +72609,15 @@ Octagonal_Shape::constrains(const Variable var) const { // `var' should be one of the dimensions of the octagonal shape. const dimension_type var_space_dim = var.space_dimension(); - if (space_dimension() < var_space_dim) + if (space_dimension() < var_space_dim) { throw_dimension_incompatible("constrains(v)", "v", var); + } // An octagon known to be empty constrains all variables. // (Note: do not force emptiness check _yet_) - if (marked_empty()) + if (marked_empty()) { return true; + } // Check whether `var' is syntactically constrained. const dimension_type n_v = 2*(var_space_dim - 1); @@ -71031,15 +72625,17 @@ typename OR_Matrix::const_row_reference_type r_v = *m_iter; typename OR_Matrix::const_row_reference_type r_cv = *(++m_iter); for (dimension_type h = m_iter.row_size(); h-- > 0; ) { - if (!is_plus_infinity(r_v[h]) || !is_plus_infinity(r_cv[h])) + if (!is_plus_infinity(r_v[h]) || !is_plus_infinity(r_cv[h])) { return true; + } } ++m_iter; for (typename OR_Matrix::const_row_iterator m_end = matrix.row_end(); m_iter != m_end; ++m_iter) { typename OR_Matrix::const_row_reference_type r = *m_iter; - if (!is_plus_infinity(r[n_v]) || !is_plus_infinity(r[n_v + 1])) + if (!is_plus_infinity(r[n_v]) || !is_plus_infinity(r[n_v + 1])) { return true; + } } // `var' is not syntactically constrained: @@ -71066,7 +72662,7 @@ typename OR_Matrix::const_row_reference_type m_i = *iter; using namespace Implementation::Octagonal_Shapes; const N& m_i_ci = m_i[coherent_index(i)]; - for (dimension_type j = matrix.row_size(i); j-- > 0; ) + for (dimension_type j = matrix.row_size(i); j-- > 0; ) { // Note: on the main diagonal only PLUS_INFINITY can occur. if (i != j) { const N& m_cj_j = matrix[coherent_index(j)][j]; @@ -71076,10 +72672,12 @@ // rounding the result towards plus infinity. add_assign_r(semi_sum, m_i_ci, m_cj_j, ROUND_UP); div_2exp_assign_r(semi_sum, semi_sum, 1, ROUND_UP); - if (m_i[j] > semi_sum) + if (m_i[j] > semi_sum) { return false; + } } } + } } return true; } @@ -71090,8 +72688,9 @@ // This method is only used in assertions: efficiency is not a must. // An empty octagon is already transitively reduced. - if (marked_empty()) + if (marked_empty()) { return true; + } Octagonal_Shape x = *this; // The matrix representing an OS is strongly reduced if, by removing @@ -71104,8 +72703,9 @@ if (!is_plus_infinity(m_i[j])) { Octagonal_Shape x_copy = *this; assign_r(x_copy.matrix[i][j], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (x == x_copy) + if (x == x_copy) { return false; + } } } } @@ -71120,15 +72720,17 @@ // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((from_above ? "bounds_from_above(e)" : "bounds_from_below(e)"), "e", expr); + } strong_closure_assign(); // A zero-dimensional or empty octagon bounds everything. - if (space_dim == 0 || marked_empty()) + if (space_dim == 0 || marked_empty()) { return true; + } // The constraint `c' is used to check if `expr' is an octagonal difference // and, in this case, to select the cell. @@ -71141,8 +72743,9 @@ if (Octagonal_Shape_Helper ::extract_octagonal_difference(c, c.space_dimension(), num_vars, i, j, coeff, term)) { - if (num_vars == 0) + if (num_vars == 0) { return true; + } // Select the cell to be checked. typename OR_Matrix::const_row_iterator i_iter = matrix.row_begin() + i; typename OR_Matrix::const_row_reference_type m_i = *i_iter; @@ -71166,14 +72769,16 @@ // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } // Deal with zero-dim octagons first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -71184,8 +72789,9 @@ strong_closure_assign(); // For an empty OS we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; + } // The constraint `c' is used to check if `expr' is an octagonal difference // and, in this case, to select the cell. @@ -71206,9 +72812,10 @@ included = true; return true; } - else + else { // Here`expr' is unbounded in `*this'. return false; + } } else { // `c' is an octagonal constraint. @@ -71234,8 +72841,9 @@ PPL_DIRTY_TEMP(N, coeff_expr); const Coefficient& coeff_i = expr.coefficient(Variable(i/2)); const int sign_i = sgn(coeff_i); - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_expr, coeff_i, ROUND_UP); + } else { PPL_DIRTY_TEMP_COEFFICIENT(minus_coeff_i); neg_assign(minus_coeff_i, coeff_i); @@ -71247,11 +72855,13 @@ div_2exp_assign_r(m_i_j, m_i[j], 1, ROUND_UP); add_mul_assign_r(d, coeff_expr, m_i_j, ROUND_UP); } - else + else { add_mul_assign_r(d, coeff_expr, m_i[j], ROUND_UP); + } numer_denom(d, ext_n, ext_d); - if (!maximize) + if (!maximize) { neg_assign(ext_n); + } included = true; return true; } @@ -71270,14 +72880,16 @@ // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } // Deal with zero-dim octagons first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -71289,8 +72901,9 @@ strong_closure_assign(); // For an empty OS we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; + } if (!is_universe()) { // We use MIP_Problems to handle constraints that are not // octagonal difference. @@ -71313,8 +72926,9 @@ dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dim) + if (cg_space_dim > space_dim) { throw_dimension_incompatible("relation_with(cg)", cg); + } // If the congruence is an equality, // find the relation with the equivalent equality constraint. @@ -71325,17 +72939,20 @@ strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } } // Find the lower bound for a hyperplane with direction @@ -71348,8 +72965,9 @@ // If there is no lower bound, then some of the hyperplanes defined by // the congruence will strictly intersect the shape. - if (!bounded_below) + if (!bounded_below) { return Poly_Con_Relation::strictly_intersects(); + } // TODO: Consider adding a max_and_min() method, performing both // maximization and minimization so as to possibly exploit @@ -71364,8 +72982,9 @@ // If there is no upper bound, then some of the hyperplanes defined by // the congruence will strictly intersect the shape. - if (!bounded_above) + if (!bounded_above) { return Poly_Con_Relation::strictly_intersects(); + } PPL_DIRTY_TEMP_COEFFICIENT(signed_distance); @@ -71376,8 +72995,9 @@ const Coefficient& modulus = cg.modulus(); signed_distance = min_value % modulus; min_value -= signed_distance; - if (min_value * min_denom < min_numer) + if (min_value * min_denom < min_numer) { min_value += modulus; + } // Find the position value for the hyperplane that satisfies the congruence // and is below the upper bound for the shape. @@ -71385,16 +73005,19 @@ max_value = max_numer / max_denom; signed_distance = max_value % modulus; max_value += signed_distance; - if (max_value * max_denom > max_numer) + if (max_value * max_denom > max_numer) { max_value -= modulus; + } // If the upper bound value is less than the lower bound value, // then there is an empty intersection with the congruence; // otherwise it will strictly intersect. - if (max_value < min_value) + if (max_value < min_value) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } } template @@ -71403,37 +73026,43 @@ dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dim) + if (c_space_dim > space_dim) { throw_dimension_incompatible("relation_with(c)", c); + } // The closure needs to make explicit the implicit constraints. strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { // Trivially false zero-dimensional constraint. if ((c.is_equality() && c.inhomogeneous_term() != 0) - || (c.is_inequality() && c.inhomogeneous_term() < 0)) + || (c.is_inequality() && c.inhomogeneous_term() < 0)) { return Poly_Con_Relation::is_disjoint(); - else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) + } + else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) { // The constraint 0 > 0 implicitly defines the hyperplane 0 = 0; // thus, the zero-dimensional point also saturates it. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); + } // Trivially true zero-dimensional constraint. - else if (c.is_equality() || c.inhomogeneous_term() == 0) + else if (c.is_equality() || c.inhomogeneous_term() == 0) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); - else + } + else { // The zero-dimensional point saturates // neither the positivity constraint 1 >= 0, // nor the strict positivity constraint 1 > 0. return Poly_Con_Relation::is_included(); + } } dimension_type num_vars = 0; @@ -71455,26 +73084,29 @@ le.linear_combine(c.expr, Coefficient_one(), Coefficient_one(), 1, c_space_dim + 1); - PPL_DIRTY_TEMP(Coefficient, max_numer); - PPL_DIRTY_TEMP(Coefficient, max_denom); + PPL_DIRTY_TEMP_COEFFICIENT(max_numer); + PPL_DIRTY_TEMP_COEFFICIENT(max_denom); bool max_included; - PPL_DIRTY_TEMP(Coefficient, min_numer); - PPL_DIRTY_TEMP(Coefficient, min_denom); + PPL_DIRTY_TEMP_COEFFICIENT(min_numer); + PPL_DIRTY_TEMP_COEFFICIENT(min_denom); bool min_included; bool bounded_above = maximize(le, max_numer, max_denom, max_included); bool bounded_below = minimize(le, min_numer, min_denom, min_included); if (!bounded_above) { - if (!bounded_below) + if (!bounded_below) { return Poly_Con_Relation::strictly_intersects(); + } min_numer += c.inhomogeneous_term() * min_denom; switch (sgn(min_numer)) { case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::is_included(); case 0: - if (c.is_strict_inequality() || c.is_equality()) + if (c.is_strict_inequality() || c.is_equality()) { return Poly_Con_Relation::strictly_intersects(); + } return Poly_Con_Relation::is_included(); case -1: return Poly_Con_Relation::strictly_intersects(); @@ -71486,8 +73118,9 @@ case 1: return Poly_Con_Relation::strictly_intersects(); case 0: - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::strictly_intersects(); case -1: return Poly_Con_Relation::is_disjoint(); @@ -71500,14 +73133,17 @@ case 1: switch (sgn(min_numer)) { case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::is_included(); case 0: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::strictly_intersects(); - if (c.is_strict_inequality()) + } + if (c.is_strict_inequality()) { return Poly_Con_Relation::strictly_intersects(); + } return Poly_Con_Relation::is_included(); case -1: return Poly_Con_Relation::strictly_intersects(); @@ -71516,14 +73152,16 @@ break; case 0: if (min_numer == 0) { - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint() && Poly_Con_Relation::saturates(); + } return Poly_Con_Relation::is_included() && Poly_Con_Relation::saturates(); } - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::strictly_intersects(); case -1: return Poly_Con_Relation::is_disjoint(); @@ -71537,17 +73175,21 @@ case -1: return Poly_Con_Relation::is_disjoint(); case 0: - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::is_included(); + } } } @@ -71556,15 +73198,18 @@ typename OR_Matrix::const_row_reference_type m_i = *i_iter; const N& m_i_j = m_i[j]; // Set `coeff' to the absolute value of itself. - if (coeff < 0) + if (coeff < 0) { neg_assign(coeff); + } // Select the cell to be checked for the ">=" part of constraint. // Select the right row of the cell. - if (i % 2 == 0) + if (i % 2 == 0) { ++i_iter; - else + } + else { --i_iter; + } typename OR_Matrix::const_row_reference_type m_ci = *i_iter; using namespace Implementation::Octagonal_Shapes; const N& m_ci_cj = m_ci[coherent_index(j)]; @@ -71596,10 +73241,12 @@ assign_r(q_denom, denom, ROUND_NOT_NEEDED); assign_r(q_y, numer, ROUND_NOT_NEEDED); div_assign_r(q_y, q_y, q_denom, ROUND_NOT_NEEDED); - if (q_y < d1) + if (q_y < d1) { return Poly_Con_Relation::is_disjoint(); - if (q_y == d1 && c.is_strict_inequality()) + } + if (q_y == d1 && c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } } // In all other cases `*this' intersects `c'. @@ -71618,34 +73265,40 @@ assign_r(q_y, numer, ROUND_NOT_NEEDED); div_assign_r(q_y, q_y, q_denom, ROUND_NOT_NEEDED); if (q_x == d && q_y == d1) { - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } } // `*this' is disjoint from `c' when // `m_ci_cj < d1' (`m_ci_cj <= d1' if `c' is a strict inequality). - if (q_y < d1) + if (q_y < d1) { return Poly_Con_Relation::is_disjoint(); - if (q_y == d1 && c.is_strict_inequality()) + } + if (q_y == d1 && c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } } // Here `m_ci_cj' can be also plus-infinity. // If `c' is an equality, `*this' is disjoint from `c' if // `m_i_j < d'. if (d > q_x) { - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::is_included(); + } } - if (d == q_x && c.is_nonstrict_inequality()) + if (d == q_x && c.is_nonstrict_inequality()) { return Poly_Con_Relation::is_included(); - + } // In all other cases `*this' intersects `c'. return Poly_Con_Relation::strictly_intersects(); } @@ -71656,21 +73309,24 @@ const dimension_type g_space_dim = g.space_dimension(); // Dimension-compatibility check. - if (space_dim < g_space_dim) + if (space_dim < g_space_dim) { throw_dimension_incompatible("relation_with(g)", g); + } // The closure needs to make explicit the implicit constraints and if the // octagon is empty. strong_closure_assign(); // The empty octagon cannot subsume a generator. - if (marked_empty()) + if (marked_empty()) { return Poly_Gen_Relation::nothing(); + } // A universe octagon in a zero-dimensional space subsumes // all the generators of a zero-dimensional space. - if (space_dim == 0) + if (space_dim == 0) { return Poly_Gen_Relation::subsumes(); + } const bool is_line = g.is_line(); const bool is_line_or_ray = g.is_line_or_ray(); @@ -71718,8 +73374,9 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (product != 0) + if (product != 0) { return Poly_Gen_Relation::nothing(); + } } // We have 0, 1 or 2 inequality constraints. else { @@ -71736,15 +73393,17 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); + } else // If the generator is not a line it's necessary to check // that the scalar product sign is not positive and the scalar // product has the form // '-denom * g.coeff_x - numer * g.divisor()'. - if (product > 0) + if (product > 0) { return Poly_Gen_Relation::nothing(); + } } if (!is_plus_infinity(m_ii_i)) { // The constraint has form ax <= b. @@ -71757,15 +73416,18 @@ neg_assign(numer); add_mul_assign(product, numer , g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); - else + } + else { // If the generator is not a line it's necessary to check // that the scalar product sign is not positive and the scalar // product has the form // 'denom * g_coeff_x - numer * g.divisor()'. - if (product > 0) + if (product > 0) { return Poly_Gen_Relation::nothing(); + } + } } } } @@ -71808,8 +73470,9 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (product != 0) + if (product != 0) { return Poly_Gen_Relation::nothing(); + } } else { if (!is_plus_infinity(m_i_j)) { @@ -71828,10 +73491,12 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); - else if (product > 0) + } + else if (product > 0) { return Poly_Gen_Relation::nothing(); + } } if (!is_plus_infinity(m_ii_jj)) { // The constraint has form -a*x + a*y <= b. @@ -71849,10 +73514,12 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); - else if (product > 0) + } + else if (product > 0) { return Poly_Gen_Relation::nothing(); + } } } @@ -71872,8 +73539,9 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (product != 0) + if (product != 0) { return Poly_Gen_Relation::nothing(); + } } else { if (!is_plus_infinity(m_i_jj)) { @@ -71892,10 +73560,12 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); - else if (product > 0) + } + else if (product > 0) { return Poly_Gen_Relation::nothing(); + } } if (!is_plus_infinity(m_ii_j)) { // The constraint has form a*x + a*y <= b. @@ -71912,10 +73582,12 @@ neg_assign(numer); add_mul_assign(product, numer, g.divisor()); } - if (is_line && product != 0) + if (is_line && product != 0) { return Poly_Gen_Relation::nothing(); - else if (product > 0) + } + else if (product > 0) { return Poly_Gen_Relation::nothing(); + } } } } @@ -71929,9 +73601,9 @@ void Octagonal_Shape::strong_closure_assign() const { // Do something only if necessary (zero-dim implies strong closure). - if (marked_empty() || marked_strongly_closed() || space_dim == 0) + if (marked_empty() || marked_strongly_closed() || space_dim == 0) { return; - + } // Even though the octagon will not change, its internal representation // is going to be modified by the closure algorithm. Octagonal_Shape& x = const_cast&>(*this); @@ -72085,8 +73757,9 @@ using namespace Implementation::Octagonal_Shapes; const N& x_i_ci = x_i[coherent_index(i)]; // Avoid to do unnecessary sums. - if (!is_plus_infinity(x_i_ci)) - for (dimension_type j = 0, rs_i = i_iter.row_size(); j < rs_i; ++j) + if (!is_plus_infinity(x_i_ci)) { + for (dimension_type j = 0, rs_i = i_iter.row_size(); + j < rs_i; ++j) { if (i != j) { const N& x_cj_j = matrix[coherent_index(j)][j]; if (!is_plus_infinity(x_cj_j)) { @@ -72095,6 +73768,8 @@ min_assign(x_i[j], semi_sum); } } + } + } } } @@ -72103,7 +73778,6 @@ Octagonal_Shape::tight_coherence_would_make_empty() const { PPL_ASSERT(std::numeric_limits::is_integer); PPL_ASSERT(marked_strongly_closed()); - const dimension_type space_dim = space_dimension(); for (dimension_type i = 0; i < 2*space_dim; i += 2) { const dimension_type ci = i + 1; const N& mat_i_ci = matrix[i][ci]; @@ -72111,8 +73785,9 @@ // Check for oddness of `mat_i_ci'. && !is_even(mat_i_ci) // Check for zero-equivalence of `i' and `ci'. - && is_additive_inverse(mat_i_ci, matrix[ci][i])) + && is_additive_inverse(mat_i_ci, matrix[ci][i])) { return true; + } } return false; } @@ -72126,23 +73801,26 @@ // FIXME: this is just an executable specification. // (The following call could be replaced by shortest-path closure.) strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - if (tight_coherence_would_make_empty()) + } + if (tight_coherence_would_make_empty()) { set_empty(); + } else { // Tighten the unary constraints. PPL_DIRTY_TEMP(N, temp_one); assign_r(temp_one, 1, ROUND_NOT_NEEDED); - const dimension_type space_dim = space_dimension(); for (dimension_type i = 0; i < 2*space_dim; i += 2) { const dimension_type ci = i + 1; N& mat_i_ci = matrix[i][ci]; - if (!is_plus_infinity(mat_i_ci) && !is_even(mat_i_ci)) + if (!is_plus_infinity(mat_i_ci) && !is_even(mat_i_ci)) { sub_assign_r(mat_i_ci, mat_i_ci, temp_one, ROUND_UP); + } N& mat_ci_i = matrix[ci][i]; - if (!is_plus_infinity(mat_ci_i) && !is_even(mat_ci_i)) + if (!is_plus_infinity(mat_ci_i) && !is_even(mat_ci_i)) { sub_assign_r(mat_ci_i, mat_ci_i, temp_one, ROUND_UP); + } } // Propagate tightened unary constraints. strong_coherence_assign(); @@ -72155,13 +73833,15 @@ Octagonal_Shape ::incremental_strong_closure_assign(const Variable var) const { // `var' should be one of the dimensions of the octagon. - if (var.id() >= space_dim) + if (var.id() >= space_dim) { throw_dimension_incompatible("incremental_strong_closure_assign(v)", var.id()); + } // Do something only if necessary. - if (marked_empty() || marked_strongly_closed()) + if (marked_empty() || marked_strongly_closed()) { return; + } Octagonal_Shape& x = const_cast&>(*this); @@ -72303,8 +73983,9 @@ const dimension_type successor_size = matrix.num_rows(); // Initially, each variable is successor of its own zero-equivalence class. successor.reserve(successor_size); - for (dimension_type i = 0; i < successor_size; ++i) + for (dimension_type i = 0; i < successor_size; ++i) { successor.push_back(i); + } // Now compute actual successors. for (dimension_type i = successor_size; i-- > 0; ) { typename OR_Matrix::const_row_iterator i_iter = matrix.row_begin() + i; @@ -72316,9 +73997,10 @@ //for (dimension_type j = i; j-- > 0; ) { using namespace Implementation::Octagonal_Shapes; dimension_type cj = coherent_index(j); - if (is_additive_inverse(m_ci[cj], m_i[j])) + if (is_additive_inverse(m_ci[cj], m_i[j])) { // Choose as successor the variable having the greatest index. successor[j] = i; + } } } } @@ -72335,8 +74017,9 @@ const dimension_type leader_size = matrix.num_rows(); // Initially, each variable is leader of its own zero-equivalence class. leaders.reserve(leader_size); - for (dimension_type i = 0; i < leader_size; ++i) + for (dimension_type i = 0; i < leader_size; ++i) { leaders.push_back(i); + } // Now compute actual leaders. for (typename OR_Matrix::const_row_iterator i_iter = matrix.row_begin(), matrix_row_end = matrix.row_end(); @@ -72348,9 +74031,10 @@ for (dimension_type j = 0; j < i; ++j) { using namespace Implementation::Octagonal_Shapes; dimension_type cj = coherent_index(j); - if (is_additive_inverse(m_ci[cj], m_i[j])) + if (is_additive_inverse(m_ci[cj], m_i[j])) { // Choose as leader the variable having the smaller index. leaders[i] = leaders[j]; + } } } } @@ -72376,8 +74060,9 @@ exist_sing_class = true; sing_leader = i; } - else + else { no_sing_leaders.push_back(i); + } } // The following index is not a leader. dealt_with[next_i] = true; @@ -72388,13 +74073,14 @@ void Octagonal_Shape::strong_reduction_assign() const { // Zero-dimensional octagonal shapes are necessarily reduced. - if (space_dim == 0) + if (space_dim == 0) { return; + } strong_closure_assign(); // If `*this' is empty, then there is nothing to reduce. - if (marked_empty()) + if (marked_empty()) { return; - + } // Detect non-redundant constraints. std::vector non_red; non_redundant_matrix_entries(non_red); @@ -72409,8 +74095,9 @@ const Bit_Row& non_red_i = non_red[i]; for (dimension_type j = 0, j_end = OR_Matrix::row_size(i); j < j_end; ++j, ++x_i) { - if (!non_red_i[j]) + if (!non_red_i[j]) { assign_r(*x_i, PLUS_INFINITY, ROUND_NOT_NEEDED); + } } } x.reset_strongly_closed(); @@ -72489,9 +74176,10 @@ if (j != ci) { add_assign_r(tmp, m_i_ci, matrix[cj][j], ROUND_UP); div_2exp_assign_r(tmp, tmp, 1, ROUND_UP); - if (m_i_j >= tmp) + if (m_i_j >= tmp) { // The constraint is redundant. continue; + } } // Control if the constraint is redundant by strong closure, that is // if there is a path from i to j (i = i_0, ... , i_n = j), such that @@ -72507,16 +74195,18 @@ const dimension_type k = no_sing_leaders[lk]; if (k != i && k != j) { dimension_type ck = coherent_index(k); - if (k < j) + if (k < j) { // Case 1. add_assign_r(tmp, m_i[k], matrix[cj][ck], ROUND_UP); - else if (k < i) + } + else if (k < i) { // Case 2. add_assign_r(tmp, m_i[k], matrix[k][j], ROUND_UP); - else + } + else { // Case 3. add_assign_r(tmp, matrix[ck][ci], matrix[k][j], ROUND_UP); - + } // Checks if the constraint is redundant. if (m_i_j >= tmp) { to_add = false; @@ -72525,9 +74215,10 @@ } } - if (to_add) + if (to_add) { // The constraint is not redundant. non_redundant[i].set(j); + } } } @@ -72547,8 +74238,9 @@ } non_redundant[j + 1].set(j); } - else + else { non_redundant[sing_leader + 1].set(sing_leader); + } } } @@ -72556,13 +74248,15 @@ void Octagonal_Shape::upper_bound_assign(const Octagonal_Shape& y) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("upper_bound_assign(y)", y); + } // The hull of an octagon `x' with an empty octagon is `x'. y.strong_closure_assign(); - if (y.marked_empty()) + if (y.marked_empty()) { return; + } strong_closure_assign(); if (marked_empty()) { *this = y; @@ -72573,8 +74267,9 @@ typename OR_Matrix::const_element_iterator j = y.matrix.element_begin(); for (typename OR_Matrix::element_iterator i = matrix.element_begin(), matrix_element_end = matrix.element_end(); - i != matrix_element_end; ++i, ++j) + i != matrix_element_end; ++i, ++j) { max_assign(*i, *j); + } // The result is still closed. PPL_ASSERT(OK()); @@ -72584,8 +74279,9 @@ void Octagonal_Shape::difference_assign(const Octagonal_Shape& y) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("difference_assign(y)", y); + } Octagonal_Shape& x = *this; @@ -72593,12 +74289,13 @@ // We close. x.strong_closure_assign(); // The difference of an empty octagon and of an octagon `p' is empty. - if (x.marked_empty()) + if (x.marked_empty()) { return; + } // The difference of a octagon `p' and an empty octagon is `p'. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } // If both octagons are zero-dimensional, // then at this point they are necessarily universe octagons, // so that their difference is empty. @@ -72626,18 +74323,21 @@ // then `c' _must_ be skipped, as adding its complement to `x' // would result in the empty octagon, and as we would obtain // a result that is less precise than the difference. - if (x.relation_with(c).implies(Poly_Con_Relation::is_included())) + if (x.relation_with(c).implies(Poly_Con_Relation::is_included())) { continue; + } Octagonal_Shape z = x; const Linear_Expression e(c.expression()); z.add_constraint(e <= 0); - if (!z.is_empty()) + if (!z.is_empty()) { new_oct.upper_bound_assign(z); + } if (c.is_equality()) { z = x; z.add_constraint(e >= 0); - if (!z.is_empty()) + if (!z.is_empty()) { new_oct.upper_bound_assign(z); + } } } *this = new_oct; @@ -72650,8 +74350,9 @@ Octagonal_Shape& x = *this; const dimension_type dim = x.space_dimension(); // Dimension-compatibility check. - if (dim != y.space_dimension()) + if (dim != y.space_dimension()) { throw_dimension_incompatible("simplify_using_context_assign(y)", y); + } // Filter away the zero-dimensional case. if (dim == 0) { @@ -72659,8 +74360,9 @@ x.set_zero_dim_univ(); return false; } - else + else { return !x.marked_empty(); + } } // Filter away the case where `x' contains `y' @@ -72671,11 +74373,6 @@ return false; } - typedef typename OR_Matrix::row_iterator Row_Iter; - typedef typename OR_Matrix::const_row_iterator Row_CIter; - typedef typename OR_Matrix::element_iterator Elem_Iter; - typedef typename OR_Matrix::const_element_iterator Elem_CIter; - // Filter away the case where `x' is empty. x.strong_closure_assign(); if (x.marked_empty()) { @@ -72701,12 +74398,14 @@ } // Then search binary constraints. // TODO: use better iteration scheme. - for (i = 2; i < 2*dim; ++i) + for (i = 2; i < 2*dim; ++i) { for (j = 0; j < i; ++j) { // Use something like !is_maximal()? - if (!is_plus_infinity(y.matrix_at(i, j))) + if (!is_plus_infinity(y.matrix_at(i, j))) { goto found; + } } + } // Not found: we were not able to build a constraint contradicting // one of the constraints in `y': `x' cannot be enlarged. @@ -72740,8 +74439,9 @@ x.non_redundant_matrix_entries(x_non_redundant); // ... count the non-redundant constraints. dimension_type x_num_non_redundant = 0; - for (size_t i = x_non_redundant.size(); i-- > 0 ; ) + for (size_t i = x_non_redundant.size(); i-- > 0 ; ) { x_num_non_redundant += x_non_redundant[i].count_ones(); + } PPL_ASSERT(x_num_non_redundant > 0); // Let `yy' be a copy of `y': we will keep adding to `yy' @@ -72765,16 +74465,18 @@ if (sing_leader == x_leaders[sing_leader]) { const N& x_s_ss = x.matrix_at(sing_leader, sing_leader + 1); const N& x_ss_s = x.matrix_at(sing_leader + 1, sing_leader); - if (is_additive_inverse(x_s_ss, x_ss_s)) + if (is_additive_inverse(x_s_ss, x_ss_s)) { // Singular leader found. break; + } } } // Unary equalities have `sing_leader' as a leader. for (dimension_type i = sing_leader; i < 2*dim; i += 2) { - if (x_leaders[i] != sing_leader) + if (x_leaders[i] != sing_leader) { continue; + } // Found a unary equality constraint: // see if any of the two inequalities have to be added. const N& x_i_ii = x.matrix_at(i, i + 1); @@ -72815,8 +74517,9 @@ // Go through the binary equality constraints. for (dimension_type i = 0; i < 2*dim; ++i) { const dimension_type j = x_leaders[i]; - if (j == i || j == sing_leader) + if (j == i || j == sing_leader) { continue; + } const N& x_i_j = x.matrix_at(i, j); PPL_ASSERT(!is_plus_infinity(x_i_j)); N& yy_i_j = yy.matrix_at(i, j); @@ -72856,18 +74559,22 @@ // both indices i and j should be leaders. // FIXME: improve iteration scheme (are we doing twice the work?) for (dimension_type i = 0; i < 2*dim; ++i) { - if (i != x_leaders[i]) + if (i != x_leaders[i]) { continue; + } const Bit_Row& x_non_redundant_i = x_non_redundant[i]; for (dimension_type j = 0; j < 2*dim; ++j) { - if (j != x_leaders[j]) + if (j != x_leaders[j]) { continue; + } if (i >= j) { - if (!x_non_redundant_i[j]) + if (!x_non_redundant_i[j]) { continue; + } } - else if (!x_non_redundant[j][i]) + else if (!x_non_redundant[j][i]) { continue; + } N& yy_i_j = yy.matrix_at(i, j); const N& x_i_j = x.matrix_at(i, j); if (x_i_j < yy_i_j) { @@ -72898,8 +74605,9 @@ void Octagonal_Shape::add_space_dimensions_and_embed(dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; + } const dimension_type new_dim = space_dim + m; const bool was_zero_dim_univ = !marked_empty() && space_dim == 0; @@ -72910,8 +74618,9 @@ space_dim = new_dim; // If `*this' was the zero-dim space universe octagon, // then we can set the strongly closure flag. - if (was_zero_dim_univ) + if (was_zero_dim_univ) { set_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -72920,8 +74629,9 @@ void Octagonal_Shape::add_space_dimensions_and_project(dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; + } const dimension_type n = matrix.num_rows(); @@ -72939,8 +74649,9 @@ assign_r(x_ci[ind], 0, ROUND_NOT_NEEDED); } - if (marked_strongly_closed()) + if (marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -72957,8 +74668,9 @@ // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dim < min_space_dim) + if (space_dim < min_space_dim) { throw_dimension_incompatible("remove_space_dimensions(vs)", min_space_dim); + } const dimension_type new_space_dim = space_dim - vars.size(); @@ -72967,9 +74679,10 @@ // we obtain the zero-dimensional octagon. if (new_space_dim == 0) { matrix.shrink(0); - if (!marked_empty()) + if (!marked_empty()) { // We set the zero_dim_univ flag. set_zero_dim_univ(); + } space_dim = 0; PPL_ASSERT(OK()); return; @@ -72994,16 +74707,18 @@ // row of variable(j), then we shift the cells corresponding to the // second row. We recall that every variable is represented // in the `matrix' by two rows and two columns. - for (dimension_type j = 0; j <= i; ++j) + for (dimension_type j = 0; j <= i; ++j) { if (vars.count(j) == 0) { assign_or_swap(*(iter++), row_ref[2*j]); assign_or_swap(*(iter++), row_ref[2*j + 1]); } - for (dimension_type j = 0; j <= i; ++j) + } + for (dimension_type j = 0; j <= i; ++j) { if (vars.count(j) == 0) { assign_or_swap(*(iter++), row_ref1[2*j]); assign_or_swap(*(iter++), row_ref1[2*j + 1]); } + } } } // Update the space dimension. @@ -73016,8 +74731,9 @@ template void Octagonal_Shape::map_space_dimensions(const Partial_Function& pfunc) { - if (space_dim == 0) + if (space_dim == 0) { return; + } if (pfunc.has_empty_codomain()) { // All dimensions vanish: the octagon becomes zero_dimensional. @@ -73028,9 +74744,9 @@ const dimension_type new_space_dim = pfunc.max_in_codomain() + 1; // If we are going to actually reduce the space dimension, // then shortest-path closure is required to keep precision. - if (new_space_dim < space_dim) + if (new_space_dim < space_dim) { strong_closure_assign(); - + } // If the octagon is empty, then it is sufficient to adjust // the space dimension of the octagon. if (marked_empty()) { @@ -73101,12 +74817,14 @@ void Octagonal_Shape::intersection_assign(const Octagonal_Shape& y) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("intersection_assign(y)", y); + } // If one of the two octagons is empty, the intersection is empty. - if (marked_empty()) + if (marked_empty()) { return; + } if (y.marked_empty()) { set_empty(); return; @@ -73114,9 +74832,9 @@ // If both octagons are zero-dimensional,then at this point // they are necessarily non-empty, // so that their intersection is non-empty too. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // To intersect two octagons we compare the constraints // and we choose the less values. bool changed = false; @@ -73135,8 +74853,9 @@ } // This method not preserve the closure. - if (changed && marked_strongly_closed()) + if (changed && marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -73147,33 +74866,38 @@ Iterator first, Iterator last, unsigned* tp) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("CC76_extrapolation_assign(y)", y); + } // Assume `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If both octagons are zero-dimensional, // since `*this' contains `y', we simply return `*this'. - if (space_dim == 0) + if (space_dim == 0) { return; + } strong_closure_assign(); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } y.strong_closure_assign(); // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } // If there are tokens available, work on a temporary copy. if (tp != 0 && *tp > 0) { Octagonal_Shape x_tmp(*this); x_tmp.CC76_extrapolation_assign(y, first, last, 0); // If the widening was not precise, use one of the available tokens. - if (!contains(x_tmp)) + if (!contains(x_tmp)) { --(*tp); + } return; } @@ -73195,11 +74919,13 @@ if (y_elem < elem) { Iterator k = std::lower_bound(first, last, elem); if (k != last) { - if (elem < *k) + if (elem < *k) { assign_r(elem, *k, ROUND_UP); + } } - else + else { assign_r(elem, PLUS_INFINITY, ROUND_NOT_NEEDED); + } } } @@ -73233,8 +74959,9 @@ // Constraints that are not octagonal differences are ignored. if (!Octagonal_Shape_Helper ::extract_octagonal_difference(c, cs_space_dim, num_vars, i, j, - coeff, term)) + coeff, term)) { continue; + } typedef typename OR_Matrix::const_row_iterator Row_iterator; typedef typename OR_Matrix::const_row_reference_type Row_reference; @@ -73248,11 +74975,12 @@ row_iterator lo_iter = lo_mat.row_begin() + i; row_reference lo_m_i = *lo_iter; N& lo_m_i_j = lo_m_i[j]; - if (coeff < 0) + if (coeff < 0) { neg_assign(coeff); + } // Compute the bound for `m_i_j', rounding towards plus infinity. div_round_up(d, term, coeff); - if (m_i[j] <= d) + if (m_i[j] <= d) { if (c.is_inequality()) { if (lo_m_i_j > d) { lo_m_i_j = d; @@ -73282,11 +75010,13 @@ } } } + } } // In general, adding a constraint does not preserve the strongly // closure of the octagon. - if (is_oct_changed && limiting_octagon.marked_strongly_closed()) + if (is_oct_changed && limiting_octagon.marked_strongly_closed()) { limiting_octagon.reset_strongly_closed(); + } } template @@ -73297,33 +75027,40 @@ unsigned* tp) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("limited_CC76_extrapolation_assign(y, cs)", y); + } // `cs' must be dimension-compatible with the two octagons. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_constraint_incompatible("limited_CC76_extrapolation_assign(y, cs)"); + } // Strict inequalities not allowed. - if (cs.has_strict_inequalities()) + if (cs.has_strict_inequalities()) { throw_constraint_incompatible("limited_CC76_extrapolation_assign(y, cs)"); + } // The limited CC76-extrapolation between two octagons in a // zero-dimensional space is a octagon in a zero-dimensional // space, too. - if (space_dim == 0) + if (space_dim == 0) { return; + } // Assume `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } + // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } Octagonal_Shape limiting_octagon(space_dim, UNIVERSE); get_limiting_octagon(cs, limiting_octagon); @@ -73336,8 +75073,9 @@ Octagonal_Shape::BHMZ05_widening_assign(const Octagonal_Shape& y, unsigned* tp) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("BHMZ05_widening_assign(y)", y); + } // Assume `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); @@ -73347,23 +75085,25 @@ // If the affine dimension of `y' is zero, then either `y' is // zero-dimensional, or it is empty, or it is a singleton. // In all cases, due to the inclusion hypothesis, the result is `*this'. - if (y_affine_dim == 0) + if (y_affine_dim == 0) { return; + } // If the affine dimension has changed, due to the inclusion hypothesis, // the result is `*this'. const dimension_type x_affine_dim = affine_dimension(); PPL_ASSERT(x_affine_dim >= y_affine_dim); - if (x_affine_dim != y_affine_dim) + if (x_affine_dim != y_affine_dim) { return; - + } // If there are tokens available, work on a temporary copy. if (tp != 0 && *tp > 0) { Octagonal_Shape x_tmp(*this); x_tmp.BHMZ05_widening_assign(y, 0); // If the widening was not precise, use one of the available tokens. - if (!contains(x_tmp)) + if (!contains(x_tmp)) { --(*tp); + } return; } @@ -73382,8 +75122,9 @@ // Note: in the following line the use of `!=' (as opposed to // the use of `<' that would seem -but is not- equivalent) is // intentional. - if (*j != elem) + if (*j != elem) { assign_r(elem, PLUS_INFINITY, ROUND_NOT_NEEDED); + } } reset_strongly_closed(); PPL_ASSERT(OK()); @@ -73397,33 +75138,40 @@ unsigned* tp) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("limited_BHMZ05_extrapolation_assign(y, cs)", y); + } + // `cs' must be dimension-compatible with the two octagons. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_constraint_incompatible("limited_CH78_extrapolation_assign(y, cs)"); + } // Strict inequalities not allowed. - if (cs.has_strict_inequalities()) + if (cs.has_strict_inequalities()) { throw_constraint_incompatible("limited_CH78_extrapolation_assign(y, cs)"); + } // The limited BHMZ05-extrapolation between two octagons in a // zero-dimensional space is a octagon in a zero-dimensional // space, too. - if (space_dim == 0) + if (space_dim == 0) { return; + } // Assume `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } Octagonal_Shape limiting_octagon(space_dim, UNIVERSE); get_limiting_octagon(cs, limiting_octagon); @@ -73435,25 +75183,30 @@ void Octagonal_Shape::CC76_narrowing_assign(const Octagonal_Shape& y) { // Dimension-compatibility check. - if (space_dim != y.space_dim) + if (space_dim != y.space_dim) { throw_dimension_incompatible("CC76_narrowing_assign(y)", y); + } // Assume `*this' is contained in or equal to `y'. PPL_EXPECT_HEAVY(copy_contains(y, *this)); // If both octagons are zero-dimensional, since `*this' contains `y', // we simply return '*this'. - if (space_dim == 0) + if (space_dim == 0) { return; + } y.strong_closure_assign(); // If `y' is empty, since `y' contains `*this', `*this' is empty too. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } + strong_closure_assign(); // If `*this' is empty, we return. - if (marked_empty()) + if (marked_empty()) { return; + } // We consider a constraint of `*this', if its value is `plus_infinity', // we take the value of the corresponding constraint of `y'. @@ -73471,8 +75224,9 @@ } } - if (is_oct_changed && marked_strongly_closed()) + if (is_oct_changed && marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -73509,8 +75263,9 @@ u_end = sc_expr.lower_bound(Variable(last_id + 1)); u != u_end; ++u) { const dimension_type u_id = u.variable().id(); // Skip the case when `u_id == v_id'. - if (u_id == v_id) + if (u_id == v_id) { continue; + } const Coefficient& expr_u = *u; const dimension_type n_u = u_id*2; @@ -73625,8 +75380,9 @@ u_end = sc_expr.lower_bound(Variable(last_id + 1)); u != u_end; ++u) { const dimension_type u_id = u.variable().id(); // Skip the case when `u_id == v_id'. - if (u_id == v_id) + if (u_id == v_id) { continue; + } const Coefficient& expr_u = *u; const dimension_type n_u = u_id*2; @@ -73761,15 +75517,17 @@ Octagonal_Shape::unconstrain(const Variable var) { // Dimension-compatibility check. const dimension_type var_id = var.id(); - if (space_dimension() < var_id + 1) + if (space_dimension() < var_id + 1) { throw_dimension_incompatible("unconstrain(var)", var_id + 1); + } // Enforce strong closure for precision. strong_closure_assign(); // If the shape is empty, this is a no-op. - if (marked_empty()) + if (marked_empty()) { return; + } forget_all_octagonal_constraints(var_id); // Strong closure is preserved. @@ -73781,24 +75539,28 @@ Octagonal_Shape::unconstrain(const Variables_Set& vars) { // The cylindrification with respect to no dimensions is a no-op. // This case captures the only legal cylindrification in a 0-dim space. - if (vars.empty()) + if (vars.empty()) { return; + } // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("unconstrain(vs)", min_space_dim); + } // Enforce strong closure for precision. strong_closure_assign(); // If the shape is empty, this is a no-op. - if (marked_empty()) + if (marked_empty()) { return; + } for (Variables_Set::const_iterator vsi = vars.begin(), - vsi_end = vars.end(); vsi != vsi_end; ++vsi) + vsi_end = vars.end(); vsi != vsi_end; ++vsi) { forget_all_octagonal_constraints(*vsi); + } // Strong closure is preserved. PPL_ASSERT(OK()); } @@ -73826,8 +75588,9 @@ if (w_id != 0) { ++t; - if (!expr.all_zeroes(1, w_id)) + if (!expr.all_zeroes(1, w_id)) { ++t; + } --w_id; } @@ -73851,9 +75614,9 @@ // If this is not the case, we fall back to the general case // so as to over-approximate the constraint. if (t == 1 && expr.coefficient(Variable(w_id)) != denominator - && expr.coefficient(Variable(w_id)) != minus_denom) + && expr.coefficient(Variable(w_id)) != minus_denom) { t = 2; - + } if (t == 0) { // Case 1: expr == b. PPL_DIRTY_TEMP_COEFFICIENT(two_b); @@ -73885,7 +75648,7 @@ const dimension_type n_w = 2*w_id; switch (relsym) { case EQUAL: - if (w_coeff == denominator) + if (w_coeff == denominator) { // Add the new constraint `var - w = b/denominator'. if (var_id < w_id) { add_octagonal_constraint(n_w, n_var, b, denominator); @@ -73895,7 +75658,8 @@ add_octagonal_constraint(n_var + 1, n_w + 1, b, denominator); add_octagonal_constraint(n_var, n_w, b, minus_denom); } - else + } + else { // Add the new constraint `var + w = b/denominator'. if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var, b, denominator); @@ -73905,6 +75669,7 @@ add_octagonal_constraint(n_var + 1, n_w, b, denominator); add_octagonal_constraint(n_var, n_w + 1, b, minus_denom); } + } break; case LESS_OR_EQUAL: { @@ -73914,17 +75679,21 @@ // w_coeff * w + b, with `w_id != v'. if (w_coeff == denominator) { // Add the new constraints `v - w <= b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w, n_var, d); - else + } + else { add_octagonal_constraint(n_var + 1, n_w + 1, d); + } } else if (w_coeff == minus_denom) { // Add the new constraints `v + w <= b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var, d); - else + } + else { add_octagonal_constraint(n_var + 1, n_w, d); + } } break; } @@ -73938,18 +75707,22 @@ if (w_coeff == denominator) { // Add the new constraint `v - w >= b/denominator', // i.e., `-v + w <= -b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var + 1, d); - else + } + else { add_octagonal_constraint(n_var, n_w, d); + } } else if (w_coeff == minus_denom) { // Add the new constraints `v + w >= b/denominator', // i.e., `-v - w <= -b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w, n_var + 1, d); - else + } + else { add_octagonal_constraint(n_var, n_w + 1, d); + } } break; } @@ -73974,8 +75747,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, sum); @@ -74107,26 +75881,33 @@ // Deduce constraints of the form `v +/- u', where `u != v'. deduce_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, sum); } - else + else { // Here `pinf_count == 1'. if (pinf_index != var_id) { const Coefficient& ppi = sc_expr.coefficient(Variable(pinf_index)); - if (ppi == sc_denom) + if (ppi == sc_denom) { // Add the constraint `v - pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { matrix[2*pinf_index][n_var] = sum; - else + } + else { matrix[n_var + 1][2*pinf_index + 1] = sum; - else + } + } + else { if (ppi == minus_sc_denom) { // Add the constraint `v + pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { matrix[2*pinf_index + 1][n_var] = sum; - else + } + else { matrix[n_var + 1][2*pinf_index] = sum; + } } + } } + } } // Exploit the lower approximation, if possible. @@ -74153,28 +75934,35 @@ deduce_minus_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, neg_sum); } - else + else { // Here `neg_pinf_count == 1'. if (neg_pinf_index != var_id) { const Coefficient& npi = sc_expr.coefficient(Variable(neg_pinf_index)); - if (npi == sc_denom) + if (npi == sc_denom) { // Add the constraint `v - neg_pinf_index >= -neg_sum', // i.e., `neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index] = neg_sum; - else + } + else { matrix[2*neg_pinf_index + 1][n_var + 1] = neg_sum; - else + } + } + else { if (npi == minus_sc_denom) { // Add the constraint `v + neg_pinf_index >= -neg_sum', // i.e., `-neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index + 1] = neg_sum; - else + } + else { matrix[2*neg_pinf_index][n_var + 1] = neg_sum; + } } + } } + } } break; } @@ -74204,18 +75992,21 @@ ++m_iter; const Coefficient& sc_i = sc_expr.coefficient(Variable(id)); const int sign_i = sgn(sc_i); - if (sign_i == 0) + if (sign_i == 0) { continue; + } // Choose carefully: we are approximating `sc_expr'. const N& double_approx_i = (sign_i > 0) ? m_ci[n_i] : m_i[n_i + 1]; if (is_plus_infinity(double_approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = id; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -74247,18 +76038,22 @@ dimension_type pinf_ind = 2*pinf_index; if (expr.coefficient(Variable(pinf_index)) == denominator ) { // Add the constraint `v - pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { add_octagonal_constraint(pinf_ind, n_var, sum); - else + } + else { add_octagonal_constraint(n_var + 1, pinf_ind + 1, sum); + } } else { if (expr.coefficient(Variable(pinf_index)) == minus_denom) { // Add the constraint `v + pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { add_octagonal_constraint(pinf_ind + 1, n_var, sum); - else + } + else { add_octagonal_constraint(n_var + 1, pinf_ind, sum); + } } } } @@ -74289,18 +76084,21 @@ ++m_iter; const Coefficient& sc_i = sc_expr.coefficient(Variable(id)); const int sign_i = sgn(sc_i); - if (sign_i == 0) + if (sign_i == 0) { continue; + } // Choose carefully: we are approximating `-sc_expr'. const N& double_approx_i = (sign_i > 0) ? m_i[n_i + 1] : m_ci[n_i]; if (is_plus_infinity(double_approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = id; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -74336,19 +76134,23 @@ if (expr.coefficient(Variable(pinf_index)) == denominator) { // Add the constraint `v - pinf_index >= -sum', // i.e., `pinf_index - v <= sum'. - if (pinf_index < var_id) + if (pinf_index < var_id) { add_octagonal_constraint(n_var, pinf_ind, sum); - else + } + else { add_octagonal_constraint(pinf_ind + 1, n_var, sum); + } } else { if (expr.coefficient(Variable(pinf_index)) == minus_denom) { // Add the constraint `v + pinf_index >= -sum', // i.e., `-pinf_index - v <= sum'. - if (pinf_index < var_id) + if (pinf_index < var_id) { add_octagonal_constraint(n_var, pinf_ind + 1, sum); - else + } + else { add_octagonal_constraint(pinf_ind, n_var + 1, sum); + } } } } @@ -74370,25 +76172,29 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_image(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "e", expr); + } // `var' should be one of the dimensions of the octagon. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("affine_image(v, e, d)", var_id + 1); + } strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // Number of non-zero coefficients in `expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -74398,8 +76204,9 @@ if (w_id != 0) { ++t; - if (!expr.all_zeroes(1, w_id)) + if (!expr.all_zeroes(1, w_id)) { ++t; + } --w_id; } @@ -74444,17 +76251,19 @@ if (w_id == var_id) { // Here `expr' is of the form: +/- denominator * v + b. const bool sign_symmetry = (w_coeff != denominator); - if (!sign_symmetry && b == 0) + if (!sign_symmetry && b == 0) { // The transformation is the identity function. return; + } // Translate all the constraints on `var' adding or // subtracting the value `b/denominator'. PPL_DIRTY_TEMP(N, d); div_round_up(d, b, denominator); PPL_DIRTY_TEMP(N, minus_d); div_round_up(minus_d, b, minus_denom); - if (sign_symmetry) + if (sign_symmetry) { swap(d, minus_d); + } const row_iterator m_begin = matrix.row_begin(); const row_iterator m_end = matrix.row_end(); row_iterator m_iter = m_begin + n_var; @@ -74468,8 +76277,9 @@ add_assign_r(m_v_j, m_v_j, minus_d, ROUND_UP); N& m_cv_j = m_cv[j]; add_assign_r(m_cv_j, m_cv_j, d, ROUND_UP); - if (sign_symmetry) + if (sign_symmetry) { swap(m_v_j, m_cv_j); + } } for ( ; m_iter != m_end; ++m_iter) { row_reference m_i = *m_iter; @@ -74477,8 +76287,9 @@ add_assign_r(m_i_v, m_i_v, d, ROUND_UP); N& m_i_cv = m_i[n_var + 1]; add_assign_r(m_i_cv, m_i_cv, minus_d, ROUND_UP); - if (sign_symmetry) + if (sign_symmetry) { swap(m_i_v, m_i_cv); + } } // Now update unary constraints on var. mul_2exp_assign_r(d, d, 1, ROUND_UP); @@ -74487,8 +76298,9 @@ mul_2exp_assign_r(minus_d, minus_d, 1, ROUND_UP); N& m_v_cv = m_v[n_var + 1]; add_assign_r(m_v_cv, m_v_cv, minus_d, ROUND_UP); - if (sign_symmetry) + if (sign_symmetry) { swap(m_cv_v, m_v_cv); + } // Note: strong closure is preserved. } else { @@ -74550,8 +76362,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, pos_sum); @@ -74679,25 +76492,32 @@ // Deduce constraints of the form `v +/- u', where `u != v'. deduce_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, pos_sum); } - else + else { // Here `pos_pinf_count == 1'. if (pos_pinf_index != var_id) { const Coefficient& ppi = sc_expr.coefficient(Variable(pos_pinf_index)); - if (ppi == sc_denom) + if (ppi == sc_denom) { // Add the constraint `v - pos_pinf_index <= pos_sum'. - if (var_id < pos_pinf_index) + if (var_id < pos_pinf_index) { matrix[2*pos_pinf_index][n_var] = pos_sum; - else + } + else { matrix[n_var + 1][2*pos_pinf_index + 1] = pos_sum; - else + } + } + else { if (ppi == minus_sc_denom) { // Add the constraint `v + pos_pinf_index <= pos_sum'. - if (var_id < pos_pinf_index) + if (var_id < pos_pinf_index) { matrix[2*pos_pinf_index + 1][n_var] = pos_sum; - else + } + else { matrix[n_var + 1][2*pos_pinf_index] = pos_sum; + } } + } } + } } // Exploit the lower approximation, if possible. @@ -74722,27 +76542,34 @@ // Deduce constraints of the form `-v +/- u', where `u != v'. deduce_minus_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, neg_sum); } - else + else { // Here `neg_pinf_count == 1'. if (neg_pinf_index != var_id) { const Coefficient& npi = sc_expr.coefficient(Variable(neg_pinf_index)); - if (npi == sc_denom) + if (npi == sc_denom) { // Add the constraint `v - neg_pinf_index >= -neg_sum', // i.e., `neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index] = neg_sum; - else + } + else { matrix[2*neg_pinf_index + 1][n_var + 1] = neg_sum; - else + } + } + else { if (npi == minus_sc_denom) { // Add the constraint `v + neg_pinf_index >= -neg_sum', // i.e., `-neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index + 1] = neg_sum; - else + } + else { matrix[2*neg_pinf_index][n_var + 1] = neg_sum; + } } + } } + } } incremental_strong_closure_assign(var); @@ -74763,18 +76590,21 @@ // The dimension of `lf' should not be greater than the dimension // of `*this'. const dimension_type lf_space_dim = lf.space_dimension(); - if (space_dim < lf_space_dim) + if (space_dim < lf_space_dim) { throw_dimension_incompatible("affine_form_image(v, l)", "l", lf); + } // `var' should be one of the dimensions of the octagon. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("affine_form_image(v, l)", var.id() + 1); + } strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // Number of non-zero coefficients in `lf': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -74783,18 +76613,19 @@ dimension_type w_id = 0; // Get information about the number of non-zero coefficients in `lf'. - for (dimension_type i = lf_space_dim; i-- > 0; ) + for (dimension_type i = lf_space_dim; i-- > 0; ) { if (lf.coefficient(Variable(i)) != 0) { - if (t++ == 1) + if (t++ == 1) { break; - else + } + else { w_id = i; + } } + } typedef typename OR_Matrix::row_iterator row_iterator; typedef typename OR_Matrix::row_reference_type row_reference; - typedef typename OR_Matrix::const_row_iterator Row_iterator; - typedef typename OR_Matrix::const_row_reference_type Row_reference; typedef Interval FP_Interval_Type; using std::swap; @@ -74839,13 +76670,15 @@ // Case 2: lf = w_coeff*w + b, with w_coeff = [+/-1, +/-1]. if (w_id == var_id) { // Here lf = w_coeff*v + b, with w_coeff = [+/-1, +/-1]. - if (is_w_coeff_one && is_b_zero) + if (is_w_coeff_one && is_b_zero) { // The transformation is the identity function. return; + } // Translate all the constraints on `var' by adding the value // `b_ub' or subtracting the value `b_lb'. - if (is_w_coeff_minus_one) + if (is_w_coeff_minus_one) { swap(b_ub, b_mlb); + } const row_iterator m_begin = matrix.row_begin(); const row_iterator m_end = matrix.row_end(); row_iterator m_iter = m_begin + n_var; @@ -74859,8 +76692,9 @@ add_assign_r(m_v_j, m_v_j, b_mlb, ROUND_UP); N& m_cv_j = m_cv[j]; add_assign_r(m_cv_j, m_cv_j, b_ub, ROUND_UP); - if (is_w_coeff_minus_one) + if (is_w_coeff_minus_one) { swap(m_v_j, m_cv_j); + } } for ( ; m_iter != m_end; ++m_iter) { row_reference m_i = *m_iter; @@ -74868,8 +76702,9 @@ add_assign_r(m_i_v, m_i_v, b_ub, ROUND_UP); N& m_i_cv = m_i[n_var + 1]; add_assign_r(m_i_cv, m_i_cv, b_mlb, ROUND_UP); - if (is_w_coeff_minus_one) + if (is_w_coeff_minus_one) { swap(m_i_v, m_i_cv); + } } // Now update unary constraints on var. mul_2exp_assign_r(b_ub, b_ub, 1, ROUND_UP); @@ -74878,8 +76713,9 @@ mul_2exp_assign_r(b_mlb, b_mlb, 1, ROUND_UP); N& m_v_cv = m_v[n_var + 1]; add_assign_r(m_v_cv, m_v_cv, b_mlb, ROUND_UP); - if (is_w_coeff_minus_one) + if (is_w_coeff_minus_one) { swap(m_cv_v, m_v_cv); + } // Note: strong closure is preserved. } else { @@ -74888,7 +76724,7 @@ // Remove all constraints on `var'. forget_all_octagonal_constraints(var_id); const dimension_type n_w = 2*w_id; - if (is_w_coeff_one) + if (is_w_coeff_one) { // Add the new constraints `var - w >= b_lb' // `and var - w <= b_ub'. if (var_id < w_id) { @@ -74899,7 +76735,8 @@ add_octagonal_constraint(n_var + 1, n_w + 1, b_ub); add_octagonal_constraint(n_var, n_w, b_mlb); } - else + } + else { // Add the new constraints `var + w >= b_lb' // `and var + w <= b_ub'. if (var_id < w_id) { @@ -74910,6 +76747,7 @@ add_octagonal_constraint(n_var + 1, n_w, b_ub); add_octagonal_constraint(n_var, n_w + 1, b_mlb); } + } incremental_strong_closure_assign(var); } PPL_ASSERT(OK()); @@ -75105,25 +76943,29 @@ denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_preimage(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr); + } // `var' should be one of the dimensions of the octagon. dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("affine_preimage(v, e, d)", var_id + 1); + } strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } const Coefficient& b = expr.inhomogeneous_term(); @@ -75136,8 +76978,9 @@ if (w_id != 0) { ++t; - if (!expr.all_zeroes(1, w_id)) + if (!expr.all_zeroes(1, w_id)) { ++t; + } --w_id; } @@ -75211,31 +77054,36 @@ const Linear_Expression& expr , Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "e", expr); + } // `var' should be one of the dimensions of the octagon. dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", var_id + 1); + } // The relation symbol cannot be a strict relation symbol. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is the disequality relation symbol"); + } if (relsym == EQUAL) { // The relation symbol is "=": @@ -75246,8 +77094,9 @@ strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // Number of non-zero coefficients in `expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -75257,8 +77106,9 @@ if (w_id != 0) { ++t; - if (!expr.all_zeroes(1, w_id)) + if (!expr.all_zeroes(1, w_id)) { ++t; + } --w_id; } @@ -75368,17 +77218,21 @@ const dimension_type n_w = 2*w_id; if (w_coeff == denominator) { // Add the new constraint `v - w <= b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w, n_var, b, denominator); - else + } + else { add_octagonal_constraint(n_var + 1, n_w + 1, b, denominator); + } } else { // Add the new constraint `v + w <= b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var, b, denominator); - else + } + else { add_octagonal_constraint(n_var + 1, n_w, b, denominator); + } } } break; @@ -75440,18 +77294,22 @@ if (w_coeff == denominator) { // Add the new constraint `var - w >= b/denominator', // i.e., `w - var <= -b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var + 1, b, minus_denom); - else + } + else { add_octagonal_constraint(n_var, n_w, b, minus_denom); + } } else { // Add the new constraint `var + w >= b/denominator', // i.e., `-w - var <= -b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w, n_var + 1, b, minus_denom); - else + } + else { add_octagonal_constraint(n_var, n_w + 1, b, minus_denom); + } } } break; @@ -75485,8 +77343,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, sum); @@ -75518,18 +77377,21 @@ ++m_iter; const Coefficient& sc_i = sc_expr.coefficient(Variable(id)); const int sign_i = sgn(sc_i); - if (sign_i == 0) + if (sign_i == 0) { continue; + } // Choose carefully: we are approximating `sc_expr'. const N& double_approx_i = (sign_i > 0) ? m_ci[n_i] : m_i[n_i + 1]; if (is_plus_infinity(double_approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = id; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -75567,26 +77429,31 @@ // Deduce constraints of the form `v +/- u', where `u != v'. deduce_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) + else if (pinf_count == 1) { if (pinf_index != var_id) { const Coefficient& pi = expr.coefficient(Variable(pinf_index)); if (pi == denominator ) { // Add the constraint `v - pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { matrix[2*pinf_index][n_var] = sum; - else + } + else { matrix[n_var + 1][2*pinf_index + 1] = sum; + } } else { if (pi == minus_denom) { // Add the constraint `v + pinf_index <= sum'. - if (var_id < pinf_index) + if (var_id < pinf_index) { matrix[2*pinf_index + 1][n_var] = sum; - else + } + else { matrix[n_var + 1][2*pinf_index] = sum; + } } } } + } break; } @@ -75612,18 +77479,21 @@ ++m_iter; const Coefficient& sc_i = sc_expr.coefficient(Variable(id)); const int sign_i = sgn(sc_i); - if (sign_i == 0) + if (sign_i == 0) { continue; + } // Choose carefully: we are approximating `-sc_expr'. const N& double_approx_i = (sign_i > 0) ? m_i[n_i + 1] : m_ci[n_i]; if (is_plus_infinity(double_approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = id; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -75662,28 +77532,33 @@ // Deduce constraints of the form `-v +/- u', where `u != v'. deduce_minus_v_pm_u_bounds(var_id, pinf_index, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) + else if (pinf_count == 1) { if (pinf_index != var_id) { const Coefficient& pi = expr.coefficient(Variable(pinf_index)); if (pi == denominator) { // Add the constraint `v - pinf_index >= -sum', // i.e., `pinf_index - v <= sum'. - if (pinf_index < var_id) + if (pinf_index < var_id) { matrix[n_var][2*pinf_index] = sum; - else + } + else { matrix[2*pinf_index + 1][n_var + 1] = sum; + } } else { if (pi == minus_denom) { // Add the constraint `v + pinf_index >= -sum', // i.e., `-pinf_index - v <= sum'. - if (pinf_index < var_id) + if (pinf_index < var_id) { matrix[n_var][2*pinf_index + 1] = sum; - else + } + else { matrix[2*pinf_index][n_var + 1] = sum; + } } } } + } break; } @@ -75705,30 +77580,34 @@ // The dimension of `lhs' should not be greater than the dimension // of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e1", lhs); - + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e2", rhs); + } // Strict relation symbols are not admitted for octagons. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is the disequality relation symbol"); + } strong_closure_assign(); // The image of an empty octagon is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // Number of non-zero coefficients in `lhs': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -75738,8 +77617,9 @@ if (j_lhs != 0) { ++t_lhs; - if (!lhs.all_zeroes(1, j_lhs)) + if (!lhs.all_zeroes(1, j_lhs)) { ++t_lhs; + } --j_lhs; } @@ -75780,10 +77660,12 @@ const Coefficient& denom = lhs.coefficient(v); Relation_Symbol new_relsym = relsym; if (denom < 0) { - if (relsym == LESS_OR_EQUAL) + if (relsym == LESS_OR_EQUAL) { new_relsym = GREATER_OR_EQUAL; - else if (relsym == GREATER_OR_EQUAL) + } + else if (relsym == GREATER_OR_EQUAL) { new_relsym = LESS_OR_EQUAL; + } } Linear_Expression expr = rhs - b_lhs; generalized_affine_image(v, new_relsym, expr, denom); @@ -75793,8 +77675,9 @@ // Compute the set of variables occurring in `lhs'. std::vector lhs_vars; for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end(); - i != i_end; ++i) + i != i_end; ++i) { lhs_vars.push_back(i.variable()); + } const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim); if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) { @@ -75893,30 +77776,35 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0"); + } // `var' should be one of the dimensions of the octagon. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", var_id + 1); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "ub", ub_expr); + } strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // Number of non-zero coefficients in `lb_expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -75926,13 +77814,13 @@ if (w_id != 0) { ++t; - if (!lb_expr.all_zeroes(1, w_id)) + if (!lb_expr.all_zeroes(1, w_id)) { ++t; + } --w_id; } typedef typename OR_Matrix::row_iterator row_iterator; - typedef typename OR_Matrix::row_reference_type row_reference; typedef typename OR_Matrix::const_row_iterator Row_iterator; typedef typename OR_Matrix::const_row_reference_type Row_reference; @@ -76002,17 +77890,22 @@ // +/-denominator * w + b. const dimension_type n_w = 2*w_id; // Add the new constraint `var - w >= b/denominator'. - if (w_coeff == denominator) - if (var_id < w_id) + if (w_coeff == denominator) { + if (var_id < w_id) { add_octagonal_constraint(n_w + 1, n_var + 1, b, minus_denom); - else + } + else { add_octagonal_constraint(n_var, n_w, b, minus_denom); + } + } else { // Add the new constraint `var + w >= b/denominator'. - if (var_id < w_id) + if (var_id < w_id) { add_octagonal_constraint(n_w, n_var + 1, b, minus_denom); - else + } + else { add_octagonal_constraint(n_var, n_w + 1, b, minus_denom); + } } PPL_ASSERT(OK()); return; @@ -76043,8 +77936,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -lb_expr; + } const Linear_Expression& sc_expr = is_sc ? lb_expr : minus_expr; PPL_DIRTY_TEMP(N, neg_sum); @@ -76148,22 +78042,28 @@ // Here `neg_pinf_count == 1'. if (neg_pinf_index != var_id) { const Coefficient& npi = sc_expr.coefficient(Variable(neg_pinf_index)); - if (npi == sc_denom) + if (npi == sc_denom) { // Add the constraint `v - neg_pinf_index >= -neg_sum', // i.e., `neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index] = neg_sum; - else + } + else { matrix[2*neg_pinf_index + 1][n_var + 1] = neg_sum; - else + } + } + else { if (npi == minus_sc_denom) { // Add the constraint `v + neg_pinf_index >= -neg_sum', // i.e., `-neg_pinf_index - v <= neg_sum'. - if (neg_pinf_index < var_id) + if (neg_pinf_index < var_id) { matrix[n_var][2*neg_pinf_index + 1] = neg_sum; - else + } + else { matrix[2*neg_pinf_index][n_var + 1] = neg_sum; + } } + } } } @@ -76180,31 +78080,36 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "d == 0"); + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", "e", expr); + } // `var' should be one of the dimensions of the octagon. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", var_id + 1); + } // The relation symbol cannot be a strict relation symbol. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is the disequality relation symbol"); + } if (relsym == EQUAL) { // The relation symbol is "=": @@ -76215,8 +78120,9 @@ // The image of an empty octagon is empty too. strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; + } // Check whether the preimage of this affine relation can be easily // computed as the image of its inverse relation. @@ -76241,8 +78147,9 @@ refine(var, relsym, expr, denominator); // If the shrunk OS is empty, its preimage is empty too; ... - if (is_empty()) + if (is_empty()) { return; + } // ... otherwise, since the relation was not invertible, // we just forget all constraints on `var'. forget_all_octagonal_constraints(var_id); @@ -76259,31 +78166,34 @@ // The dimension of `lhs' should not be greater than the dimension // of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)", "e1", lhs); + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)", "e2", rhs); + } // Strict relation symbols are not admitted for octagons. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2)", "r is the disequality relation symbol"); - + } strong_closure_assign(); // The image of an empty octagon is empty. - if (marked_empty()) + if (marked_empty()) { return; - + } // Number of non-zero coefficients in `lhs': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type t_lhs = 0; @@ -76292,9 +78202,10 @@ if (j_lhs != 0) { ++t_lhs; - if (!lhs.all_zeroes(1, j_lhs)) + if (!lhs.all_zeroes(1, j_lhs)) { ++t_lhs; - j_lhs--; + } + --j_lhs; } const Coefficient& b_lhs = lhs.inhomogeneous_term(); @@ -76315,10 +78226,12 @@ const Coefficient& denom = lhs.coefficient(v); Relation_Symbol new_relsym = relsym; if (denom < 0) { - if (relsym == LESS_OR_EQUAL) + if (relsym == LESS_OR_EQUAL) { new_relsym = GREATER_OR_EQUAL; - else if (relsym == GREATER_OR_EQUAL) + } + else if (relsym == GREATER_OR_EQUAL) { new_relsym = LESS_OR_EQUAL; + } } Linear_Expression expr = rhs - b_lhs; generalized_affine_preimage(v, new_relsym, expr, denom); @@ -76329,8 +78242,9 @@ // Compute the set of variables occurring in `lhs'. std::vector lhs_vars; for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end(); - i != i_end; ++i) + i != i_end; ++i) { lhs_vars.push_back(i.variable()); + } const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim); if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) { @@ -76356,8 +78270,9 @@ } // Any image of an empty octagon is empty. - if (is_empty()) + if (is_empty()) { return; + } // Existentially quantify all variables in the lhs. for (dimension_type i = lhs_vars.size(); i-- > 0; ) { dimension_type lhs_vars_i = lhs_vars[i].id(); @@ -76423,30 +78338,35 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0"); + } // `var' should be one of the dimensions of the octagon. const dimension_type var_id = var.id(); - if (space_dim < var_id + 1) + if (space_dim < var_id + 1) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", var_id + 1); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "ub", ub_expr); + } strong_closure_assign(); // The image of an empty octagon is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } if (ub_expr.coefficient(var) == 0) { refine(var, LESS_OR_EQUAL, ub_expr, denominator); @@ -76475,10 +78395,12 @@ PPL_ASSERT(!marked_empty()); generalized_affine_preimage(var, LESS_OR_EQUAL, ub_expr, denominator); - if (sgn(denominator) == sgn(inverse_denom)) + if (sgn(denominator) == sgn(inverse_denom)) { refine_no_check(var >= new_var) ; - else + } + else { refine_no_check(var <= new_var); + } // Remove the temporarily added dimension. remove_higher_space_dimensions(space_dim-1); } @@ -76486,13 +78408,13 @@ template Constraint_System Octagonal_Shape::constraints() const { - const dimension_type space_dim = space_dimension(); Constraint_System cs; cs.set_space_dimension(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cs = Constraint_System::zero_dim_empty(); + } return cs; } @@ -76596,20 +78518,21 @@ Octagonal_Shape::expand_space_dimension(Variable var, dimension_type m) { // `var' should be one of the dimensions of the vector space. const dimension_type var_id = var.id(); - if (var_id + 1 > space_dim) + if (var_id + 1 > space_dim) { throw_dimension_incompatible("expand_space_dimension(v, m)", var_id + 1); + } // The space dimension of the resulting octagon should not // overflow the maximum allowed space dimension. - if (m > max_space_dimension() - space_dim) + if (m > max_space_dimension() - space_dim) { throw_invalid_argument("expand_dimension(v, m)", "adding m new space dimensions exceeds " "the maximum allowed space dimension"); - + } // Nothing to do, if no dimensions must be added. - if (m == 0) + if (m == 0) { return; - + } // Keep track of the dimension before adding the new ones. const dimension_type old_num_rows = matrix.num_rows(); @@ -76652,8 +78575,9 @@ } // In general, adding a constraint does not preserve the strong closure // of the octagon. - if (marked_strongly_closed()) + if (marked_strongly_closed()) { reset_strongly_closed(); + } PPL_ASSERT(OK()); } @@ -76662,22 +78586,24 @@ Octagonal_Shape::fold_space_dimensions(const Variables_Set& vars, Variable dest) { // `dest' should be one of the dimensions of the octagon. - if (dest.space_dimension() > space_dim) + if (dest.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", "v", dest); - + } // The folding of no dimensions is a no-op. - if (vars.empty()) + if (vars.empty()) { return; - + } // All variables in `vars' should be dimensions of the octagon. - if (vars.space_dimension() > space_dim) + if (vars.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", vars.space_dimension()); + } // Moreover, `dest.id()' should not occur in `vars'. - if (vars.find(dest.id()) != vars.end()) + if (vars.find(dest.id()) != vars.end()) { throw_invalid_argument("fold_space_dimensions(vs, v)", "v should not occur in vs"); + } // Recompute the elements of the row and the column corresponding // to variable `dest' by taking the join of their value with the @@ -76755,8 +78681,9 @@ const Octagonal_Shape& x = *this; const dimension_type x_space_dim = x.space_dimension(); - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { throw_dimension_incompatible("upper_bound_assign_if_exact(y)", y); + } // The zero-dim case is trivial. if (x_space_dim == 0) { @@ -76768,8 +78695,9 @@ *this = y; return true; } - else if (y.is_empty()) + else if (y.is_empty()) { return true; + } else if (x.is_empty()) { *this = y; return true; @@ -76813,12 +78741,15 @@ const N& ub_i_ci = ub_i[ci]; for (dimension_type j = row_size_i; j-- > 0; ) { // Check redundancy of x_i_j. - if (!x_non_red_i[j]) + if (!x_non_red_i[j]) { continue; + } const N& x_i_j = x_i[j]; // Check 1st condition in BHZ09 theorem. - if (x_i_j >= y_i[j]) + if (x_i_j >= y_i[j]) { continue; + } + const dimension_type cj = coherent_index(j); const dimension_type row_size_cj = OR_Matrix::row_size(cj); row_reference ub_cj = *(ub_m_begin + cj); @@ -76845,12 +78776,14 @@ for (dimension_type ell = row_size_k; ell-- > 0; ) { // Check redundancy of y_k_ell. - if (!y_non_red_k[ell]) + if (!y_non_red_k[ell]) { continue; + } const N& y_k_ell = y_k[ell]; // Check 2nd condition in BHZ09 theorem. - if (y_k_ell >= x_k[ell]) + if (y_k_ell >= x_k[ell]) { continue; + } const dimension_type cell = coherent_index(ell); row_reference ub_cell = *(ub_m_begin + cell); const N& ub_i_ell @@ -76864,37 +78797,43 @@ // Check 3rd condition in BHZ09 theorem. add_assign_r(lhs, x_i_j, y_k_ell, ROUND_UP); add_assign_r(rhs, ub_i_ell, ub_k_j, ROUND_UP); - if (lhs >= rhs) + if (lhs >= rhs) { continue; + } // Check 4th condition in BHZ09 theorem. add_assign_r(rhs, ub_i_ck, ub_cj_ell, ROUND_UP); - if (lhs >= rhs) + if (lhs >= rhs) { continue; + } // Check 5th condition in BHZ09 theorem. assign_r(lhs_copy, lhs, ROUND_NOT_NEEDED); add_assign_r(lhs, lhs_copy, x_i_j, ROUND_UP); add_assign_r(rhs, ub_i_ell, ub_i_ck, ROUND_UP); add_assign_r(rhs, rhs, ub_cj_j, ROUND_UP); - if (lhs >= rhs) + if (lhs >= rhs) { continue; + } // Check 6th condition in BHZ09 theorem. add_assign_r(rhs, ub_k_j, ub_cj_ell, ROUND_UP); add_assign_r(rhs, rhs, ub_i_ci, ROUND_UP); - if (lhs >= rhs) + if (lhs >= rhs) { continue; + } // Check 7th condition of BHZ09 theorem. add_assign_r(lhs, lhs_copy, y_k_ell, ROUND_UP); add_assign_r(rhs, ub_i_ell, ub_cj_ell, ROUND_UP); add_assign_r(rhs, rhs, ub_k_ck, ROUND_UP); - if (lhs >= rhs) + if (lhs >= rhs) { continue; + } // Check 8th (last) condition in BHZ09 theorem. add_assign_r(rhs, ub_k_j, ub_i_ck, ROUND_UP); add_assign_r(rhs, rhs, ub_cell[ell], ROUND_UP); - if (lhs < rhs) + if (lhs < rhs) { // All 8 conditions are satisfied: // upper bound is not exact. return false; + } } } } @@ -76918,9 +78857,9 @@ const Octagonal_Shape& x = *this; const dimension_type x_space_dim = x.space_dimension(); - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { throw_dimension_incompatible("integer_upper_bound_assign_if_exact(y)", y); - + } // The zero-dim case is trivial. if (x_space_dim == 0) { upper_bound_assign(y); @@ -76999,15 +78938,17 @@ const N& ub_i_ci = ub_i[ci]; for (dimension_type j = row_size_i; j-- > 0; ) { // Check redundancy of tx_i_j. - if (!tx_non_red_i[j]) + if (!tx_non_red_i[j]) { continue; + } const N& tx_i_j = tx_i[j]; const dimension_type cj = coherent_index(j); const N& eps_i_j = (i == cj) ? temp_two : temp_one; // Check condition 1a in BHZ09 Theorem 6.8. add_assign_r(lhs_i_j, tx_i_j, eps_i_j, ROUND_NOT_NEEDED); - if (lhs_i_j > ty_i[j]) + if (lhs_i_j > ty_i[j]) { continue; + } const dimension_type row_size_cj = OR_Matrix::row_size(cj); row_reference ub_cj = *(ub_m_begin + cj); const N& ub_cj_j = ub_cj[j]; @@ -77033,15 +78974,17 @@ for (dimension_type ell = row_size_k; ell-- > 0; ) { // Check redundancy of y_k_ell. - if (!ty_non_red_k[ell]) + if (!ty_non_red_k[ell]) { continue; + } const N& ty_k_ell = ty_k[ell]; const dimension_type cell = coherent_index(ell); const N& eps_k_ell = (k == cell) ? temp_two : temp_one; // Check condition 1b in BHZ09 Theorem 6.8. add_assign_r(lhs_k_ell, ty_k_ell, eps_k_ell, ROUND_NOT_NEEDED); - if (lhs_k_ell > tx_k[ell]) + if (lhs_k_ell > tx_k[ell]) { continue; + } row_reference ub_cell = *(ub_m_begin + cell); const N& ub_i_ell = (i == ell) @@ -77054,37 +78997,43 @@ // Check condition 2a in BHZ09 Theorem 6.8. add_assign_r(lhs, lhs_i_j, lhs_k_ell, ROUND_NOT_NEEDED); add_assign_r(rhs, ub_i_ell, ub_k_j, ROUND_NOT_NEEDED); - if (lhs > rhs) + if (lhs > rhs) { continue; + } // Check condition 2b in BHZ09 Theorem 6.8. add_assign_r(rhs, ub_i_ck, ub_cj_ell, ROUND_NOT_NEEDED); - if (lhs > rhs) + if (lhs > rhs) { continue; + } // Check condition 3a in BHZ09 Theorem 6.8. assign_r(lhs_copy, lhs, ROUND_NOT_NEEDED); add_assign_r(lhs, lhs, lhs_i_j, ROUND_NOT_NEEDED); add_assign_r(rhs, ub_i_ell, ub_i_ck, ROUND_NOT_NEEDED); add_assign_r(rhs, rhs, ub_cj_j, ROUND_NOT_NEEDED); - if (lhs > rhs) + if (lhs > rhs) { continue; + } // Check condition 3b in BHZ09 Theorem 6.8. add_assign_r(rhs, ub_k_j, ub_cj_ell, ROUND_NOT_NEEDED); add_assign_r(rhs, rhs, ub_i_ci, ROUND_NOT_NEEDED); - if (lhs > rhs) + if (lhs > rhs) { continue; + } // Check condition 4a in BHZ09 Theorem 6.8. add_assign_r(lhs, lhs_copy, lhs_k_ell, ROUND_NOT_NEEDED); add_assign_r(rhs, ub_i_ell, ub_cj_ell, ROUND_NOT_NEEDED); add_assign_r(rhs, rhs, ub_k_ck, ROUND_NOT_NEEDED); - if (lhs > rhs) + if (lhs > rhs) { continue; + } // Check condition 4b in BHZ09 Theorem 6.8. add_assign_r(rhs, ub_k_j, ub_i_ck, ROUND_NOT_NEEDED); add_assign_r(rhs, rhs, ub_cell[ell], ROUND_NOT_NEEDED); - if (lhs <= rhs) + if (lhs <= rhs) { // All 8 conditions are satisfied: // integer upper bound is not exact. return false; + } } } } @@ -77099,17 +79048,19 @@ template void Octagonal_Shape::drop_some_non_integer_points(Complexity_Class) { - if (std::numeric_limits::is_integer) + if (std::numeric_limits::is_integer) { return; + } - const dimension_type space_dim = space_dimension(); strong_closure_assign(); - if (space_dim == 0 || marked_empty()) + if (space_dim == 0 || marked_empty()) { return; + } for (typename OR_Matrix::element_iterator i = matrix.element_begin(), - i_end = matrix.element_end(); i != i_end; ++i) + i_end = matrix.element_end(); i != i_end; ++i) { drop_some_non_integer_points_helper(*i); + } // Unary constraints should have an even integer boundary. PPL_DIRTY_TEMP(N, temp_one); @@ -77138,16 +79089,19 @@ Complexity_Class) { // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("drop_some_non_integer_points(vs, cmpl)", min_space_dim); + } - if (std::numeric_limits::is_integer || min_space_dim == 0) + if (std::numeric_limits::is_integer || min_space_dim == 0) { return; + } strong_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; + } PPL_DIRTY_TEMP(N, temp_one); assign_r(temp_one, 1, ROUND_NOT_NEEDED); @@ -77198,9 +79152,10 @@ void Octagonal_Shape ::export_interval_constraints(U& dest) const { - if (space_dim > dest.space_dimension()) + if (space_dim > dest.space_dimension()) { throw std::invalid_argument( "Octagonal_Shape::export_interval_constraints"); + } strong_closure_assign(); @@ -77221,8 +79176,9 @@ assign_r(ub, twice_ub, ROUND_NOT_NEEDED); div_2exp_assign_r(ub, ub, 1, ROUND_UP); // FIXME: passing a raw value may not be general enough. - if (!dest.restrict_upper(i, ub.raw_value())) + if (!dest.restrict_upper(i, ub.raw_value())) { return; + } } // Set the lower bound. @@ -77232,8 +79188,9 @@ neg_assign_r(lb, lb, ROUND_NOT_NEEDED); div_2exp_assign_r(lb, lb, 1, ROUND_DOWN); // FIXME: passing a raw value may not be general enough. - if (!dest.restrict_lower(i, lb.raw_value())) + if (!dest.restrict_lower(i, lb.raw_value())) { return; + } } } @@ -77279,49 +79236,61 @@ if (is_additive_inverse(c_i_ii, c_ii_i)) { // It is an equality. PPL_ASSERT(!is_plus_infinity(c_i_ii) && !is_plus_infinity(c_ii_i)); - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } // If the value bound can NOT be divided by 2 exactly, // then we output the constraint `2*v_i = bound'. if (div_2exp_assign_r(half, c_ii_i, 1, ROUND_UP | ROUND_STRICT_RELATION) - == V_EQ) + == V_EQ) { s << v_i << " = " << half; - else + } + else { s << "2*" << v_i << " = " << c_ii_i; + } } else { // We will print unary non-strict inequalities, if any. if (!is_plus_infinity(c_i_ii)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } neg_assign_r(negation, c_i_ii, ROUND_NOT_NEEDED); // If the value bound can NOT be divided by 2 exactly, // then we output the constraint `2*v_i >= negation'. if (div_2exp_assign_r(half, negation, 1, ROUND_UP | ROUND_STRICT_RELATION) - == V_EQ) + == V_EQ) { s << v_i << " >= " << half; - else + } + else { s << "2*" << v_i << " >= " << negation; + } } if (!is_plus_infinity(c_ii_i)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } // If the value bound can NOT be divided by 2 exactly, // then we output the constraint `2*v_i <= bound'. if (div_2exp_assign_r(half, c_ii_i, 1, ROUND_UP | ROUND_STRICT_RELATION) - == V_EQ) + == V_EQ) { s << v_i << " <= " << half; - else + } + else { s << "2*" << v_i << " <= " << c_ii_i; + } } } } @@ -77345,36 +79314,46 @@ if (is_additive_inverse(c_ii_jj, c_i_j)) { // It is an equality. PPL_ASSERT(!is_plus_infinity(c_i_j) && !is_plus_infinity(c_ii_jj)); - if (first) + if (first) { first = false; - else + } + else { s << ", "; - if (sgn(c_i_j) >= 0) + } + if (sgn(c_i_j) >= 0) { s << v_j << " - " << v_i << " = " << c_i_j; - else + } + else { s << v_i << " - " << v_j << " = " << c_ii_jj; + } } else { // We will print non-strict inequalities, if any. if (!is_plus_infinity(c_i_j)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; - if (sgn(c_i_j) >= 0) + } + if (sgn(c_i_j) >= 0) { s << v_j << " - " << v_i << " <= " << c_i_j; + } else { neg_assign_r(negation, c_i_j, ROUND_DOWN); s << v_i << " - " << v_j << " >= " << negation; } } if (!is_plus_infinity(c_ii_jj)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; - if (sgn(c_ii_jj) >= 0) + } + if (sgn(c_ii_jj) >= 0) { s << v_i << " - " << v_j << " <= " << c_ii_jj; + } else { neg_assign_r(negation, c_ii_jj, ROUND_DOWN); s << v_j << " - " << v_i << " >= " << negation; @@ -77388,27 +79367,33 @@ if (is_additive_inverse(c_i_jj, c_ii_j)) { // It is an equality. PPL_ASSERT(!is_plus_infinity(c_i_jj) && !is_plus_infinity(c_ii_j)); - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } s << v_j << " + " << v_i << " = " << c_ii_j; } else { // We will print non-strict inequalities, if any. if (!is_plus_infinity(c_i_jj)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } neg_assign_r(negation, c_i_jj, ROUND_DOWN); s << v_j << " + " << v_i << " >= " << negation; } if (!is_plus_infinity(c_ii_j)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } s << v_j << " + " << v_i << " <= " << c_ii_j; } } @@ -77435,17 +79420,21 @@ Octagonal_Shape::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "space_dim") + if (!(s >> str) || str != "space_dim") { return false; + } - if (!(s >> space_dim)) + if (!(s >> space_dim)) { return false; + } - if (!status.ascii_load(s)) + if (!status.ascii_load(s)) { return false; + } - if (!matrix.ascii_load(s)) + if (!matrix.ascii_load(s)) { return false; + } PPL_ASSERT(OK()); return true; @@ -77461,26 +79450,30 @@ bool Octagonal_Shape::OK() const { // Check whether the matrix is well-formed. - if (!matrix.OK()) + if (!matrix.OK()) { return false; + } // Check whether the status information is legal. - if (!status.OK()) + if (!status.OK()) { return false; + } // All empty octagons are OK. - if (marked_empty()) + if (marked_empty()) { return true; + } // 0-dim universe octagon is OK. - if (space_dim == 0) + if (space_dim == 0) { return true; + } // MINUS_INFINITY cannot occur at all. for (typename OR_Matrix::const_row_iterator i = matrix.row_begin(), matrix_row_end = matrix.row_end(); i != matrix_row_end; ++i) { typename OR_Matrix::const_row_reference_type x_i = *i; - for (dimension_type j = i.row_size(); j-- > 0; ) + for (dimension_type j = i.row_size(); j-- > 0; ) { if (is_minus_infinity(x_i[j])) { #ifndef NDEBUG using namespace Parma_Polyhedra_Library::IO_Operators; @@ -77491,6 +79484,7 @@ #endif return false; } + } } // On the main diagonal only PLUS_INFINITY can occur. @@ -77529,13 +79523,14 @@ } // A closed octagon must be strong-coherent. - if (marked_strongly_closed()) + if (marked_strongly_closed()) { if (!is_strong_coherent()) { #ifndef NDEBUG std::cerr << "Octagonal_Shape is not strong-coherent!\n"; #endif return false; } + } } // All checks passed. @@ -77661,7 +79656,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Octagonal_Shape_defs.hh line 2323. */ +/* Automatically generated from PPL source file ../src/Octagonal_Shape_defs.hh line 2329. */ /* Automatically generated from PPL source file ../src/BD_Shape_inlines.hh line 38. */ #include @@ -77744,12 +79739,14 @@ BD_Shape::BD_Shape(const dimension_type num_dimensions, const Degenerate_Element kind) : dbm(num_dimensions + 1), status(), redundancy_dbm() { - if (kind == EMPTY) + if (kind == EMPTY) { set_empty(); + } else { - if (num_dimensions > 0) + if (num_dimensions > 0) { // A (non zero-dim) universe BDS is closed. set_shortest_path_closed(); + } } PPL_ASSERT(OK()); } @@ -77758,8 +79755,9 @@ inline BD_Shape::BD_Shape(const BD_Shape& y, Complexity_Class) : dbm(y.dbm), status(y.status), redundancy_dbm() { - if (y.marked_shortest_path_reduced()) + if (y.marked_shortest_path_reduced()) { redundancy_dbm = y.redundancy_dbm; + } } template @@ -77772,10 +79770,12 @@ status(), redundancy_dbm() { // TODO: handle flags properly, possibly taking special cases into account. - if (y.marked_empty()) + if (y.marked_empty()) { set_empty(); - else if (y.marked_zero_dim_univ()) + } + else if (y.marked_zero_dim_univ()) { set_zero_dim_univ(); + } } template @@ -77788,8 +79788,9 @@ inline void BD_Shape::add_constraints(const Constraint_System& cs) { for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) + cs_end = cs.end(); i != cs_end; ++i) { add_constraint(*i); + } } template @@ -77802,8 +79803,9 @@ inline void BD_Shape::add_congruences(const Congruence_System& cgs) { for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); i != cgs_end; ++i) + cgs_end = cgs.end(); i != cgs_end; ++i) { add_congruence(*i); + } } template @@ -77817,24 +79819,28 @@ BD_Shape::refine_with_constraint(const Constraint& c) { const dimension_type c_space_dim = c.space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dimension()) + if (c_space_dim > space_dimension()) { throw_dimension_incompatible("refine_with_constraint(c)", c); + } - if (!marked_empty()) + if (!marked_empty()) { refine_no_check(c); + } } template inline void BD_Shape::refine_with_constraints(const Constraint_System& cs) { // Dimension-compatibility check. - if (cs.space_dimension() > space_dimension()) + if (cs.space_dimension() > space_dimension()) { throw_invalid_argument("refine_with_constraints(cs)", "cs and *this are space-dimension incompatible"); + } for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) + cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) { refine_no_check(*i); + } } template @@ -77842,24 +79848,28 @@ BD_Shape::refine_with_congruence(const Congruence& cg) { const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dimension()) + if (cg_space_dim > space_dimension()) { throw_dimension_incompatible("refine_with_congruence(cg)", cg); + } - if (!marked_empty()) + if (!marked_empty()) { refine_no_check(cg); + } } template void BD_Shape::refine_with_congruences(const Congruence_System& cgs) { // Dimension-compatibility check. - if (cgs.space_dimension() > space_dimension()) + if (cgs.space_dimension() > space_dimension()) { throw_invalid_argument("refine_with_congruences(cgs)", "cgs and *this are space-dimension incompatible"); + } for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) + cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) { refine_no_check(*i); + } } template @@ -77869,8 +79879,9 @@ PPL_ASSERT(cg.space_dimension() <= space_dimension()); if (cg.is_proper_congruence()) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { set_empty(); + } // Other proper congruences are just ignored. return; } @@ -77897,9 +79908,10 @@ inline BD_Shape::BD_Shape(const Constraint_System& cs) : dbm(cs.space_dimension() + 1), status(), redundancy_dbm() { - if (cs.space_dimension() > 0) + if (cs.space_dimension() > 0) { // A (non zero-dim) universe BDS is shortest-path closed. set_shortest_path_closed(); + } add_constraints(cs); } @@ -77910,8 +79922,9 @@ Complexity_Class) : dbm(box.space_dimension() + 1), status(), redundancy_dbm() { // Check emptiness for maximum precision. - if (box.is_empty()) + if (box.is_empty()) { set_empty(); + } else if (box.space_dimension() > 0) { // A (non zero-dim) universe BDS is shortest-path closed. set_shortest_path_closed(); @@ -77924,9 +79937,10 @@ BD_Shape::BD_Shape(const Grid& grid, Complexity_Class) : dbm(grid.space_dimension() + 1), status(), redundancy_dbm() { - if (grid.space_dimension() > 0) + if (grid.space_dimension() > 0) { // A (non zero-dim) universe BDS is shortest-path closed. set_shortest_path_closed(); + } // Taking minimized congruences ensures maximum precision. refine_with_congruences(grid.minimized_congruences()); } @@ -77938,8 +79952,9 @@ Complexity_Class) : dbm(os.space_dimension() + 1), status(), redundancy_dbm() { // Check for emptiness for maximum precision. - if (os.is_empty()) + if (os.is_empty()) { set_empty(); + } else if (os.space_dimension() > 0) { // A (non zero-dim) universe BDS is shortest-path closed. set_shortest_path_closed(); @@ -77955,8 +79970,9 @@ BD_Shape::operator=(const BD_Shape& y) { dbm = y.dbm; status = y.status; - if (y.marked_shortest_path_reduced()) + if (y.marked_shortest_path_reduced()) { redundancy_dbm = y.redundancy_dbm; + } return *this; } @@ -78054,15 +80070,18 @@ operator==(const BD_Shape& x, const BD_Shape& y) { const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } // Zero-dim BDSs are equal if and only if they are both empty or universe. if (x_space_dim == 0) { - if (x.marked_empty()) + if (x.marked_empty()) { return y.marked_empty(); - else + } + else { return !y.marked_empty(); + } } // The exact equivalence test requires shortest-path closure. @@ -78071,10 +80090,12 @@ // If one of two BDSs is empty, then they are equal // if and only if the other BDS is empty too. - if (x.marked_empty()) + if (x.marked_empty()) { return y.marked_empty(); - if (y.marked_empty()) + } + if (y.marked_empty()) { return false; + } // Check for syntactic equivalence of the two (shortest-path closed) // systems of bounded differences. return x.dbm == y.dbm; @@ -78099,15 +80120,18 @@ Temp& tmp2) { const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } // Zero-dim BDSs are equal if and only if they are both empty or universe. if (x_space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -78118,10 +80142,12 @@ // If one of two BDSs is empty, then they are equal if and only if // the other BDS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -78164,15 +80190,18 @@ Temp& tmp2) { const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } // Zero-dim BDSs are equal if and only if they are both empty or universe. if (x_space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -78183,10 +80212,12 @@ // If one of two BDSs is empty, then they are equal if and only if // the other BDS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -78229,15 +80260,17 @@ Temp& tmp2) { const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; - + } // Zero-dim BDSs are equal if and only if they are both empty or universe. if (x_space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -78248,10 +80281,12 @@ // If one of two BDSs is empty, then they are equal if and only if // the other BDS is empty too. if (x.marked_empty() || y.marked_empty()) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -78292,8 +80327,9 @@ N& dbm_ij = dbm[i][j]; if (dbm_ij > k) { dbm_ij = k; - if (marked_shortest_path_closed()) + if (marked_shortest_path_closed()) { reset_shortest_path_closed(); + } } } @@ -78315,8 +80351,9 @@ inline void BD_Shape::time_elapse_assign(const BD_Shape& y) { // Dimension-compatibility check. - if (space_dimension() != y.space_dimension()) + if (space_dimension() != y.space_dimension()) { throw_dimension_incompatible("time_elapse_assign(y)", y); + } // Compute time-elapse on polyhedra. // TODO: provide a direct implementation. C_Polyhedron ph_x(constraints()); @@ -78337,8 +80374,9 @@ template inline bool BD_Shape::upper_bound_assign_if_exact(const BD_Shape& y) { - if (space_dimension() != y.space_dimension()) + if (space_dimension() != y.space_dimension()) { throw_dimension_incompatible("upper_bound_assign_if_exact(y)", y); + } #if 0 return BFT00_upper_bound_assign_if_exact(y); #else @@ -78353,8 +80391,9 @@ PPL_COMPILE_TIME_CHECK(std::numeric_limits::is_integer, "BD_Shape::integer_upper_bound_assign_if_exact(y):" " T in not an integer datatype."); - if (space_dimension() != y.space_dimension()) + if (space_dimension() != y.space_dimension()) { throw_dimension_incompatible("integer_upper_bound_assign_if_exact(y)", y); + } const bool integer_upper_bound = true; return BHZ09_upper_bound_assign_if_exact(y); } @@ -78366,9 +80405,10 @@ // Dimension-compatibility check: the variable having // maximum index is the one occurring last in the set. const dimension_type space_dim = space_dimension(); - if (new_dimension > space_dim) + if (new_dimension > space_dim) { throw_dimension_incompatible("remove_higher_space_dimensions(nd)", new_dimension); + } // The removal of no dimensions from any BDS is a no-op. // Note that this case also captures the only legal removal of @@ -78384,13 +80424,15 @@ // Shortest-path closure is maintained. // TODO: see whether or not reduction can be (efficiently!) maintained too. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } // If we removed _all_ dimensions from a non-empty BDS, // the zero-dim universe BDS has been obtained. - if (new_dimension == 0 && !marked_empty()) + if (new_dimension == 0 && !marked_empty()) { set_zero_dim_univ(); + } PPL_ASSERT(OK()); } @@ -78594,11 +80636,12 @@ for (dimension_type i = space_dim; i > 0; --i) { const Coefficient& g_i = g.expression().get(Variable(i - 1)); DB_Row& dbm_i = dbm[i]; - for (dimension_type j = space_dim; j > 0; --j) + for (dimension_type j = space_dim; j > 0; --j) { if (i != j) { const Coefficient& g_j = g.expression().get(Variable(j - 1)); div_round_up(dbm_i[j], g_j - g_i, d); } + } div_round_up(dbm_i[0], -g_i, d); } for (dimension_type j = space_dim; j > 0; --j) { @@ -78638,11 +80681,12 @@ } } - if (!point_seen) + if (!point_seen) { // The generator system is not empty, but contains no points. throw_invalid_argument("BD_Shape(gs)", "the non-empty generator system gs " "contains no points."); + } // Going through all the lines and rays. for (Generator_System::const_iterator gs_i = gs_begin; @@ -78656,16 +80700,20 @@ const Coefficient& g_i = g.expression().get(Variable(i - 1)); DB_Row& dbm_i = dbm[i]; // The loop correctly handles the case when i == j. - for (dimension_type j = space_dim; j > 0; --j) - if (g_i != g.expression().get(Variable(j - 1))) + for (dimension_type j = space_dim; j > 0; --j) { + if (g_i != g.expression().get(Variable(j - 1))) { assign_r(dbm_i[j], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i != 0) + } + } + if (g_i != 0) { assign_r(dbm_i[0], PLUS_INFINITY, ROUND_NOT_NEEDED); + } } for (Generator::expr_type::const_iterator i = g.expression().begin(), - i_end = g.expression().end(); i != i_end; ++i) + i_end = g.expression().end(); i != i_end; ++i) { assign_r(dbm_0[i.variable().space_dimension()], PLUS_INFINITY, ROUND_NOT_NEEDED); + } break; case Generator::RAY: // TODO: Check if the following loop can be optimized used @@ -78674,17 +80722,22 @@ const Coefficient& g_i = g.expression().get(Variable(i - 1)); DB_Row& dbm_i = dbm[i]; // The loop correctly handles the case when i == j. - for (dimension_type j = space_dim; j > 0; --j) - if (g_i < g.expression().get(Variable(j - 1))) + for (dimension_type j = space_dim; j > 0; --j) { + if (g_i < g.expression().get(Variable(j - 1))) { assign_r(dbm_i[j], PLUS_INFINITY, ROUND_NOT_NEEDED); - if (g_i < 0) + } + } + if (g_i < 0) { assign_r(dbm_i[0], PLUS_INFINITY, ROUND_NOT_NEEDED); + } } for (Generator::expr_type::const_iterator i = g.expression().begin(), - i_end = g.expression().end(); i != i_end; ++i) - if (*i > 0) + i_end = g.expression().end(); i != i_end; ++i) { + if (*i > 0) { assign_r(dbm_0[i.variable().space_dimension()], PLUS_INFINITY, ROUND_NOT_NEEDED); + } + } break; default: // Points and closure points already dealt with. @@ -78734,11 +80787,12 @@ // See if there is at least one inconsistent constraint in `ph.con_sys'. for (Constraint_System::const_iterator i = ph.con_sys.begin(), - cs_end = ph.con_sys.end(); i != cs_end; ++i) + cs_end = ph.con_sys.end(); i != cs_end; ++i) { if (i->is_inconsistent()) { *this = BD_Shape(num_dimensions, EMPTY); return; } + } // If `complexity' allows it, use simplex to derive the exact (modulo // the fact that our BDSs are topologically closed) variable bounds. @@ -78747,9 +80801,10 @@ lp.set_optimization_mode(MAXIMIZATION); const Constraint_System& ph_cs = ph.constraints(); - if (!ph_cs.has_strict_inequalities()) + if (!ph_cs.has_strict_inequalities()) { lp.add_constraints(ph_cs); - else + } + else { // Adding to `lp' a topologically closed version of `ph_cs'. for (Constraint_System::const_iterator i = ph_cs.begin(), ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) { @@ -78758,9 +80813,11 @@ Linear_Expression expr(c.expression()); lp.add_constraint(expr >= 0); } - else + else { lp.add_constraint(c); + } } + } // Check for unsatisfiability. if (!lp.is_satisfiable()) { @@ -78785,8 +80842,9 @@ } // Evaluate optimal upper bound for `x - y <= ub'. for (dimension_type j = 1; j <= num_dimensions; ++j) { - if (i == j) + if (i == j) { continue; + } Variable y(j-1); lp.set_objective_function(x - y); if (lp.solve() == OPTIMIZED_MIP_PROBLEM) { @@ -78819,15 +80877,15 @@ BD_Shape::affine_dimension() const { const dimension_type space_dim = space_dimension(); // A zero-space-dim shape always has affine dimension zero. - if (space_dim == 0) + if (space_dim == 0) { return 0; - + } // Shortest-path closure is necessary to detect emptiness // and all (possibly implicit) equalities. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return 0; - + } // The vector `predecessor' is used to represent equivalence classes: // `predecessor[i] == i' if and only if `i' is the leader of its // equivalence class (i.e., the minimum index in the class). @@ -78838,10 +80896,11 @@ // less the number of equivalence classes. dimension_type affine_dim = 0; // Note: disregard the first equivalence class. - for (dimension_type i = 1; i <= space_dim; ++i) - if (predecessor[i] == i) + for (dimension_type i = 1; i <= space_dim; ++i) { + if (predecessor[i] == i) { ++affine_dim; - + } + } return affine_dim; } @@ -78856,8 +80915,9 @@ Congruence_System cgs(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cgs = Congruence_System::zero_dim_empty(); + } return cgs; } @@ -78900,17 +80960,18 @@ void BD_Shape::add_constraint(const Constraint& c) { // Dimension-compatibility check. - if (c.space_dimension() > space_dimension()) + if (c.space_dimension() > space_dimension()) { throw_dimension_incompatible("add_constraint(c)", c); - + } // Get rid of strict inequalities. if (c.is_strict_inequality()) { if (c.is_inconsistent()) { set_empty(); return; } - if (c.is_tautological()) + if (c.is_tautological()) { return; + } // Nontrivial strict inequalities are not allowed. throw_invalid_argument("add_constraint(c)", "strict inequalities are not allowed"); @@ -78921,25 +80982,26 @@ dimension_type j = 0; PPL_DIRTY_TEMP_COEFFICIENT(coeff); // Constraints that are not bounded differences are not allowed. - if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) + if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) { throw_invalid_argument("add_constraint(c)", "c is not a bounded difference constraint"); - + } const Coefficient& inhomo = c.inhomogeneous_term(); if (num_vars == 0) { // Dealing with a trivial constraint (not a strict inequality). if (inhomo < 0 - || (inhomo != 0 && c.is_equality())) + || (inhomo != 0 && c.is_equality())) { set_empty(); + } return; } // Select the cell to be modified for the "<=" part of the constraint, // and set `coeff' to the absolute value of itself. const bool negative = (coeff < 0); - if (negative) + if (negative) { neg_assign(coeff); - + } bool changed = false; N& x = negative ? dbm[i][j] : dbm[j][i]; // Compute the bound for `x', rounding towards plus infinity. @@ -78964,8 +81026,9 @@ // In general, adding a constraint does not preserve the shortest-path // closure or reduction of the bounded difference shape. - if (changed && marked_shortest_path_closed()) + if (changed && marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -78975,13 +81038,14 @@ const dimension_type cg_space_dim = cg.space_dimension(); // Dimension-compatibility check: // the dimension of `cg' can not be greater than space_dim. - if (space_dimension() < cg_space_dim) + if (space_dimension() < cg_space_dim) { throw_dimension_incompatible("add_congruence(cg)", cg); - + } // Handle the case of proper congruences first. if (cg.is_proper_congruence()) { - if (cg.is_tautological()) + if (cg.is_tautological()) { return; + } if (cg.is_inconsistent()) { set_empty(); return; @@ -79007,16 +81071,17 @@ dimension_type j = 0; PPL_DIRTY_TEMP_COEFFICIENT(coeff); // Constraints that are not bounded differences are ignored. - if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) + if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) { return; - + } const Coefficient& inhomo = c.inhomogeneous_term(); if (num_vars == 0) { // Dealing with a trivial constraint (might be a strict inequality). if (inhomo < 0 || (c.is_equality() && inhomo != 0) - || (c.is_strict_inequality() && inhomo == 0)) + || (c.is_strict_inequality() && inhomo == 0)) { set_empty(); + } return; } @@ -79025,9 +81090,9 @@ const bool negative = (coeff < 0); N& x = negative ? dbm[i][j] : dbm[j][i]; N& y = negative ? dbm[j][i] : dbm[i][j]; - if (negative) + if (negative) { neg_assign(coeff); - + } bool changed = false; // Compute the bound for `x', rounding towards plus infinity. PPL_DIRTY_TEMP(N, d); @@ -79050,8 +81115,9 @@ // In general, adding a constraint does not preserve the shortest-path // closure or reduction of the bounded difference shape. - if (changed && marked_shortest_path_closed()) + if (changed && marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -79090,12 +81156,14 @@ DB_Row& dbm_i = dbm[i]; dbm_i[0] = y.dbm[i - x_space_dim][0]; dbm[0][i] = y.dbm[0][i - x_space_dim]; - for (dimension_type j = x_space_dim + 1; j <= new_space_dim; ++j) + for (dimension_type j = x_space_dim + 1; j <= new_space_dim; ++j) { dbm_i[j] = y.dbm[i - x_space_dim][j - x_space_dim]; + } } - if (marked_shortest_path_closed()) + if (marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -79106,9 +81174,9 @@ const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { throw_dimension_incompatible("contains(y)", y); - + } if (x_space_dim == 0) { // The zero-dimensional empty shape only contains another // zero-dimensional empty shape. @@ -79141,21 +81209,23 @@ */ y.shortest_path_closure_assign(); // An empty shape is contained in any other dimension-compatible shapes. - if (y.marked_empty()) + if (y.marked_empty()) { return true; - + } // If `x' is empty it can not contain `y' (which is not empty). - if (x.is_empty()) + if (x.is_empty()) { return false; - + } // `*this' contains `y' if and only if every cell of `dbm' // is greater than or equal to the correspondent one of `y.dbm'. for (dimension_type i = x_space_dim + 1; i-- > 0; ) { const DB_Row& x_dbm_i = x.dbm[i]; const DB_Row& y_dbm_i = y.dbm[i]; - for (dimension_type j = x_space_dim + 1; j-- > 0; ) - if (x_dbm_i[j] < y_dbm_i[j]) + for (dimension_type j = x_space_dim + 1; j-- > 0; ) { + if (x_dbm_i[j] < y_dbm_i[j]) { return false; + } + } } return true; } @@ -79165,18 +81235,19 @@ BD_Shape::is_disjoint_from(const BD_Shape& y) const { const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("is_disjoint_from(y)", y); - + } // If one of the two bounded difference shape is empty, // then the two bounded difference shape are disjoint. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return true; + } y.shortest_path_closure_assign(); - if (y.marked_empty()) + if (y.marked_empty()) { return true; - + } // Two BDSs are disjoint when their intersection is empty. // That is if and only if there exists at least a bounded difference // such that the upper bound of the bounded difference in the first @@ -79194,8 +81265,9 @@ const DB_Row& x_i = dbm[i]; for (dimension_type j = space_dim+1; j-- > 0; ) { neg_assign_r(tmp, y.dbm[j][i], ROUND_UP); - if (x_i[j] < tmp) + if (x_i[j] < tmp) { return true; + } } } @@ -79205,22 +81277,24 @@ template bool BD_Shape::is_universe() const { - if (marked_empty()) + if (marked_empty()) { return false; - + } const dimension_type space_dim = space_dimension(); // If the BDS is non-empty and zero-dimensional, // then it is necessarily the universe BDS. - if (space_dim == 0) + if (space_dim == 0) { return true; - + } // A bounded difference shape defining the universe BDS can only // contain trivial constraints. for (dimension_type i = space_dim + 1; i-- > 0; ) { const DB_Row& dbm_i = dbm[i]; - for (dimension_type j = space_dim + 1; j-- > 0; ) - if (!is_plus_infinity(dbm_i[j])) + for (dimension_type j = space_dim + 1; j-- > 0; ) { + if (!is_plus_infinity(dbm_i[j])) { return false; + } + } } return true; } @@ -79231,17 +81305,20 @@ shortest_path_closure_assign(); const dimension_type space_dim = space_dimension(); // A zero-dimensional or empty BDS is bounded. - if (marked_empty() || space_dim == 0) + if (marked_empty() || space_dim == 0) { return true; - + } // A bounded difference shape defining the bounded BDS never can // contain trivial constraints. for (dimension_type i = space_dim + 1; i-- > 0; ) { const DB_Row& dbm_i = dbm[i]; - for (dimension_type j = space_dim + 1; j-- > 0; ) - if (i != j) - if (is_plus_infinity(dbm_i[j])) + for (dimension_type j = space_dim + 1; j-- > 0; ) { + if (i != j) { + if (is_plus_infinity(dbm_i[j])) { return false; + } + } + } } return true; @@ -79251,18 +81328,18 @@ bool BD_Shape::contains_integer_point() const { // Force shortest-path closure. - if (is_empty()) + if (is_empty()) { return false; - + } const dimension_type space_dim = space_dimension(); - if (space_dim == 0) + if (space_dim == 0) { return true; - + } // A non-empty BD_Shape defined by integer constraints // necessarily contains an integer point. - if (std::numeric_limits::is_integer) + if (std::numeric_limits::is_integer) { return true; - + } // Build an integer BD_Shape z with bounds at least as tight as // those in *this and then recheck for emptiness. BD_Shape bds_z(space_dim); @@ -79275,10 +81352,12 @@ const DB_Row& dbm_i = dbm[i]; for (dimension_type j = space_dim + 1; j-- > 0; ) { const N& dbm_i_j = dbm_i[j]; - if (is_plus_infinity(dbm_i_j)) + if (is_plus_infinity(dbm_i_j)) { continue; - if (is_integer(dbm_i_j)) + } + if (is_integer(dbm_i_j)) { assign_r(z_i[j], dbm_i_j, ROUND_NOT_NEEDED); + } else { all_integers = false; Z& z_i_j = z_i[j]; @@ -79299,9 +81378,9 @@ Coefficient& val_n, Coefficient& val_d) const { dimension_type space_dim = space_dimension(); // The dimension of `expr' must be at most the dimension of *this. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("frequency(e, ...)", "e", expr); - + } // Check if `expr' has a constant value. // If it is constant, set the frequency `freq_n' to 0 // and return true. Otherwise the values for \p expr @@ -79310,8 +81389,9 @@ // Space dimension is 0: if empty, then return false; // otherwise the frequency is 0 and the value is the inhomogeneous term. if (space_dim == 0) { - if (is_empty()) + if (is_empty()) { return false; + } freq_n = 0; freq_d = 1; val_n = expr.inhomogeneous_term(); @@ -79321,9 +81401,9 @@ shortest_path_closure_assign(); // For an empty BD shape, we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; - + } // The BD shape has at least 1 dimension and is not empty. PPL_DIRTY_TEMP_COEFFICIENT(coeff); PPL_DIRTY_TEMP_COEFFICIENT(numer); @@ -79342,9 +81422,9 @@ for (dimension_type i = dbm.num_rows(); i-- > 1; ) { const Variable v(i-1); coeff = le.coefficient(v); - if (coeff == 0) + if (coeff == 0) { continue; - + } const DB_Row& dbm_i = dbm[i]; // Check if `v' is constant in the BD shape. assign_r(tmp, dbm_i[0], ROUND_NOT_NEEDED); @@ -79382,9 +81462,10 @@ break; } } - if (!constant_v) + if (!constant_v) { // The expression `expr' is not constant. return false; + } } } @@ -79402,21 +81483,22 @@ BD_Shape::constrains(const Variable var) const { // `var' should be one of the dimensions of the BD shape. const dimension_type var_space_dim = var.space_dimension(); - if (space_dimension() < var_space_dim) + if (space_dimension() < var_space_dim) { throw_dimension_incompatible("constrains(v)", "v", var); - + } shortest_path_closure_assign(); // A BD shape known to be empty constrains all variables. // (Note: do not force emptiness check _yet_) - if (marked_empty()) + if (marked_empty()) { return true; - + } // Check whether `var' is syntactically constrained. const DB_Row& dbm_v = dbm[var_space_dim]; for (dimension_type i = dbm.num_rows(); i-- > 0; ) { if (!is_plus_infinity(dbm_v[i]) - || !is_plus_infinity(dbm[i][var_space_dim])) + || !is_plus_infinity(dbm[i][var_space_dim])) { return true; + } } // `var' is not syntactically constrained: @@ -79438,20 +81520,23 @@ const dimension_type predecessor_size = dbm.num_rows(); // Initially, each variable is leader of its own zero-equivalence class. predecessor.reserve(predecessor_size); - for (dimension_type i = 0; i < predecessor_size; ++i) + for (dimension_type i = 0; i < predecessor_size; ++i) { predecessor.push_back(i); + } // Now compute actual predecessors. - for (dimension_type i = predecessor_size; i-- > 1; ) + for (dimension_type i = predecessor_size; i-- > 1; ) { if (i == predecessor[i]) { const DB_Row& dbm_i = dbm[i]; - for (dimension_type j = i; j-- > 0; ) + for (dimension_type j = i; j-- > 0; ) { if (j == predecessor[j] && is_additive_inverse(dbm[j][i], dbm_i[j])) { // Choose as predecessor the variable having the smaller index. predecessor[i] = j; break; } + } } + } } template @@ -79478,44 +81563,47 @@ bool BD_Shape::is_shortest_path_reduced() const { // If the BDS is empty, it is also reduced. - if (marked_empty()) + if (marked_empty()) { return true; - + } const dimension_type space_dim = space_dimension(); // Zero-dimensional BDSs are necessarily reduced. - if (space_dim == 0) + if (space_dim == 0) { return true; - + } // A shortest-path reduced dbm is just a dbm with an indication of // those constraints that are redundant. If there is no indication // of the redundant constraints, then it cannot be reduced. - if (!marked_shortest_path_reduced()) + if (!marked_shortest_path_reduced()) { return false; + } const BD_Shape x_copy = *this; x_copy.shortest_path_closure_assign(); // If we just discovered emptiness, it cannot be reduced. - if (x_copy.marked_empty()) + if (x_copy.marked_empty()) { return false; - + } // The vector `leader' is used to indicate which variables are equivalent. std::vector leader(space_dim + 1); // We store the leader. - for (dimension_type i = space_dim + 1; i-- > 0; ) + for (dimension_type i = space_dim + 1; i-- > 0; ) { leader[i] = i; - + } // Step 1: we store really the leader with the corrected value. // We search for the equivalent or zero-equivalent variables. // The variable(i-1) and variable(j-1) are equivalent if and only if // m_i_j == -(m_j_i). for (dimension_type i = 0; i < space_dim; ++i) { const DB_Row& x_copy_dbm_i = x_copy.dbm[i]; - for (dimension_type j = i + 1; j <= space_dim; ++j) - if (is_additive_inverse(x_copy.dbm[j][i], x_copy_dbm_i[j])) + for (dimension_type j = i + 1; j <= space_dim; ++j) { + if (is_additive_inverse(x_copy.dbm[j][i], x_copy_dbm_i[j])) { // Two equivalent variables have got the same leader // (the smaller variable). leader[j] = leader[i]; + } + } } // Step 2: we check if there are redundant constraints in the zero_cycle @@ -79524,34 +81612,38 @@ // their sum is the same constraint with the inhomogeneous term // less than or equal to the `c' one. PPL_DIRTY_TEMP(N, c); - for (dimension_type k = 0; k <= space_dim; ++k) + for (dimension_type k = 0; k <= space_dim; ++k) { if (leader[k] == k) { const DB_Row& x_k = x_copy.dbm[k]; - for (dimension_type i = 0; i <= space_dim; ++i) + for (dimension_type i = 0; i <= space_dim; ++i) { if (leader[i] == i) { const DB_Row& x_i = x_copy.dbm[i]; const Bit_Row& redundancy_i = redundancy_dbm[i]; const N& x_i_k = x_i[k]; - for (dimension_type j = 0; j <= space_dim; ++j) + for (dimension_type j = 0; j <= space_dim; ++j) { if (leader[j] == j) { const N& x_i_j = x_i[j]; if (!is_plus_infinity(x_i_j)) { add_assign_r(c, x_i_k, x_k[j], ROUND_UP); - if (x_i_j >= c && !redundancy_i[j]) + if (x_i_j >= c && !redundancy_i[j]) { return false; + } } } + } } + } } + } // The vector `var_conn' is used to check if there is a single cycle // that connected all zero-equivalent variables between them. // The value `space_dim + 1' is used to indicate that the equivalence // class contains a single variable. std::vector var_conn(space_dim + 1); - for (dimension_type i = space_dim + 1; i-- > 0; ) + for (dimension_type i = space_dim + 1; i-- > 0; ) { var_conn[i] = space_dim + 1; - + } // Step 3: we store really the `var_conn' with the right value, putting // the variable with the selected variable is connected: // we check the row of each variable: @@ -79568,20 +81660,24 @@ dimension_type leader_j = leader[j]; // Only the connectedness with equivalent variables // is considered. - if (j != leader_j) + if (j != leader_j) { if (!redundancy_dbm[i][j]) { - if (t == 1) + if (t == 1) { // Two non-leaders cannot be connected with the same leader. return false; - else - if (leader_j != i) + } + else { + if (leader_j != i) { // The variables are not in the same equivalence class. return false; + } else { ++t; var_conn[i] = j; } + } } + } } } // Case b: non-leader. @@ -79589,13 +81685,15 @@ for (dimension_type j = 0; j <= space_dim; ++j) { if (!redundancy_dbm[i][j]) { dimension_type leader_j = leader[j]; - if (leader_i != leader_j) + if (leader_i != leader_j) { // The variables are not in the same equivalence class. return false; + } else { - if (t == 1) + if (t == 1) { // The variables cannot be connected with the same leader. return false; + } else { ++t; var_conn[i] = j; @@ -79603,8 +81701,9 @@ } // A non-leader must be connected with // another variable. - if (t == 0) + if (t == 0) { return false; + } } } } @@ -79613,9 +81712,9 @@ // The vector `just_checked' is used to check if // a variable is already checked. std::vector just_checked(space_dim + 1); - for (dimension_type i = space_dim + 1; i-- > 0; ) + for (dimension_type i = space_dim + 1; i-- > 0; ) { just_checked[i] = false; - + } // Step 4: we check if there are single cycles that // connected all the zero-equivalent variables between them. for (dimension_type i = 0; i <= space_dim; ++i) { @@ -79632,8 +81731,9 @@ v_con = var_conn[v_con]; // If we re-pass to an already considered variable, // then we haven't a single cycle. - if (just_checked[v_con]) + if (just_checked[v_con]) { return false; + } } } } @@ -79652,16 +81752,16 @@ // of `*this'. const dimension_type expr_space_dim = expr.space_dimension(); const dimension_type space_dim = space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((from_above ? "bounds_from_above(e)" : "bounds_from_below(e)"), "e", expr); - + } shortest_path_closure_assign(); // A zero-dimensional or empty BDS bounds everything. - if (space_dim == 0 || marked_empty()) + if (space_dim == 0 || marked_empty()) { return true; - + } // The constraint `c' is used to check if `expr' is a difference // bounded and, in this case, to select the cell. const Constraint& c = from_above ? expr <= 0 : expr >= 0; @@ -79671,9 +81771,10 @@ PPL_DIRTY_TEMP_COEFFICIENT(coeff); // Check if `c' is a BD constraint. if (BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) { - if (num_vars == 0) + if (num_vars == 0) { // Dealing with a trivial constraint. return true; + } // Select the cell to be checked. const N& x = (coeff < 0) ? dbm[i][j] : dbm[j][i]; return !is_plus_infinity(x); @@ -79698,14 +81799,16 @@ // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } // Deal with zero-dim BDS first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -79716,9 +81819,9 @@ shortest_path_closure_assign(); // For an empty BDS we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; - + } // The constraint `c' is used to check if `expr' is a difference // bounded and, in this case, to select the cell. const Constraint& c = maximize ? expr <= 0 : expr >= 0; @@ -79736,9 +81839,10 @@ included = true; return true; } - else + else { // Here`expr' is unbounded in `*this'. return false; + } } else { // Here `expr' is a bounded difference. @@ -79766,8 +81870,9 @@ PPL_ASSERT(i != 0); const Coefficient& coeff_i = expr.get(Variable(i - 1)); const int sign_i = sgn(coeff_i); - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_expr, coeff_i, ROUND_UP); + } else { PPL_DIRTY_TEMP_COEFFICIENT(minus_coeff_i); neg_assign(minus_coeff_i, coeff_i); @@ -79776,8 +81881,9 @@ // Approximating the maximum/minimum of `expr'. add_mul_assign_r(d, coeff_expr, x, ROUND_UP); numer_denom(d, ext_n, ext_d); - if (!maximize) + if (!maximize) { neg_assign(ext_n); + } included = true; return true; } @@ -79798,14 +81904,16 @@ // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } // Deal with zero-dim BDS first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -79817,9 +81925,9 @@ shortest_path_closure_assign(); // For an empty BDS we simply return false. - if (marked_empty()) + if (marked_empty()) { return false; - + } Optimization_Mode mode_max_min = maximize ? MAXIMIZATION : MINIMIZATION; MIP_Problem mip(space_dim, constraints(), expr, mode_max_min); @@ -79839,9 +81947,9 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (cg.space_dimension() > space_dim) + if (cg.space_dimension() > space_dim) { throw_dimension_incompatible("relation_with(cg)", cg); - + } // If the congruence is an equality, find the relation with // the equivalent equality constraint. if (cg.is_equality()) { @@ -79851,17 +81959,19 @@ shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); - + } if (space_dim == 0) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } } // Find the lower bound for a hyperplane with direction @@ -79874,9 +81984,9 @@ // If there is no lower bound, then some of the hyperplanes defined by // the congruence will strictly intersect the shape. - if (!bounded_below) + if (!bounded_below) { return Poly_Con_Relation::strictly_intersects(); - + } // TODO: Consider adding a max_and_min() method, performing both // maximization and minimization so as to possibly exploit // incrementality of the MIP solver. @@ -79890,9 +82000,9 @@ // If there is no upper bound, then some of the hyperplanes defined by // the congruence will strictly intersect the shape. - if (!bounded_above) + if (!bounded_above) { return Poly_Con_Relation::strictly_intersects(); - + } PPL_DIRTY_TEMP_COEFFICIENT(signed_distance); // Find the position value for the hyperplane that satisfies the congruence @@ -79902,25 +82012,27 @@ const Coefficient& modulus = cg.modulus(); signed_distance = min_value % modulus; min_value -= signed_distance; - if (min_value * min_denom < min_numer) + if (min_value * min_denom < min_numer) { min_value += modulus; - + } // Find the position value for the hyperplane that satisfies the congruence // and is below the upper bound for the shape. PPL_DIRTY_TEMP_COEFFICIENT(max_value); max_value = max_numer / max_denom; signed_distance = max_value % modulus; max_value += signed_distance; - if (max_value * max_denom > max_numer) + if (max_value * max_denom > max_numer) { max_value -= modulus; - + } // If the upper bound value is less than the lower bound value, // then there is an empty intersection with the congruence; // otherwise it will strictly intersect. - if (max_value < min_value) + if (max_value < min_value) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } } @@ -79931,33 +82043,37 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dim) + if (c_space_dim > space_dim) { throw_dimension_incompatible("relation_with(c)", c); - + } shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); - + } if (space_dim == 0) { if ((c.is_equality() && c.inhomogeneous_term() != 0) - || (c.is_inequality() && c.inhomogeneous_term() < 0)) + || (c.is_inequality() && c.inhomogeneous_term() < 0)) { return Poly_Con_Relation::is_disjoint(); - else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) + } + else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) { // The constraint 0 > 0 implicitly defines the hyperplane 0 = 0; // thus, the zero-dimensional point also saturates it. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else if (c.is_equality() || c.inhomogeneous_term() == 0) + } + else if (c.is_equality() || c.inhomogeneous_term() == 0) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); - else + } + else { // The zero-dimensional point saturates // neither the positivity constraint 1 >= 0, // nor the strict positivity constraint 1 > 0. return Poly_Con_Relation::is_included(); + } } dimension_type num_vars = 0; @@ -79974,26 +82090,29 @@ Linear_Expression le(c.expression()); le.set_inhomogeneous_term(Coefficient_zero()); - PPL_DIRTY_TEMP(Coefficient, max_numer); - PPL_DIRTY_TEMP(Coefficient, max_denom); + PPL_DIRTY_TEMP_COEFFICIENT(max_numer); + PPL_DIRTY_TEMP_COEFFICIENT(max_denom); bool max_included; - PPL_DIRTY_TEMP(Coefficient, min_numer); - PPL_DIRTY_TEMP(Coefficient, min_denom); + PPL_DIRTY_TEMP_COEFFICIENT(min_numer); + PPL_DIRTY_TEMP_COEFFICIENT(min_denom); bool min_included; bool bounded_above = maximize(le, max_numer, max_denom, max_included); bool bounded_below = minimize(le, min_numer, min_denom, min_included); if (!bounded_above) { - if (!bounded_below) + if (!bounded_below) { return Poly_Con_Relation::strictly_intersects(); + } min_numer += c.inhomogeneous_term() * min_denom; switch (sgn(min_numer)) { case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::is_included(); case 0: - if (c.is_strict_inequality() || c.is_equality()) + if (c.is_strict_inequality() || c.is_equality()) { return Poly_Con_Relation::strictly_intersects(); + } return Poly_Con_Relation::is_included(); case -1: return Poly_Con_Relation::strictly_intersects(); @@ -80005,8 +82124,9 @@ case 1: return Poly_Con_Relation::strictly_intersects(); case 0: - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::strictly_intersects(); case -1: return Poly_Con_Relation::is_disjoint(); @@ -80019,14 +82139,17 @@ case 1: switch (sgn(min_numer)) { case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::is_included(); case 0: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::strictly_intersects(); - if (c.is_strict_inequality()) + } + if (c.is_strict_inequality()) { return Poly_Con_Relation::strictly_intersects(); + } return Poly_Con_Relation::is_included(); case -1: return Poly_Con_Relation::strictly_intersects(); @@ -80035,14 +82158,16 @@ break; case 0: if (min_numer == 0) { - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint() && Poly_Con_Relation::saturates(); + } return Poly_Con_Relation::is_included() && Poly_Con_Relation::saturates(); } - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } return Poly_Con_Relation::strictly_intersects(); case -1: return Poly_Con_Relation::is_disjoint(); @@ -80057,17 +82182,21 @@ case -1: return Poly_Con_Relation::is_disjoint(); case 0: - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } case 1: - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::is_included(); + } } } @@ -80076,8 +82205,9 @@ const bool negative = (coeff < 0); const N& x = negative ? dbm[i][j] : dbm[j][i]; const N& y = negative ? dbm[j][i] : dbm[i][j]; - if (negative) + if (negative) { neg_assign(coeff); + } // Deduce the relation/s of the constraint `c' of the form // `coeff*v - coeff*u d' (`-y >= d' if c is a strict equality), i.e. if // `y < d1' (`y <= d1' if c is a strict equality). - if (q_y < d1) + if (q_y < d1) { return Poly_Con_Relation::is_disjoint(); - if (q_y == d1 && c.is_strict_inequality()) + } + if (q_y == d1 && c.is_strict_inequality()) { return Poly_Con_Relation::is_disjoint(); + } } // Here `y' can be also plus-infinity. // If `c' is an equality, `*this' is disjoint from `c' if // `x < d'. if (d > q_x) { - if (c.is_equality()) + if (c.is_equality()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::is_included(); + } } - if (d == q_x && c.is_nonstrict_inequality()) + if (d == q_x && c.is_nonstrict_inequality()) { return Poly_Con_Relation::is_included(); - + } // In all other cases `*this' intersects `c'. return Poly_Con_Relation::strictly_intersects(); } @@ -80175,19 +82313,19 @@ const dimension_type g_space_dim = g.space_dimension(); // Dimension-compatibility check. - if (space_dim < g_space_dim) + if (space_dim < g_space_dim) { throw_dimension_incompatible("relation_with(g)", g); - + } shortest_path_closure_assign(); // The empty BDS cannot subsume a generator. - if (marked_empty()) + if (marked_empty()) { return Poly_Gen_Relation::nothing(); - + } // A universe BDS in a zero-dimensional space subsumes // all the generators of a zero-dimensional space. - if (space_dim == 0) + if (space_dim == 0) { return Poly_Gen_Relation::subsumes(); - + } const bool is_line = g.is_line(); const bool is_line_or_ray = g.is_line_or_ray(); @@ -80219,10 +82357,12 @@ product = g_coeff_y; product -= g_coeff_x; product *= denom; - if (!is_line_or_ray) + if (!is_line_or_ray) { add_mul_assign(product, numer, g.divisor()); - if (product != 0) + } + if (product != 0) { return Poly_Gen_Relation::nothing(); + } } else { // We have 0, 1 or 2 binary inequality constraint/s. @@ -80234,17 +82374,21 @@ product = g_coeff_y; product -= g_coeff_x; product *= denom; - if (!is_line_or_ray) + if (!is_line_or_ray) { add_mul_assign(product, numer, g.divisor()); + } if (is_line) { - if (product != 0) + if (product != 0) { // Lines must saturate all constraints. return Poly_Gen_Relation::nothing(); + } } - else + else { // `g' is either a ray, a point or a closure point. - if (product < 0) + if (product < 0) { return Poly_Gen_Relation::nothing(); + } + } } if (!is_plus_infinity(dbm_ji)) { @@ -80254,17 +82398,21 @@ product = 0; add_mul_assign(product, denom, g_coeff_x); add_mul_assign(product, -denom, g_coeff_y); - if (!is_line_or_ray) + if (!is_line_or_ray) { add_mul_assign(product, numer, g.divisor()); + } if (is_line) { - if (product != 0) + if (product != 0) { // Lines must saturate all constraints. return Poly_Gen_Relation::nothing(); + } } - else + else { // `g' is either a ray, a point or a closure point. - if (product < 0) + if (product < 0) { return Poly_Gen_Relation::nothing(); + } + } } } } @@ -80278,13 +82426,14 @@ void BD_Shape::shortest_path_closure_assign() const { // Do something only if necessary. - if (marked_empty() || marked_shortest_path_closed()) + if (marked_empty() || marked_shortest_path_closed()) { return; + } const dimension_type num_dimensions = space_dimension(); // Zero-dimensional BDSs are necessarily shortest-path closed. - if (num_dimensions == 0) + if (num_dimensions == 0) { return; - + } // Even though the BDS will not change, its internal representation // is going to be modified by the Floyd-Warshall algorithm. BD_Shape& x = const_cast&>(*this); @@ -80301,7 +82450,7 @@ for (dimension_type i = num_dimensions + 1; i-- > 0; ) { DB_Row& x_dbm_i = x.dbm[i]; const N& x_dbm_i_k = x_dbm_i[k]; - if (!is_plus_infinity(x_dbm_i_k)) + if (!is_plus_infinity(x_dbm_i_k)) { for (dimension_type j = num_dimensions + 1; j-- > 0; ) { const N& x_dbm_k_j = x_dbm_k[j]; if (!is_plus_infinity(x_dbm_k_j)) { @@ -80310,6 +82459,7 @@ min_assign(x_dbm_i[j], sum); } } + } } } @@ -80336,8 +82486,9 @@ void BD_Shape::incremental_shortest_path_closure_assign(Variable var) const { // Do something only if necessary. - if (marked_empty() || marked_shortest_path_closed()) + if (marked_empty() || marked_shortest_path_closed()) { return; + } const dimension_type num_dimensions = space_dimension(); PPL_ASSERT(var.id() < num_dimensions); @@ -80402,9 +82553,10 @@ } } } - else + else { // Here both x_v_k and x_k_v are infinite. continue; + } } // Step 2: improve the other bounds by using the precise bounds @@ -80446,21 +82598,21 @@ void BD_Shape::shortest_path_reduction_assign() const { // Do something only if necessary. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { return; - + } const dimension_type space_dim = space_dimension(); // Zero-dimensional BDSs are necessarily reduced. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // First find the tightest constraints for this BDS. shortest_path_closure_assign(); // If `*this' is empty, then there is nothing to reduce. - if (marked_empty()) + if (marked_empty()) { return; - + } // Step 1: compute zero-equivalence classes. // Variables corresponding to indices `i' and `j' are zero-equivalent // if they lie on a zero-weight loop; since the matrix is shortest-path @@ -80475,11 +82627,12 @@ // Init all constraints to be redundant. // TODO: provide an appropriate method to set multiple bits. Bit_Row& red_0 = redundancy[0]; - for (dimension_type j = space_dim + 1; j-- > 0; ) + for (dimension_type j = space_dim + 1; j-- > 0; ) { red_0.set(j); - for (dimension_type i = space_dim + 1; i-- > 0; ) + } + for (dimension_type i = space_dim + 1; i-- > 0; ) { redundancy[i] = red_0; - + } // Step 2: flag non-redundant constraints in the (zero-cycle-free) // subsystem of bounded differences having only leaders as variables. PPL_DIRTY_TEMP(N, c); @@ -80508,7 +82661,7 @@ // Each equivalence class must have a single 0-cycle connecting // all the equivalent variables in increasing order. std::deque dealt_with(space_dim + 1, false); - for (dimension_type i = space_dim + 1; i-- > 0; ) + for (dimension_type i = space_dim + 1; i-- > 0; ) { // We only need to deal with non-singleton zero-equivalence classes // that haven't already been dealt with. if (i != predecessor[i] && !dealt_with[i]) { @@ -80530,7 +82683,7 @@ j = predecessor_j; } } - + } // Even though shortest-path reduction is not going to change the BDS, // it might change its internal representation. BD_Shape& x = const_cast&>(*this); @@ -80547,13 +82700,14 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("upper_bound_assign(y)", y); - + } // The upper bound of a BD shape `bd' with an empty shape is `bd'. y.shortest_path_closure_assign(); - if (y.marked_empty()) + if (y.marked_empty()) { return; + } shortest_path_closure_assign(); if (marked_empty()) { *this = y; @@ -80569,14 +82723,16 @@ for (dimension_type j = space_dim + 1; j-- > 0; ) { N& dbm_ij = dbm_i[j]; const N& y_dbm_ij = y_dbm_i[j]; - if (dbm_ij < y_dbm_ij) + if (dbm_ij < y_dbm_ij) { dbm_ij = y_dbm_ij; + } } } // Shortest-path closure is maintained (if it was holding). // TODO: see whether reduction can be (efficiently!) maintained too. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } PPL_ASSERT(OK()); } @@ -80600,8 +82756,9 @@ *this = y; return true; } - else if (y.is_empty()) + else if (y.is_empty()) { return true; + } else if (x.is_empty()) { *this = y; return true; @@ -80633,23 +82790,28 @@ const DB_Row& x_dbm_i = x.dbm[i]; const DB_Row& y_dbm_i = y.dbm[i]; for (dimension_type j = x_space_dim + 1; j-- > 0; ) { - if (x_red_i[j] && y_red_i[j]) + if (x_red_i[j] && y_red_i[j]) { continue; + } if (!x_red_i[j]) { const N& x_dbm_ij = x_dbm_i[j]; PPL_ASSERT(!is_plus_infinity(x_dbm_ij)); numer_denom(x_dbm_ij, numer, denom); // Build skeleton DB constraint (having the right space dimension). db_expr = zero_expr; - if (i > 0) + if (i > 0) { db_expr += Variable(i-1); - if (j > 0) + } + if (j > 0) { db_expr -= Variable(j-1); - if (denom != 1) + } + if (denom != 1) { db_expr *= denom; + } db_expr += numer; - if (x_dbm_ij >= y_dbm_i[j]) + if (x_dbm_ij >= y_dbm_i[j]) { env_cs.insert(db_expr >= 0); + } else { db_expr += epsilon; x_cs_removed.insert(db_expr == 0); @@ -80662,17 +82824,21 @@ numer_denom(y_dbm_ij, numer, denom); // Build skeleton DB constraint (having the right space dimension). db_expr = zero_expr; - if (i > 0) + if (i > 0) { db_expr += Variable(i-1); - if (j > 0) + } + if (j > 0) { db_expr -= Variable(j-1); - if (denom != 1) + } + if (denom != 1) { db_expr *= denom; + } db_expr += numer; if (y_dbm_ij >= x_dbm_ij) { // Check if same constraint was added when considering x_dbm_ij. - if (!x_red_i[j] && x_dbm_ij == y_dbm_ij) + if (!x_red_i[j] && x_dbm_ij == y_dbm_ij) { continue; + } env_cs.insert(db_expr >= 0); } else { @@ -80683,9 +82849,10 @@ } } - if (x_cs_removed.empty()) + if (x_cs_removed.empty()) { // No constraint of x was removed: y is included in x. return true; + } if (y_cs_removed.empty()) { // No constraint of y was removed: x is included in y. *this = y; @@ -80706,8 +82873,9 @@ MIP_Problem lp_i(env_lp); lp_i.add_constraint(*i); // Pre-solve to exploit incrementality. - if (lp_i.solve() == UNFEASIBLE_MIP_PROBLEM) + if (lp_i.solve() == UNFEASIBLE_MIP_PROBLEM) { continue; + } for (Constraint_System::const_iterator j = y_cs_removed.begin(), j_end = y_cs_removed.end(); j != j_end; ++j) { MIP_Problem lp_ij(lp_i); @@ -80722,8 +82890,9 @@ return false; case OPTIMIZED_MIP_PROBLEM: lp_ij.optimal_value(numer, denom); - if (numer > 0) + if (numer > 0) { return false; + } break; } } @@ -80763,8 +82932,9 @@ *this = y; return true; } - else if (y.is_empty()) + else if (y.is_empty()) { return true; + } else if (x.is_empty()) { *this = y; return true; @@ -80784,9 +82954,9 @@ PPL_DIRTY_TEMP(N, temp_zero); assign_r(temp_zero, 0, ROUND_NOT_NEEDED); PPL_DIRTY_TEMP(N, temp_one); - if (integer_upper_bound) + if (integer_upper_bound) { assign_r(temp_one, 1, ROUND_NOT_NEEDED); - + } for (dimension_type i = x_space_dim + 1; i-- > 0; ) { const DB_Row& x_i = x.dbm[i]; const Bit_Row& x_red_i = x.redundancy_dbm[i]; @@ -80794,8 +82964,9 @@ const DB_Row& ub_i = ub.dbm[i]; for (dimension_type j = x_space_dim + 1; j-- > 0; ) { // Check redundancy of x_i_j. - if (x_red_i[j]) + if (x_red_i[j]) { continue; + } // By non-redundancy, we know that i != j. PPL_ASSERT(i != j); const N& x_i_j = x_i[j]; @@ -80808,8 +82979,9 @@ const N& ub_k_j = (k == j) ? temp_zero : ub_k[j]; for (dimension_type ell = x_space_dim + 1; ell-- > 0; ) { // Check redundancy of y_k_ell. - if (y_red_k[ell]) + if (y_red_k[ell]) { continue; + } // By non-redundancy, we know that k != ell. PPL_ASSERT(k != ell); const N& y_k_ell = y_k[ell]; @@ -80825,8 +82997,9 @@ add_assign_r(lhs, lhs, temp_one, ROUND_NOT_NEEDED); } // Testing for < in both the rational and integer case. - if (lhs < rhs) + if (lhs < rhs) { return false; + } } } } @@ -80845,9 +83018,9 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("difference_assign(y)", y); - + } BD_Shape new_bd_shape(space_dim, EMPTY); BD_Shape& x = *this; @@ -80855,14 +83028,15 @@ x.shortest_path_closure_assign(); // The difference of an empty bounded difference shape // and of a bounded difference shape `p' is empty. - if (x.marked_empty()) + if (x.marked_empty()) { return; + } y.shortest_path_closure_assign(); // The difference of a bounded difference shape `p' // and an empty bounded difference shape is `p'. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } // If both bounded difference shapes are zero-dimensional, // then at this point they are necessarily universe system of // bounded differences, so that their difference is empty. @@ -80891,18 +83065,21 @@ // would result in the empty bounded difference shape, // and as we would obtain a result that is less precise // than the bds-difference. - if (x.relation_with(c).implies(Poly_Con_Relation::is_included())) + if (x.relation_with(c).implies(Poly_Con_Relation::is_included())) { continue; + } BD_Shape z = x; const Linear_Expression e(c.expression()); z.add_constraint(e <= 0); - if (!z.is_empty()) + if (!z.is_empty()) { new_bd_shape.upper_bound_assign(z); + } if (c.is_equality()) { z = x; z.add_constraint(e >= 0); - if (!z.is_empty()) + if (!z.is_empty()) { new_bd_shape.upper_bound_assign(z); + } } } *this = new_bd_shape; @@ -80915,17 +83092,18 @@ BD_Shape& x = *this; const dimension_type dim = x.space_dimension(); // Dimension-compatibility check. - if (dim != y.space_dimension()) + if (dim != y.space_dimension()) { throw_dimension_incompatible("simplify_using_context_assign(y)", y); - + } // Filter away the zero-dimensional case. if (dim == 0) { if (y.marked_empty()) { x.set_zero_dim_univ(); return false; } - else + else { return !x.marked_empty(); + } } // Filter away the case where `x' contains `y' @@ -80947,29 +83125,33 @@ i = 0; const DB_Row& y_dbm_0 = y.dbm[0]; for (j = 1; j <= dim; ++j) { - if (!is_plus_infinity(y_dbm_0[j])) + if (!is_plus_infinity(y_dbm_0[j])) { // FIXME: if N is a float or bounded integer type, then // we also need to check that we are actually able to construct // a constraint inconsistent with respect to this one. goto found; + } } j = 0; for (i = 1; i <= dim; ++i) { - if (!is_plus_infinity(y.dbm[i][0])) + if (!is_plus_infinity(y.dbm[i][0])) { // FIXME: if N is a float or bounded integer type, then // we also need to check that we are actually able to construct // a constraint inconsistent with respect to this one. goto found; + } } // Then search binary constraints. for (i = 1; i <= dim; ++i) { const DB_Row& y_dbm_i = y.dbm[i]; - for (j = 1; j <= dim; ++j) - if (!is_plus_infinity(y_dbm_i[j])) + for (j = 1; j <= dim; ++j) { + if (!is_plus_infinity(y_dbm_i[j])) { // FIXME: if N is a float or bounded integer type, then // we also need to check that we are actually able to construct // a constraint inconsistent with respect to this one. goto found; + } + } } // Not found: we were not able to build a constraint contradicting // one of the constraints in `y': `x' cannot be enlarged. @@ -81000,8 +83182,9 @@ x.shortest_path_reduction_assign(); // ... count the non-redundant constraints. dimension_type x_num_non_redundant = (dim+1)*(dim+1); - for (dimension_type i = dim + 1; i-- > 0; ) + for (dimension_type i = dim + 1; i-- > 0; ) { x_num_non_redundant -= x.redundancy_dbm[i].count_ones(); + } PPL_ASSERT(x_num_non_redundant > 0); // Let `yy' be a copy of `y': we will keep adding to `yy' @@ -81025,8 +83208,9 @@ for (dimension_type j = 1; j <= dim; ++j) { // Unary equality constraints are encoded in entries dbm_0j and dbm_j0 // provided index j has special variable index 0 as its leader. - if (x_leaders[j] != 0) + if (x_leaders[j] != 0) { continue; + } PPL_ASSERT(!is_plus_infinity(x_dbm_0[j])); if (x_dbm_0[j] < yy_dbm_0[j]) { res_dbm_0[j] = x_dbm_0[j]; @@ -81062,8 +83246,9 @@ // Note: no need to consider the case i == 1. for (dimension_type i = 2; i <= dim; ++i) { const dimension_type j = x_leaders[i]; - if (j == i || j == 0) + if (j == i || j == 0) { continue; + } PPL_ASSERT(!is_plus_infinity(x.dbm[i][j])); if (x.dbm[i][j] < yy.dbm[i][j]) { res.dbm[i][j] = x.dbm[i][j]; @@ -81098,15 +83283,17 @@ // Finally go through the (proper) inequality constraints: // both indices i and j should be leaders. for (dimension_type i = 0; i <= dim; ++i) { - if (i != x_leaders[i]) + if (i != x_leaders[i]) { continue; + } const DB_Row& x_dbm_i = x.dbm[i]; const Bit_Row& x_redundancy_dbm_i = x.redundancy_dbm[i]; DB_Row& yy_dbm_i = yy.dbm[i]; DB_Row& res_dbm_i = res.dbm[i]; for (dimension_type j = 0; j <= dim; ++j) { - if (j != x_leaders[j] || x_redundancy_dbm_i[j]) + if (j != x_leaders[j] || x_redundancy_dbm_i[j]) { continue; + } N& yy_dbm_ij = yy_dbm_i[j]; const N& x_dbm_ij = x_dbm_i[j]; if (x_dbm_ij < yy_dbm_ij) { @@ -81138,9 +83325,9 @@ void BD_Shape::add_space_dimensions_and_embed(const dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; - + } const dimension_type space_dim = space_dimension(); const dimension_type new_space_dim = space_dim + m; const bool was_zero_dim_univ = (!marked_empty() && space_dim == 0); @@ -81152,14 +83339,14 @@ // Shortest-path closure is maintained (if it was holding). // TODO: see whether reduction can be (efficiently!) maintained too. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - + } // If `*this' was the zero-dim space universe BDS, // the we can set the shortest-path closure flag. - if (was_zero_dim_univ) + if (was_zero_dim_univ) { set_shortest_path_closed(); - + } PPL_ASSERT(OK()); } @@ -81167,9 +83354,9 @@ void BD_Shape::add_space_dimensions_and_project(const dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; - + } const dimension_type space_dim = space_dimension(); // If `*this' was zero-dimensional, then we add `m' rows and columns. @@ -81180,9 +83367,11 @@ if (!marked_empty()) { for (dimension_type i = m + 1; i-- > 0; ) { DB_Row& dbm_i = dbm[i]; - for (dimension_type j = m + 1; j-- > 0; ) - if (i != j) + for (dimension_type j = m + 1; j-- > 0; ) { + if (i != j) { assign_r(dbm_i[j], 0, ROUND_NOT_NEEDED); + } + } } set_shortest_path_closed(); } @@ -81204,8 +83393,9 @@ assign_r(dbm_0[i], 0, ROUND_NOT_NEEDED); } - if (marked_shortest_path_closed()) + if (marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -81224,9 +83414,9 @@ // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (old_space_dim < min_space_dim) + if (old_space_dim < min_space_dim) { throw_dimension_incompatible("remove_space_dimensions(vs)", min_space_dim); - + } // Shortest-path closure is necessary to keep precision. shortest_path_closure_assign(); @@ -81235,9 +83425,10 @@ const dimension_type new_space_dim = old_space_dim - vars.size(); if (new_space_dim == 0) { dbm.resize_no_copy(1); - if (!marked_empty()) + if (!marked_empty()) { // We set the zero_dim_univ flag. set_zero_dim_univ(); + } PPL_ASSERT(OK()); return; } @@ -81251,9 +83442,9 @@ // Shortest-path closure is maintained. // TODO: see whether reduction can be (efficiently!) maintained too. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - + } // For each variable to remove, we fill the corresponding column and // row by shifting respectively left and above those // columns and rows, that will not be removed. @@ -81301,9 +83492,9 @@ BD_Shape::map_space_dimensions(const Partial_Function& pfunc) { const dimension_type space_dim = space_dimension(); // TODO: this implementation is just an executable specification. - if (space_dim == 0) + if (space_dim == 0) { return; - + } if (pfunc.has_empty_codomain()) { // All dimensions vanish: the BDS becomes zero_dimensional. remove_higher_space_dimensions(0); @@ -81313,9 +83504,9 @@ const dimension_type new_space_dim = pfunc.max_in_codomain() + 1; // If we are going to actually reduce the space dimension, // then shortest-path closure is required to keep precision. - if (new_space_dim < space_dim) + if (new_space_dim < space_dim) { shortest_path_closure_assign(); - + } // If the BDS is empty, then it is sufficient to adjust the // space dimension of the bounded difference shape. if (marked_empty()) { @@ -81325,9 +83516,9 @@ // Shortest-path closure is maintained (if it was holding). // TODO: see whether reduction can be (efficiently!) maintained too. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - + } // We create a new matrix with the new space dimension. DB_Matrix x(new_space_dim+1); // First of all we must map the unary constraints, because @@ -81371,13 +83562,14 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("intersection_assign(y)", y); - + } // If one of the two bounded difference shapes is empty, // the intersection is empty. - if (marked_empty()) + if (marked_empty()) { return; + } if (y.marked_empty()) { set_empty(); return; @@ -81386,9 +83578,9 @@ // If both bounded difference shapes are zero-dimensional, // then at this point they are necessarily non-empty, // so that their intersection is non-empty too. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // To intersect two bounded difference shapes we compare // the constraints and we choose the less values. bool changed = false; @@ -81405,8 +83597,9 @@ } } - if (changed && marked_shortest_path_closed()) + if (changed && marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -81419,33 +83612,35 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("CC76_extrapolation_assign(y)", y); - + } // We assume that `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If both bounded difference shapes are zero-dimensional, // since `*this' contains `y', we simply return `*this'. - if (space_dim == 0) + if (space_dim == 0) { return; - + } shortest_path_closure_assign(); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } y.shortest_path_closure_assign(); // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } // If there are tokens available, work on a temporary copy. if (tp != 0 && *tp > 0) { BD_Shape x_tmp(*this); x_tmp.CC76_extrapolation_assign(y, first, last, 0); // If the widening was not precise, use one of the available tokens. - if (!contains(x_tmp)) + if (!contains(x_tmp)) { --(*tp); + } return; } @@ -81466,11 +83661,13 @@ if (y_dbm_ij < dbm_ij) { Iterator k = std::lower_bound(first, last, dbm_ij); if (k != last) { - if (dbm_ij < *k) + if (dbm_ij < *k) { assign_r(dbm_ij, *k, ROUND_UP); + } } - else + else { assign_r(dbm_ij, PLUS_INFINITY, ROUND_NOT_NEEDED); + } } } } @@ -81505,8 +83702,9 @@ const N& x = negative ? dbm[i][j] : dbm[j][i]; const N& y = negative ? dbm[j][i] : dbm[i][j]; DB_Matrix& ls_dbm = limiting_shape.dbm; - if (negative) + if (negative) { neg_assign(coeff); + } // Compute the bound for `x', rounding towards plus infinity. div_round_up(d, c.inhomogeneous_term(), coeff); if (x <= d) { @@ -81537,8 +83735,9 @@ // In general, adding a constraint does not preserve the shortest-path // closure of the bounded difference shape. - if (changed && limiting_shape.marked_shortest_path_closed()) + if (changed && limiting_shape.marked_shortest_path_closed()) { limiting_shape.reset_shortest_path_closed(); + } } template @@ -81548,38 +83747,40 @@ unsigned* tp) { // Dimension-compatibility check. const dimension_type space_dim = space_dimension(); - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("limited_CC76_extrapolation_assign(y, cs)", y); - + } // `cs' must be dimension-compatible with the two systems // of bounded differences. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_invalid_argument("limited_CC76_extrapolation_assign(y, cs)", "cs is space_dimension incompatible"); + } // Strict inequalities not allowed. - if (cs.has_strict_inequalities()) + if (cs.has_strict_inequalities()) { throw_invalid_argument("limited_CC76_extrapolation_assign(y, cs)", "cs has strict inequalities"); - + } // The limited CC76-extrapolation between two systems of bounded // differences in a zero-dimensional space is a system of bounded // differences in a zero-dimensional space, too. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // We assume that `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } BD_Shape limiting_shape(space_dim, UNIVERSE); get_limiting_shape(cs, limiting_shape); CC76_extrapolation_assign(y, tp); @@ -81592,9 +83793,9 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("BHMZ05_widening_assign(y)", y); - + } // We assume that `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); @@ -81603,23 +83804,24 @@ // If the affine dimension of `y' is zero, then either `y' is // zero-dimensional, or it is empty, or it is a singleton. // In all cases, due to the inclusion hypothesis, the result is `*this'. - if (y_affine_dim == 0) + if (y_affine_dim == 0) { return; - + } // If the affine dimension has changed, due to the inclusion hypothesis, // the result is `*this'. const dimension_type x_affine_dim = affine_dimension(); PPL_ASSERT(x_affine_dim >= y_affine_dim); - if (x_affine_dim != y_affine_dim) + if (x_affine_dim != y_affine_dim) { return; - + } // If there are tokens available, work on a temporary copy. if (tp != 0 && *tp > 0) { BD_Shape x_tmp(*this); x_tmp.BHMZ05_widening_assign(y, 0); // If the widening was not precise, use one of the available tokens. - if (!contains(x_tmp)) + if (!contains(x_tmp)) { --(*tp); + } return; } @@ -81638,8 +83840,9 @@ // Note: in the following line the use of `!=' (as opposed to // the use of `<' that would seem -but is not- equivalent) is // intentional. - if (y_redundancy_i[j] || y_dbm_i[j] != dbm_ij) + if (y_redundancy_i[j] || y_dbm_i[j] != dbm_ij) { assign_r(dbm_ij, PLUS_INFINITY, ROUND_NOT_NEEDED); + } } } // NOTE: this will also reset the shortest-path reduction flag, @@ -81657,37 +83860,39 @@ unsigned* tp) { // Dimension-compatibility check. const dimension_type space_dim = space_dimension(); - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("limited_BHMZ05_extrapolation_assign(y, cs)", y); + } // `cs' must be dimension-compatible with the two systems // of bounded differences. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_invalid_argument("limited_BHMZ05_extrapolation_assign(y, cs)", "cs is space-dimension incompatible"); - + } // Strict inequalities are not allowed. - if (cs.has_strict_inequalities()) + if (cs.has_strict_inequalities()) { throw_invalid_argument("limited_BHMZ05_extrapolation_assign(y, cs)", "cs has strict inequalities"); - + } // The limited BHMZ05-extrapolation between two systems of bounded // differences in a zero-dimensional space is a system of bounded // differences in a zero-dimensional space, too. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // We assume that `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } BD_Shape limiting_shape(space_dim, UNIVERSE); get_limiting_shape(cs, limiting_shape); BHMZ05_widening_assign(y, tp); @@ -81700,26 +83905,27 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("CC76_narrowing_assign(y)", y); - + } // We assume that `*this' is contained in or equal to `y'. PPL_EXPECT_HEAVY(copy_contains(y, *this)); // If both bounded difference shapes are zero-dimensional, // since `y' contains `*this', we simply return `*this'. - if (space_dim == 0) + if (space_dim == 0) { return; - + } y.shortest_path_closure_assign(); // If `y' is empty, since `y' contains `this', `*this' is empty too. - if (y.marked_empty()) + if (y.marked_empty()) { return; + } shortest_path_closure_assign(); // If `*this' is empty, we return. - if (marked_empty()) + if (marked_empty()) { return; - + } // Replace each constraint in `*this' by the corresponding constraint // in `y' if the corresponding inhomogeneous terms are both finite. bool changed = false; @@ -81737,8 +83943,9 @@ } } } - if (changed && marked_shortest_path_closed()) + if (changed && marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -81771,15 +83978,18 @@ for (Linear_Expression::const_iterator u = sc_expr.begin(), u_end = sc_expr.lower_bound(Variable(last_v)); u != u_end; ++u) { const dimension_type u_dim = u.variable().space_dimension(); - if (u_dim == v) + if (u_dim == v) { continue; + } const Coefficient& expr_u = *u; - if (expr_u < 0) + if (expr_u < 0) { continue; + } PPL_ASSERT(expr_u > 0); - if (expr_u >= sc_denom) + if (expr_u >= sc_denom) { // Deducing `v - u <= ub_v - ub_u'. sub_assign_r(dbm[u_dim][v], ub_v, dbm_0[u_dim], ROUND_UP); + } else { DB_Row& dbm_u = dbm[u_dim]; const N& dbm_u0 = dbm_u[0]; @@ -81838,16 +84048,19 @@ u_end = sc_expr.lower_bound(Variable(last_v)); u != u_end; ++u) { const Variable u_var = u.variable(); const dimension_type u_dim = u_var.space_dimension(); - if (u_var.space_dimension() == v) + if (u_var.space_dimension() == v) { continue; + } const Coefficient& expr_u = *u; - if (expr_u < 0) + if (expr_u < 0) { continue; + } PPL_ASSERT(expr_u > 0); - if (expr_u >= sc_denom) + if (expr_u >= sc_denom) { // Deducing `u - v <= lb_u - lb_v', // i.e., `u - v <= (-lb_v) - (-lb_u)'. sub_assign_r(dbm_v[u_dim], minus_lb_v, dbm[u_dim][0], ROUND_UP); + } else { const N& dbm_0u = dbm_0[u_dim]; if (!is_plus_infinity(dbm_0u)) { @@ -81900,17 +84113,17 @@ BD_Shape::unconstrain(const Variable var) { // Dimension-compatibility check. const dimension_type var_space_dim = var.space_dimension(); - if (space_dimension() < var_space_dim) + if (space_dimension() < var_space_dim) { throw_dimension_incompatible("unconstrain(var)", var_space_dim); - + } // Shortest-path closure is necessary to detect emptiness // and all (possibly implicit) constraints. shortest_path_closure_assign(); // If the shape is empty, this is a no-op. - if (marked_empty()) + if (marked_empty()) { return; - + } forget_all_dbm_constraints(var_space_dim); // Shortest-path closure is preserved, but not reduction. reset_shortest_path_reduced(); @@ -81922,25 +84135,26 @@ BD_Shape::unconstrain(const Variables_Set& vars) { // The cylindrification with respect to no dimensions is a no-op. // This case captures the only legal cylindrification in a 0-dim space. - if (vars.empty()) + if (vars.empty()) { return; - + } // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("unconstrain(vs)", min_space_dim); - + } // Shortest-path closure is necessary to detect emptiness // and all (possibly implicit) constraints. shortest_path_closure_assign(); // If the shape is empty, this is a no-op. - if (marked_empty()) + if (marked_empty()) { return; - + } for (Variables_Set::const_iterator vsi = vars.begin(), - vsi_end = vars.end(); vsi != vsi_end; ++vsi) + vsi_end = vars.end(); vsi != vsi_end; ++vsi) { forget_all_dbm_constraints(*vsi + 1); + } // Shortest-path closure is preserved, but not reduction. reset_shortest_path_reduced(); PPL_ASSERT(OK()); @@ -81968,8 +84182,9 @@ if (w != 0) { ++t; - if (!expr.all_zeroes(1, w)) + if (!expr.all_zeroes(1, w)) { ++t; + } } // Since we are only able to record bounded differences, we can @@ -81977,9 +84192,9 @@ // coefficient (taking into account the denominator) is 1. // If this is not the case, we fall back to the general case // so as to over-approximate the constraint. - if (t == 1 && expr.get(Variable(w - 1)) != denominator) + if (t == 1 && expr.get(Variable(w - 1)) != denominator) { t = 2; - + } // Now we know the form of `expr': // - If t == 0, then expr == b, with `b' a constant; // - If t == 1, then expr == a*w + b, where `w != v' and `a == denominator'; @@ -82060,8 +84275,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, sum); @@ -82105,8 +84321,9 @@ // Approximating `sc_expr'. if (pinf_count <= 1) { const N& approx_i = dbm_0[i_dim]; - if (!is_plus_infinity(approx_i)) + if (!is_plus_infinity(approx_i)) { add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP); + } else { ++pinf_count; pinf_index = i_dim; @@ -82115,8 +84332,9 @@ // Approximating `-sc_expr'. if (neg_pinf_count <= 1) { const N& approx_minus_i = dbm[i_dim][0]; - if (!is_plus_infinity(approx_minus_i)) + if (!is_plus_infinity(approx_minus_i)) { add_mul_assign_r(neg_sum, coeff_i, approx_minus_i, ROUND_UP); + } else { ++neg_pinf_count; neg_pinf_index = i_dim; @@ -82131,8 +84349,9 @@ // Approximating `sc_expr'. if (pinf_count <= 1) { const N& approx_minus_i = dbm[i_dim][0]; - if (!is_plus_infinity(approx_minus_i)) + if (!is_plus_infinity(approx_minus_i)) { add_mul_assign_r(sum, coeff_i, approx_minus_i, ROUND_UP); + } else { ++pinf_count; pinf_index = i_dim; @@ -82141,8 +84360,9 @@ // Approximating `-sc_expr'. if (neg_pinf_count <= 1) { const N& approx_i = dbm_0[i_dim]; - if (!is_plus_infinity(approx_i)) + if (!is_plus_infinity(approx_i)) { add_mul_assign_r(neg_sum, coeff_i, approx_i, ROUND_UP); + } else { ++neg_pinf_count; neg_pinf_index = i_dim; @@ -82170,8 +84390,9 @@ // Exploit the upper approximation, if possible. if (pinf_count <= 1) { // Compute quotient (if needed). - if (down_sc_denom != 1) + if (down_sc_denom != 1) { div_assign_r(sum, sum, down_sc_denom, ROUND_UP); + } // Add the upper bound constraint, if meaningful. if (pinf_count == 0) { // Add the constraint `v <= sum'. @@ -82179,19 +84400,22 @@ // Deduce constraints of the form `v - u', where `u != v'. deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, sum); } - else + else { // Here `pinf_count == 1'. if (pinf_index != v - && sc_expr.get(Variable(pinf_index - 1)) == sc_denom) + && sc_expr.get(Variable(pinf_index - 1)) == sc_denom) { // Add the constraint `v - pinf_index <= sum'. dbm[pinf_index][v] = sum; + } + } } // Exploit the lower approximation, if possible. if (neg_pinf_count <= 1) { // Compute quotient (if needed). - if (down_sc_denom != 1) + if (down_sc_denom != 1) { div_assign_r(neg_sum, neg_sum, down_sc_denom, ROUND_UP); + } // Add the lower bound constraint, if meaningful. if (neg_pinf_count == 0) { // Add the constraint `v >= -neg_sum', i.e., `-v <= neg_sum'. @@ -82200,13 +84424,13 @@ // Deduce constraints of the form `u - v', where `u != v'. deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, neg_sum); } - else - // Here `neg_pinf_count == 1'. - if (neg_pinf_index != v - && sc_expr.get(Variable(neg_pinf_index - 1)) == sc_denom) + // Here `neg_pinf_count == 1'. + else if (neg_pinf_index != v + && sc_expr.get(Variable(neg_pinf_index - 1)) == sc_denom) { // Add the constraint `v - neg_pinf_index >= -neg_sum', // i.e., `neg_pinf_index - v <= neg_sum'. dbm[v][neg_pinf_index] = neg_sum; + } } } break; @@ -82230,13 +84454,15 @@ // Choose carefully: we are approximating `sc_expr'. const N& approx_i = (sign_i > 0) ? dbm_0[i_dim] : dbm[i_dim][0]; if (is_plus_infinity(approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = i_dim; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -82262,10 +84488,12 @@ // Deduce constraints of the form `v - u', where `u != v'. deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) - if (expr.get(Variable(pinf_index - 1)) == denominator) + else if (pinf_count == 1) { + if (expr.get(Variable(pinf_index - 1)) == denominator) { // Add the constraint `v - pinf_index <= sum'. add_dbm_constraint(pinf_index, v, sum); + } + } break; case GREATER_OR_EQUAL: @@ -82286,13 +84514,15 @@ // Choose carefully: we are approximating `-sc_expr'. const N& approx_i = (sign_i > 0) ? dbm[i_dim][0] : dbm_0[i_dim]; if (is_plus_infinity(approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = i_dim; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -82318,12 +84548,14 @@ // Deduce constraints of the form `u - v', where `u != v'. deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) + else if (pinf_count == 1) { if (pinf_index != v - && expr.get(Variable(pinf_index - 1)) == denominator) + && expr.get(Variable(pinf_index - 1)) == denominator) { // Add the constraint `v - pinf_index >= -sum', // i.e., `pinf_index - v <= sum'. add_dbm_constraint(v, pinf_index, sum); + } + } break; default: @@ -82341,27 +84573,27 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_image(v, e, d)", "d == 0"); - + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "e", expr); - + } // `var' should be one of the dimensions of the shape. const dimension_type v = var.id() + 1; - if (v > space_dim) + if (v > space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", var.id()); - + } // The image of an empty BDS is empty too. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } const Coefficient& b = expr.inhomogeneous_term(); // Number of non-zero coefficients in `expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -82371,8 +84603,9 @@ if (w != 0) { ++t; - if (!expr.all_zeroes(1, w)) + if (!expr.all_zeroes(1, w)) { ++t; + } } // Now we know the form of `expr': @@ -82390,8 +84623,9 @@ // Remove all constraints on `var'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } // Add the constraint `var == b/denominator'. add_dbm_constraint(0, v, b, denominator); add_dbm_constraint(v, 0, b, minus_denom); @@ -82407,9 +84641,10 @@ if (w == v) { // `expr' is of the form: a*v + b. if (a == denominator) { - if (b == 0) + if (b == 0) { // The transformation is the identity function. return; + } else { // Translate all the constraints on `var', // adding or subtracting the value `b/denominator'. @@ -82456,8 +84691,9 @@ // Remove all constraints on `var'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } if (a == denominator) { // Add the new constraint `v - w == b/denominator'. add_dbm_constraint(w, v, b, denominator); @@ -82513,8 +84749,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, pos_sum); @@ -82548,8 +84785,9 @@ // Approximating `sc_expr'. if (pos_pinf_count <= 1) { const N& up_approx_i = dbm_0[i_dim]; - if (!is_plus_infinity(up_approx_i)) + if (!is_plus_infinity(up_approx_i)) { add_mul_assign_r(pos_sum, coeff_i, up_approx_i, ROUND_UP); + } else { ++pos_pinf_count; pos_pinf_index = i_dim; @@ -82558,8 +84796,9 @@ // Approximating `-sc_expr'. if (neg_pinf_count <= 1) { const N& up_approx_minus_i = dbm[i_dim][0]; - if (!is_plus_infinity(up_approx_minus_i)) + if (!is_plus_infinity(up_approx_minus_i)) { add_mul_assign_r(neg_sum, coeff_i, up_approx_minus_i, ROUND_UP); + } else { ++neg_pinf_count; neg_pinf_index = i_dim; @@ -82574,8 +84813,9 @@ // Approximating `sc_expr'. if (pos_pinf_count <= 1) { const N& up_approx_minus_i = dbm[i_dim][0]; - if (!is_plus_infinity(up_approx_minus_i)) + if (!is_plus_infinity(up_approx_minus_i)) { add_mul_assign_r(pos_sum, coeff_i, up_approx_minus_i, ROUND_UP); + } else { ++pos_pinf_count; pos_pinf_index = i_dim; @@ -82584,8 +84824,9 @@ // Approximating `-sc_expr'. if (neg_pinf_count <= 1) { const N& up_approx_i = dbm_0[i_dim]; - if (!is_plus_infinity(up_approx_i)) + if (!is_plus_infinity(up_approx_i)) { add_mul_assign_r(neg_sum, coeff_i, up_approx_i, ROUND_UP); + } else { ++neg_pinf_count; neg_pinf_index = i_dim; @@ -82597,8 +84838,9 @@ // Remove all constraints on 'v'. forget_all_dbm_constraints(v); // Shortest-path closure is maintained, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } // Return immediately if no approximation could be computed. if (pos_pinf_count > 1 && neg_pinf_count > 1) { PPL_ASSERT(OK()); @@ -82627,13 +84869,12 @@ dbm[0][v] = pos_sum; // Deduce constraints of the form `v - u', where `u != v'. deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, pos_sum); - } - else - // Here `pos_pinf_count == 1'. - if (pos_pinf_index != v - && sc_expr.get(Variable(pos_pinf_index - 1)) == sc_denom) + } // Here `pos_pinf_count == 1'. + else if (pos_pinf_index != v + && sc_expr.get(Variable(pos_pinf_index - 1)) == sc_denom) { // Add the constraint `v - pos_pinf_index <= pos_sum'. dbm[pos_pinf_index][v] = pos_sum; + } } // Exploit the lower approximation, if possible. @@ -82657,13 +84898,13 @@ // Deduce constraints of the form `u - v', where `u != v'. deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, neg_sum); } - else - // Here `neg_pinf_count == 1'. - if (neg_pinf_index != v - && sc_expr.get(Variable(neg_pinf_index - 1)) == sc_denom) + // Here `neg_pinf_count == 1'. + else if (neg_pinf_index != v + && sc_expr.get(Variable(neg_pinf_index - 1)) == sc_denom) { // Add the constraint `v - neg_pinf_index >= -neg_sum', // i.e., `neg_pinf_index - v <= neg_sum'. dbm[v][neg_pinf_index] = neg_sum; + } } PPL_ASSERT(OK()); @@ -82685,33 +84926,35 @@ // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type lf_space_dim = lf.space_dimension(); - if (space_dim < lf_space_dim) + if (space_dim < lf_space_dim) { throw_dimension_incompatible("affine_form_image(var_id, l)", "l", lf); - + } // `var' should be one of the dimensions of the shape. const dimension_type var_id = var.id() + 1; - if (space_dim < var_id) + if (space_dim < var_id) { throw_dimension_incompatible("affine_form_image(var_id, l)", var.id()); - + } // The image of an empty BDS is empty too. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } // Number of non-zero coefficients in `lf': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type t = 0; // Index of the last non-zero coefficient in `lf', if any. dimension_type w_id = 0; // Get information about the number of non-zero coefficients in `lf'. - for (dimension_type i = lf_space_dim; i-- > 0; ) + for (dimension_type i = lf_space_dim; i-- > 0; ) { if (lf.coefficient(Variable(i)) != 0) { - if (t++ == 1) + if (t++ == 1) { break; - else + } + else { w_id = i + 1; + } } - + } typedef Interval FP_Interval_Type; const FP_Interval_Type& b = lf.inhomogeneous_term(); @@ -82754,12 +84997,13 @@ // Remove all constraints on `var'. forget_all_dbm_constraints(var_id); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - // Add the constraint `var >= lb && var <= ub'. - add_dbm_constraint(0, var_id, b_ub); - add_dbm_constraint(var_id, 0, b_mlb); - return; + } + // Add the constraint `var >= lb && var <= ub'. + add_dbm_constraint(0, var_id, b_ub); + add_dbm_constraint(var_id, 0, b_mlb); + return; } // case 2: var = (+/-1) * w + [-b_mlb, b_ub], where `w' can be `var' @@ -82786,9 +85030,10 @@ bool is_b_zero = (b_mlb == 0 && b_ub == 0); // Here `lf' is of the form: [+/-1, +/-1] * v + b. if (is_w_coeff_one) { - if (is_b_zero) + if (is_b_zero) { // The transformation is the identity function. return; + } else { // Translate all the constraints on `var' by adding the value // `b_ub' or subtracting the value `b_mlb'. @@ -82826,8 +85071,9 @@ // Remove all constraints on `var'. forget_all_dbm_constraints(var_id); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } if (is_w_coeff_one) { // Add the new constraints `var - w >= b_mlb' // `and var - w <= b_ub'. @@ -82865,9 +85111,9 @@ const Linear_Form< Interval >& lf, const dimension_type& space_dim) { // Shortest-path closure is maintained, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - + } reset_shortest_path_closed(); Linear_Form< Interval > minus_lf(lf); @@ -82919,15 +85165,15 @@ // dimension of `*this'. const dimension_type left_space_dim = left.space_dimension(); const dimension_type space_dim = space_dimension(); - if (space_dim < left_space_dim) + if (space_dim < left_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(left, right)", "left", left); - + } const dimension_type right_space_dim = right.space_dimension(); - if (space_dim < right_space_dim) + if (space_dim < right_space_dim) { throw_dimension_incompatible( "refine_with_linear_form_inequality(left, right)", "right", right); - + } // Number of non-zero coefficients in `left': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type left_t = 0; @@ -82942,22 +85188,28 @@ typedef Interval FP_Interval_Type; // Get information about the number of non-zero coefficients in `left'. - for (dimension_type i = left_space_dim; i-- > 0; ) + for (dimension_type i = left_space_dim; i-- > 0; ) { if (left.coefficient(Variable(i)) != 0) { - if (left_t++ == 1) + if (left_t++ == 1) { break; - else + } + else { left_w_id = i; + } } + } // Get information about the number of non-zero coefficients in `right'. - for (dimension_type i = right_space_dim; i-- > 0; ) + for (dimension_type i = right_space_dim; i-- > 0; ) { if (right.coefficient(Variable(i)) != 0) { - if (right_t++ == 1) + if (right_t++ == 1) { break; - else + } + else { right_w_id = i; + } } + } const FP_Interval_Type& left_w_coeff = left.coefficient(Variable(left_w_id)); @@ -82998,9 +85250,10 @@ BD_Shape ::export_interval_constraints(U& dest) const { const dimension_type space_dim = space_dimension(); - if (space_dim > dest.space_dimension()) + if (space_dim > dest.space_dimension()) { throw std::invalid_argument( "BD_Shape::export_interval_constraints"); + } // Expose all the interval constraints. shortest_path_closure_assign(); @@ -83016,16 +85269,18 @@ for (dimension_type i = space_dim; i-- > 0; ) { // Set the upper bound. const N& u = dbm_0[i+1]; - if (!is_plus_infinity(u)) - if (!dest.restrict_upper(i, u.raw_value())) + if (!is_plus_infinity(u)) { + if (!dest.restrict_upper(i, u.raw_value())) { return; - + } + } // Set the lower bound. const N& negated_l = dbm[i+1][0]; if (!is_plus_infinity(negated_l)) { neg_assign_r(tmp, negated_l, ROUND_DOWN); - if (!dest.restrict_lower(i, tmp.raw_value())) + if (!dest.restrict_lower(i, tmp.raw_value())) { return; + } } } @@ -83261,13 +85516,15 @@ if (low_coeff != 0 || high_coeff != 0) { assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } } else { @@ -83276,13 +85533,15 @@ if (low_coeff != 0 || high_coeff != 0) { assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } } } @@ -83313,13 +85572,15 @@ bool do_update = false; assign_r(low_coeff, lv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, lv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } else { assign_r(low_coeff, rv_coefficient.lower(), ROUND_NOT_NEEDED); assign_r(high_coeff, rv_coefficient.upper(), ROUND_NOT_NEEDED); - if (low_coeff != 0 || high_coeff != 0) + if (low_coeff != 0 || high_coeff != 0) { do_update = true; + } } if (do_update) { @@ -83419,28 +85680,28 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_preimage(v, e, d)", "d == 0"); - + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr); - + } // `var' should be one of the dimensions of // the bounded difference shapes. const dimension_type v = var.id() + 1; - if (v > space_dim) + if (v > space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", var.id()); - + } // The image of an empty BDS is empty too. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } const Coefficient& b = expr.inhomogeneous_term(); // Number of non-zero coefficients in `expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -83450,8 +85711,9 @@ if (j != 0) { ++t; - if (!expr.all_zeroes(1, j)) + if (!expr.all_zeroes(1, j)) { ++t; + } } // Now we know the form of `expr': @@ -83465,8 +85727,9 @@ // Case 1: expr = n; remove all constraints on `var'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } PPL_ASSERT(OK()); return; } @@ -83476,16 +85739,18 @@ const Coefficient& a = expr.get(Variable(j - 1)); if (a == denominator || a == -denominator) { // Case 2: expr = a*w + b, with a = +/- denominator. - if (j == var.space_dimension()) + if (j == var.space_dimension()) { // Apply affine_image() on the inverse of this transformation. affine_image(var, denominator*var - b, a); + } else { // `expr == a*w + b', where `w != v'. // Remove all constraints on `var'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } PPL_ASSERT(OK()); } return; @@ -83507,8 +85772,9 @@ // Transformation not invertible: all constraints on `var' are lost. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } } PPL_ASSERT(OK()); } @@ -83521,32 +85787,34 @@ const Linear_Expression& ub_expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0"); - + } // Dimension-compatibility checks. // `var' should be one of the dimensions of the BD_Shape. const dimension_type bds_space_dim = space_dimension(); const dimension_type v = var.id() + 1; - if (v > bds_space_dim) + if (v > bds_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "v", var); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (bds_space_dim < lb_space_dim) + if (bds_space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (bds_space_dim < ub_space_dim) + if (bds_space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "ub", ub_expr); - + } // Any image of an empty BDS is empty. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } const Coefficient& b = ub_expr.inhomogeneous_term(); // Number of non-zero coefficients in `ub_expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -83556,8 +85824,9 @@ if (w != 0) { ++t; - if (!ub_expr.all_zeroes(1, w)) + if (!ub_expr.all_zeroes(1, w)) { ++t; + } } // Now we know the form of `ub_expr': @@ -83658,8 +85927,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -ub_expr; + } const Linear_Expression& sc_expr = is_sc ? ub_expr : minus_expr; PPL_DIRTY_TEMP(N, pos_sum); @@ -83688,8 +85958,9 @@ // Approximating `sc_expr'. if (pos_pinf_count <= 1) { const N& up_approx_i = dbm_0[i_dim]; - if (!is_plus_infinity(up_approx_i)) + if (!is_plus_infinity(up_approx_i)) { add_mul_assign_r(pos_sum, coeff_i, up_approx_i, ROUND_UP); + } else { ++pos_pinf_count; pos_pinf_index = i_dim; @@ -83704,8 +85975,9 @@ // Approximating `sc_expr'. if (pos_pinf_count <= 1) { const N& up_approx_minus_i = dbm[i_dim][0]; - if (!is_plus_infinity(up_approx_minus_i)) + if (!is_plus_infinity(up_approx_minus_i)) { add_mul_assign_r(pos_sum, coeff_i, up_approx_minus_i, ROUND_UP); + } else { ++pos_pinf_count; pos_pinf_index = i_dim; @@ -83746,12 +86018,12 @@ // Deduce constraints of the form `v - u', where `u != v'. deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, pos_sum); } - else - // Here `pos_pinf_count == 1'. - if (pos_pinf_index != v - && sc_expr.get(Variable(pos_pinf_index - 1)) == sc_denom) + // Here `pos_pinf_count == 1'. + else if (pos_pinf_index != v + && sc_expr.get(Variable(pos_pinf_index - 1)) == sc_denom) { // Add the constraint `v - pos_pinf_index <= pos_sum'. dbm[pos_pinf_index][v] = pos_sum; + } } PPL_ASSERT(OK()); } @@ -83764,32 +86036,34 @@ const Linear_Expression& ub_expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0"); - + } // Dimension-compatibility checks. // `var' should be one of the dimensions of the BD_Shape. const dimension_type space_dim = space_dimension(); const dimension_type v = var.id() + 1; - if (v > space_dim) + if (v > space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "v", var); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "ub", ub_expr); - + } // Any preimage of an empty BDS is empty. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } if (ub_expr.coefficient(var) == 0) { refine(var, LESS_OR_EQUAL, ub_expr, denominator); generalized_affine_preimage(var, GREATER_OR_EQUAL, @@ -83817,10 +86091,12 @@ PPL_ASSERT(!marked_empty()); generalized_affine_preimage(var, LESS_OR_EQUAL, ub_expr, denominator); - if (sgn(denominator) == sgn(lb_inverse_denom)) + if (sgn(denominator) == sgn(lb_inverse_denom)) { add_constraint(var >= new_var); - else + } + else { add_constraint(var <= new_var); + } // Remove the temporarily added dimension. remove_higher_space_dimensions(space_dim); } @@ -83833,33 +86109,34 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "d == 0"); - + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "e", expr); - + } // `var' should be one of the dimensions of the BDS. const dimension_type v = var.id() + 1; - if (v > space_dim) + if (v > space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", var.id()); - + } // The relation symbol cannot be a strict relation symbol. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is the disequality relation symbol"); - + } if (relsym == EQUAL) { // The relation symbol is "=": // this is just an affine image computation. @@ -83869,9 +86146,9 @@ // The image of an empty BDS is empty too. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } const Coefficient& b = expr.inhomogeneous_term(); // Number of non-zero coefficients in `expr': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. @@ -83881,8 +86158,9 @@ if (w != 0) { ++t; - if (!expr.all_zeroes(1, w)) + if (!expr.all_zeroes(1, w)) { ++t; + } } // Now we know the form of `expr': @@ -83962,11 +86240,13 @@ // Remove all constraints on `v'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - if (a == denominator) + } + if (a == denominator) { // Add the new constraint `v - w <= b/denominator'. add_dbm_constraint(w, v, d); + } else { // Here a == -denominator, so that we should be adding // the constraint `v <= b/denominator - w'. @@ -84015,12 +86295,14 @@ // Remove all constraints on `v'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); - if (a == denominator) + } + if (a == denominator) { // Add the new constraint `v - w >= b/denominator', // i.e., `w - v <= -b/denominator'. add_dbm_constraint(v, w, d); + } else { // Here a == -denominator, so that we should be adding // the constraint `v >= -w + b/denominator', @@ -84065,8 +86347,9 @@ // when `denominator' is negative. Do not use it unless you are sure // it has been correctly assigned. Linear_Expression minus_expr; - if (!is_sc) + if (!is_sc) { minus_expr = -expr; + } const Linear_Expression& sc_expr = is_sc ? expr : minus_expr; PPL_DIRTY_TEMP(N, sum); @@ -84098,13 +86381,15 @@ // Choose carefully: we are approximating `sc_expr'. const N& approx_i = (sign_i > 0) ? dbm_0[i_dim] : dbm[i_dim][0]; if (is_plus_infinity(approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = i_dim; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -84115,8 +86400,9 @@ // Remove all constraints on `v'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } // Return immediately if no approximation could be computed. if (pinf_count > 1) { PPL_ASSERT(OK()); @@ -84141,10 +86427,13 @@ // Deduce constraints of the form `v - u', where `u != v'. deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) - if (pinf_index != v && expr.get(Variable(pinf_index - 1)) == denominator) + else if (pinf_count == 1) { + if (pinf_index != v + && expr.get(Variable(pinf_index - 1)) == denominator) { // Add the constraint `v - pinf_index <= sum'. add_dbm_constraint(pinf_index, v, sum); + } + } break; case GREATER_OR_EQUAL: @@ -84164,13 +86453,15 @@ // Choose carefully: we are approximating `-sc_expr'. const N& approx_i = (sign_i > 0) ? dbm[i_dim][0] : dbm_0[i_dim]; if (is_plus_infinity(approx_i)) { - if (++pinf_count > 1) + if (++pinf_count > 1) { break; + } pinf_index = i_dim; continue; } - if (sign_i > 0) + if (sign_i > 0) { assign_r(coeff_i, sc_i, ROUND_UP); + } else { neg_assign(minus_sc_i, sc_i); assign_r(coeff_i, minus_sc_i, ROUND_UP); @@ -84181,8 +86472,9 @@ // Remove all constraints on `var'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } // Return immediately if no approximation could be computed. if (pinf_count > 1) { PPL_ASSERT(OK()); @@ -84207,11 +86499,14 @@ // Deduce constraints of the form `u - v', where `u != v'. deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, sum); } - else if (pinf_count == 1) - if (pinf_index != v && expr.get(Variable(pinf_index - 1)) == denominator) + else if (pinf_count == 1) { + if (pinf_index != v + && expr.get(Variable(pinf_index - 1)) == denominator) { // Add the constraint `v - pinf_index >= -sum', // i.e., `pinf_index - v <= sum'. add_dbm_constraint(v, pinf_index, sum); + } + } break; default: @@ -84232,31 +86527,32 @@ // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type lhs_space_dim = lhs.space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e1", lhs); - + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e2", rhs); - + } // Strict relation symbols are not admitted for BDSs. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is the disequality relation symbol"); - + } // The image of an empty BDS is empty. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } // Number of non-zero coefficients in `lhs': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type t_lhs = 0; @@ -84265,8 +86561,9 @@ if (j_lhs != 0) { ++t_lhs; - if (!lhs.all_zeroes(1, j_lhs)) + if (!lhs.all_zeroes(1, j_lhs)) { ++t_lhs; + } --j_lhs; } @@ -84305,10 +86602,12 @@ const Coefficient& denom = lhs.coefficient(v); Relation_Symbol new_relsym = relsym; if (denom < 0) { - if (relsym == LESS_OR_EQUAL) + if (relsym == LESS_OR_EQUAL) { new_relsym = GREATER_OR_EQUAL; - else if (relsym == GREATER_OR_EQUAL) + } + else if (relsym == GREATER_OR_EQUAL) { new_relsym = LESS_OR_EQUAL; + } } Linear_Expression expr = rhs - b_lhs; generalized_affine_image(v, new_relsym, expr, denom); @@ -84318,15 +86617,16 @@ // Compute the set of variables occurring in `lhs'. std::vector lhs_vars; for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end(); - i != i_end; ++i) + i != i_end; ++i) { lhs_vars.push_back(i.variable()); - + } const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim); if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) { // `lhs' and `rhs' variables are disjoint. // Existentially quantify all variables in the lhs. - for (dimension_type i = lhs_vars.size(); i-- > 0; ) + for (dimension_type i = lhs_vars.size(); i-- > 0; ) { forget_all_dbm_constraints(lhs_vars[i].id() + 1); + } // Constrain the left hand side expression so that it is related to // the right hand side expression as dictated by `relsym'. // TODO: if the following constraint is NOT a bounded difference, @@ -84352,9 +86652,9 @@ #if 1 // Simplified computation (see the TODO note below). - for (dimension_type i = lhs_vars.size(); i-- > 0; ) + for (dimension_type i = lhs_vars.size(); i-- > 0; ) { forget_all_dbm_constraints(lhs_vars[i].id() + 1); - + } #else // Currently unnecessarily complex computation. // More accurate computation that is worth doing only if @@ -84372,8 +86672,9 @@ // NOTE: enforce shortest-path closure for precision. shortest_path_closure_assign(); PPL_ASSERT(!marked_empty()); - for (dimension_type i = lhs_vars.size(); i-- > 0; ) + for (dimension_type i = lhs_vars.size(); i-- > 0; ) { forget_all_dbm_constraints(lhs_vars[i].id() + 1); + } // Constrain the new dimension so that it is related to // the left hand side as dictated by `relsym'. // TODO: each one of the following constraints is definitely NOT @@ -84412,34 +86713,35 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "d == 0"); - + } // Dimension-compatibility checks. // The dimension of `expr' should not be greater than the dimension // of `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", "e", expr); - + } // `var' should be one of the dimensions of the BDS. const dimension_type v = var.id() + 1; - if (v > space_dim) + if (v > space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", var.id()); - + } // The relation symbol cannot be a strict relation symbol. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is the disequality relation symbol"); - + } if (relsym == EQUAL) { // The relation symbol is "=": // this is just an affine preimage computation. @@ -84449,9 +86751,9 @@ // The preimage of an empty BDS is empty too. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } // Check whether the preimage of this affine relation can be easily // computed as the image of its inverse relation. const Coefficient& expr_v = expr.coefficient(var); @@ -84470,14 +86772,16 @@ refine(var, relsym, expr, denominator); // If the shrunk BD_Shape is empty, its preimage is empty too; ... - if (is_empty()) + if (is_empty()) { return; + } // ... otherwise, since the relation was not invertible, // we just forget all constraints on `v'. forget_all_dbm_constraints(v); // Shortest-path closure is preserved, but not reduction. - if (marked_shortest_path_reduced()) + if (marked_shortest_path_reduced()) { reset_shortest_path_reduced(); + } PPL_ASSERT(OK()); } @@ -84491,31 +86795,32 @@ // of `*this'. const dimension_type bds_space_dim = space_dimension(); const dimension_type lhs_space_dim = lhs.space_dimension(); - if (bds_space_dim < lhs_space_dim) + if (bds_space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)", "e1", lhs); - + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (bds_space_dim < rhs_space_dim) + if (bds_space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)", "e2", rhs); - + } // Strict relation symbols are not admitted for BDSs. - if (relsym == LESS_THAN || relsym == GREATER_THAN) + if (relsym == LESS_THAN || relsym == GREATER_THAN) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2)", "r is a strict relation symbol"); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(e1, r, e2)", "r is the disequality relation symbol"); - + } // The preimage of an empty BDS is empty. shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } // Number of non-zero coefficients in `lhs': will be set to // 0, 1, or 2, the latter value meaning any value greater than 1. dimension_type t_lhs = 0; @@ -84524,8 +86829,9 @@ if (j_lhs != 0) { ++t_lhs; - if (!lhs.all_zeroes(1, j_lhs)) + if (!lhs.all_zeroes(1, j_lhs)) { ++t_lhs; + } --j_lhs; } @@ -84546,10 +86852,12 @@ const Coefficient& denom = lhs.coefficient(v); Relation_Symbol new_relsym = relsym; if (denom < 0) { - if (relsym == LESS_OR_EQUAL) + if (relsym == LESS_OR_EQUAL) { new_relsym = GREATER_OR_EQUAL; - else if (relsym == GREATER_OR_EQUAL) + } + else if (relsym == GREATER_OR_EQUAL) { new_relsym = LESS_OR_EQUAL; + } } Linear_Expression expr = rhs - b_lhs; generalized_affine_preimage(v, new_relsym, expr, denom); @@ -84559,9 +86867,9 @@ // Compute the set of variables occurring in `lhs'. std::vector lhs_vars; for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end(); - i != i_end; ++i) + i != i_end; ++i) { lhs_vars.push_back(i.variable()); - + } const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim); if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) { // `lhs' and `rhs' variables are disjoint. @@ -84587,11 +86895,13 @@ } // If the shrunk BD_Shape is empty, its preimage is empty too; ... - if (is_empty()) + if (is_empty()) { return; + } // Existentially quantify all variables in the lhs. - for (dimension_type i = lhs_vars.size(); i-- > 0; ) + for (dimension_type i = lhs_vars.size(); i-- > 0; ) { forget_all_dbm_constraints(lhs_vars[i].id() + 1); + } } else { @@ -84608,8 +86918,9 @@ // NOTE: enforce shortest-path closure for precision. shortest_path_closure_assign(); PPL_ASSERT(!marked_empty()); - for (dimension_type i = lhs_vars.size(); i-- > 0; ) + for (dimension_type i = lhs_vars.size(); i-- > 0; ) { forget_all_dbm_constraints(lhs_vars[i].id() + 1); + } // Constrain the new dimension so that it is related to // the left hand side as dictated by `relsym'. // Note: if `rhs == a_rhs*v + b_rhs' where `a_rhs' is in {0, 1}, @@ -84648,8 +86959,9 @@ cs.set_space_dimension(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cs = Constraint_System::zero_dim_empty(); + } return cs; } @@ -84728,8 +87040,9 @@ cs.set_space_dimension(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cs = Constraint_System::zero_dim_empty(); + } return cs; } @@ -84808,20 +87121,21 @@ BD_Shape::expand_space_dimension(Variable var, dimension_type m) { dimension_type old_dim = space_dimension(); // `var' should be one of the dimensions of the vector space. - if (var.space_dimension() > old_dim) + if (var.space_dimension() > old_dim) { throw_dimension_incompatible("expand_space_dimension(v, m)", "v", var); + } // The space dimension of the resulting BDS should not // overflow the maximum allowed space dimension. - if (m > max_space_dimension() - space_dimension()) + if (m > max_space_dimension() - space_dimension()) { throw_invalid_argument("expand_dimension(v, m)", "adding m new space dimensions exceeds " "the maximum allowed space dimension"); - + } // Nothing to do, if no dimensions must be added. - if (m == 0) + if (m == 0) { return; - + } // Add the required new dimensions. add_space_dimensions_and_embed(m); @@ -84841,8 +87155,9 @@ } // In general, adding a constraint does not preserve the shortest-path // closure or reduction of the bounded difference shape. - if (marked_shortest_path_closed()) + if (marked_shortest_path_closed()) { reset_shortest_path_closed(); + } PPL_ASSERT(OK()); } @@ -84852,24 +87167,24 @@ Variable dest) { const dimension_type space_dim = space_dimension(); // `dest' should be one of the dimensions of the BDS. - if (dest.space_dimension() > space_dim) + if (dest.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", "v", dest); - + } // The folding of no dimensions is a no-op. - if (vars.empty()) + if (vars.empty()) { return; - + } // All variables in `vars' should be dimensions of the BDS. - if (vars.space_dimension() > space_dim) + if (vars.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", vars.space_dimension()); - + } // Moreover, `dest.id()' should not occur in `vars'. - if (vars.find(dest.id()) != vars.end()) + if (vars.find(dest.id()) != vars.end()) { throw_invalid_argument("fold_space_dimensions(vs, v)", "v should not occur in vs"); - + } shortest_path_closure_assign(); if (!marked_empty()) { // Recompute the elements of the row and the column corresponding @@ -84894,19 +87209,21 @@ template void BD_Shape::drop_some_non_integer_points(Complexity_Class) { - if (std::numeric_limits::is_integer) + if (std::numeric_limits::is_integer) { return; - + } const dimension_type space_dim = space_dimension(); shortest_path_closure_assign(); - if (space_dim == 0 || marked_empty()) + if (space_dim == 0 || marked_empty()) { return; - + } for (dimension_type i = space_dim + 1; i-- > 0; ) { DB_Row& dbm_i = dbm[i]; - for (dimension_type j = space_dim + 1; j-- > 0; ) - if (i != j) + for (dimension_type j = space_dim + 1; j-- > 0; ) { + if (i != j) { drop_some_non_integer_points_helper(dbm_i[j]); + } + } } PPL_ASSERT(OK()); } @@ -84918,17 +87235,17 @@ // Dimension-compatibility check. const dimension_type space_dim = space_dimension(); const dimension_type min_space_dim = vars.space_dimension(); - if (space_dim < min_space_dim) + if (space_dim < min_space_dim) { throw_dimension_incompatible("drop_some_non_integer_points(vs, cmpl)", min_space_dim); - - if (std::numeric_limits::is_integer || min_space_dim == 0) + } + if (std::numeric_limits::is_integer || min_space_dim == 0) { return; - + } shortest_path_closure_assign(); - if (marked_empty()) + if (marked_empty()) { return; - + } const Variables_Set::const_iterator v_begin = vars.begin(); const Variables_Set::const_iterator v_end = vars.end(); PPL_ASSERT(v_begin != v_end); @@ -84946,8 +87263,9 @@ DB_Row& dbm_i = dbm[i]; for (Variables_Set::const_iterator v_j = v_begin; v_j != v_end; ++v_j) { const dimension_type j = *v_j + 1; - if (i != j) + if (i != j) { drop_some_non_integer_points_helper(dbm_i[j]); + } } } PPL_ASSERT(OK()); @@ -84958,26 +87276,30 @@ std::ostream& IO_Operators::operator<<(std::ostream& s, const BD_Shape& bds) { typedef typename BD_Shape::coefficient_type N; - if (bds.is_universe()) + if (bds.is_universe()) { s << "true"; + } else { // We control empty bounded difference shape. dimension_type n = bds.space_dimension(); - if (bds.marked_empty()) + if (bds.marked_empty()) { s << "false"; + } else { PPL_DIRTY_TEMP(N, v); bool first = true; - for (dimension_type i = 0; i <= n; ++i) + for (dimension_type i = 0; i <= n; ++i) { for (dimension_type j = i + 1; j <= n; ++j) { const N& c_i_j = bds.dbm[i][j]; const N& c_j_i = bds.dbm[j][i]; if (is_additive_inverse(c_j_i, c_i_j)) { // We will print an equality. - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } if (i == 0) { // We have got a equality constraint with one variable. s << Variable(j - 1); @@ -85002,10 +87324,12 @@ else { // We will print a non-strict inequality. if (!is_plus_infinity(c_j_i)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } if (i == 0) { // We have got a constraint with only one variable. s << Variable(j - 1); @@ -85030,10 +87354,12 @@ } } if (!is_plus_infinity(c_i_j)) { - if (first) + if (first) { first = false; - else + } + else { s << ", "; + } if (i == 0) { // We have got a constraint with only one variable. s << Variable(j - 1); @@ -85058,6 +87384,7 @@ } } } + } } } return s; @@ -85078,12 +87405,15 @@ template bool BD_Shape::ascii_load(std::istream& s) { - if (!status.ascii_load(s)) + if (!status.ascii_load(s)) { return false; - if (!dbm.ascii_load(s)) + } + if (!dbm.ascii_load(s)) { return false; - if (!redundancy_dbm.ascii_load(s)) + } + if (!redundancy_dbm.ascii_load(s)) { return false; + } return true; } @@ -85098,20 +87428,20 @@ bool BD_Shape::OK() const { // Check whether the difference-bound matrix is well-formed. - if (!dbm.OK()) + if (!dbm.OK()) { return false; - + } // Check whether the status information is legal. - if (!status.OK()) + if (!status.OK()) { return false; - + } // An empty BDS is OK. - if (marked_empty()) + if (marked_empty()) { return true; - + } // MINUS_INFINITY cannot occur at all. - for (dimension_type i = dbm.num_rows(); i-- > 0; ) - for (dimension_type j = dbm.num_rows(); j-- > 0; ) + for (dimension_type i = dbm.num_rows(); i-- > 0; ) { + for (dimension_type j = dbm.num_rows(); j-- > 0; ) { if (is_minus_infinity(dbm[i][j])) { #ifndef NDEBUG using namespace Parma_Polyhedra_Library::IO_Operators; @@ -85121,9 +87451,10 @@ #endif return false; } - + } + } // On the main diagonal only PLUS_INFINITY can occur. - for (dimension_type i = dbm.num_rows(); i-- > 0; ) + for (dimension_type i = dbm.num_rows(); i-- > 0; ) { if (!is_plus_infinity(dbm[i][i])) { #ifndef NDEBUG using namespace Parma_Polyhedra_Library::IO_Operators; @@ -85133,7 +87464,7 @@ #endif return false; } - + } // Check whether the shortest-path closure information is legal. if (marked_shortest_path_closed()) { BD_Shape x = *this; @@ -85156,8 +87487,8 @@ // Check whether the shortest-path reduction information is legal. if (marked_shortest_path_reduced()) { // A non-redundant constraint cannot be equal to PLUS_INFINITY. - for (dimension_type i = dbm.num_rows(); i-- > 0; ) - for (dimension_type j = dbm.num_rows(); j-- > 0; ) + for (dimension_type i = dbm.num_rows(); i-- > 0; ) { + for (dimension_type j = dbm.num_rows(); j-- > 0; ) { if (!redundancy_dbm[i][j] && is_plus_infinity(dbm[i][j])) { #ifndef NDEBUG using namespace Parma_Polyhedra_Library::IO_Operators; @@ -85167,7 +87498,8 @@ #endif return false; } - + } + } BD_Shape x = *this; x.reset_shortest_path_reduced(); x.shortest_path_reduction_assign(); @@ -85291,7 +87623,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/BD_Shape_defs.hh line 2370. */ +/* Automatically generated from PPL source file ../src/BD_Shape_defs.hh line 2373. */ /* Automatically generated from PPL source file ../src/Rational_Interval.hh line 1. */ /* Rational_Interval class declaration and implementation. @@ -85345,12 +87677,14 @@ // In a box that is marked empty the intervals are completely // meaningless: we exploit this by avoiding their initialization. if (kind == UNIVERSE) { - for (dimension_type i = num_dimensions; i-- > 0; ) + for (dimension_type i = num_dimensions; i-- > 0; ) { seq[i].assign(UNIVERSE); + } set_empty_up_to_date(); } - else + else { set_empty(); + } PPL_ASSERT(OK()); } @@ -85365,8 +87699,9 @@ "allowed space dimension")), status() { // FIXME: check whether we can avoid the double initialization. - for (dimension_type i = cs.space_dimension(); i-- > 0; ) + for (dimension_type i = cs.space_dimension(); i-- > 0; ) { seq[i].assign(UNIVERSE); + } add_constraints_no_check(cs); } @@ -85381,8 +87716,9 @@ "allowed space dimension")), status() { // FIXME: check whether we can avoid the double initialization. - for (dimension_type i = cgs.space_dimension(); i-- > 0; ) + for (dimension_type i = cgs.space_dimension(); i-- > 0; ) { seq[i].assign(UNIVERSE); + } add_congruences_no_check(cgs); } @@ -85395,12 +87731,15 @@ // status(y.status) { status() { // FIXME: remove when the above is fixed. - if (y.marked_empty()) + if (y.marked_empty()) { set_empty(); + } - if (!y.marked_empty()) - for (dimension_type k = y.space_dimension(); k-- > 0; ) + if (!y.marked_empty()) { + for (dimension_type k = y.space_dimension(); k-- > 0; ) { seq[k].assign(y.seq[k]); + } + } PPL_ASSERT(OK()); } @@ -85463,11 +87802,12 @@ } } - if (!point_seen) + if (!point_seen) { // The generator system is not empty, but contains no points. throw std::invalid_argument("PPL::Box::Box(gs):\n" "the non-empty generator system gs " "contains no points."); + } // Going through all the lines, rays and closure points. for (Generator_System::const_iterator gs_i = gs_begin; @@ -85477,13 +87817,14 @@ case Generator::LINE: for (Generator::expr_type::const_iterator i = g.expression().begin(), i_end = g.expression().end(); - i != i_end; ++i) + i != i_end; ++i) { seq[i.variable().id()].assign(UNIVERSE); + } break; case Generator::RAY: for (Generator::expr_type::const_iterator i = g.expression().begin(), i_end = g.expression().end(); - i != i_end; ++i) + i != i_end; ++i) { switch (sgn(*i)) { case 1: seq[i.variable().id()].upper_extend(); @@ -85495,6 +87836,7 @@ PPL_UNREACHABLE; break; } + } break; case Generator::CLOSURE_POINT: { @@ -85557,8 +87899,9 @@ // Set the upper bound. const Coeff& u = dbm_0[i+1]; - if (!is_plus_infinity(u)) + if (!is_plus_infinity(u)) { upper.set(LESS_OR_EQUAL, u, true); + } // Set the lower bound. const Coeff& negated_l = bds.dbm[i+1][0]; @@ -85593,8 +87936,9 @@ set_empty_up_to_date(); const dimension_type space_dim = space_dimension(); - if (space_dim == 0) + if (space_dim == 0) { return; + } PPL_DIRTY_TEMP(mpq_class, lower_bound); PPL_DIRTY_TEMP(mpq_class, upper_bound); @@ -85647,8 +87991,9 @@ // b) the polyhedron is zero-dimensional; or ... const dimension_type space_dim = ph.space_dimension(); - if (space_dim == 0) + if (space_dim == 0) { return; + } // c) the polyhedron is already described by a generator system. if (ph.generators_are_up_to_date() && !ph.has_pending_constraints()) { @@ -85662,8 +88007,9 @@ if (complexity == POLYNOMIAL_COMPLEXITY) { // FIXME: is there a way to avoid this initialization? - for (dimension_type i = space_dim; i-- > 0; ) + for (dimension_type i = space_dim; i-- > 0; ) { seq[i].assign(UNIVERSE); + } // Get a simplified version of the constraints. const Constraint_System cs = ph.simplified_constraints(); // Propagate easy-to-find bounds from the constraints, @@ -85675,9 +88021,10 @@ else if (complexity == SIMPLEX_COMPLEXITY) { MIP_Problem lp(space_dim); const Constraint_System& ph_cs = ph.constraints(); - if (!ph_cs.has_strict_inequalities()) + if (!ph_cs.has_strict_inequalities()) { lp.add_constraints(ph_cs); - else + } + else { // Adding to `lp' a topologically closed version of `ph_cs'. for (Constraint_System::const_iterator i = ph_cs.begin(), ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) { @@ -85686,9 +88033,11 @@ const Linear_Expression expr(c.expression()); lp.add_constraint(expr >= 0); } - else + else { lp.add_constraint(c); + } } + } // Check for unsatisfiability. if (!lp.is_satisfiable()) { set_empty(); @@ -85698,8 +88047,8 @@ Generator g(point()); PPL_DIRTY_TEMP(mpq_class, lower_bound); PPL_DIRTY_TEMP(mpq_class, upper_bound); - PPL_DIRTY_TEMP(Coefficient, bound_numer); - PPL_DIRTY_TEMP(Coefficient, bound_denom); + PPL_DIRTY_TEMP_COEFFICIENT(bound_numer); + PPL_DIRTY_TEMP_COEFFICIENT(bound_denom); for (dimension_type i = space_dim; i-- > 0; ) { I_Constraint lower; I_Constraint upper; @@ -85730,8 +88079,9 @@ } else { PPL_ASSERT(complexity == ANY_COMPLEXITY); - if (ph.is_empty()) + if (ph.is_empty()) { set_empty(); + } else { Box tmp(ph.generators()); m_swap(tmp); @@ -85759,8 +88109,9 @@ const dimension_type space_dim = gr.space_dimension(); - if (space_dim == 0) + if (space_dim == 0) { return; + } if (!gr.generators_are_up_to_date() && !gr.update_generators()) { // Updating found the grid empty. @@ -85774,8 +88125,8 @@ // of the interval to the value of the associated coefficient in a // generator point. PPL_DIRTY_TEMP(mpq_class, bound); - PPL_DIRTY_TEMP(Coefficient, bound_numer); - PPL_DIRTY_TEMP(Coefficient, bound_denom); + PPL_DIRTY_TEMP_COEFFICIENT(bound_numer); + PPL_DIRTY_TEMP_COEFFICIENT(bound_denom); for (dimension_type i = space_dim; i-- > 0; ) { ITV& seq_i = seq[i]; Variable var(i); @@ -85786,8 +88137,9 @@ bound.canonicalize(); seq_i.build(i_constraint(EQUAL, bound)); } - else + else { seq_i.assign(UNIVERSE); + } } } @@ -85812,8 +88164,9 @@ inline void Box::add_space_dimensions_and_embed(const dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; + } check_space_dimension_overflow(m, max_space_dimension() - space_dimension(), "PPL::Box::", "add_space_dimensions_and_embed(m)", @@ -85829,8 +88182,9 @@ inline void Box::add_space_dimensions_and_project(const dimension_type m) { // Adding no dimensions is a no-op. - if (m == 0) + if (m == 0) { return; + } check_space_dimension_overflow(m, max_space_dimension() - space_dimension(), "PPL::Box::", "add_space_dimensions_and_project(m)", @@ -85845,18 +88199,23 @@ bool operator==(const Box& x, const Box& y) { const dimension_type x_space_dim = x.space_dimension(); - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; + } - if (x.is_empty()) + if (x.is_empty()) { return y.is_empty(); + } - if (y.is_empty()) + if (y.is_empty()) { return x.is_empty(); + } - for (dimension_type k = x_space_dim; k-- > 0; ) - if (x.seq[k] != y.seq[k]) + for (dimension_type k = x_space_dim; k-- > 0; ) { + if (x.seq[k] != y.seq[k]) { return false; + } + } return true; } @@ -85866,14 +88225,15 @@ // `expr' should be dimension-compatible with `*this'. const dimension_type expr_space_dim = expr.space_dimension(); const dimension_type space_dim = space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((from_above ? "bounds_from_above(e)" : "bounds_from_below(e)"), "e", expr); + } // A zero-dimensional or empty Box bounds everything. - if (space_dim == 0 || is_empty()) + if (space_dim == 0 || is_empty()) { return true; - + } const int from_above_sign = from_above ? 1 : -1; // TODO: This loop can be optimized more, if needed, exploiting the // (possible) sparseness of expr. @@ -85882,15 +88242,17 @@ const Variable v = i.variable(); switch (sgn(*i) * from_above_sign) { case 1: - if (seq[v.id()].upper_is_boundary_infinity()) + if (seq[v.id()].upper_is_boundary_infinity()) { return false; + } break; case 0: PPL_UNREACHABLE; break; case -1: - if (seq[v.id()].lower_is_boundary_infinity()) + if (seq[v.id()].lower_is_boundary_infinity()) { return false; + } break; } } @@ -85904,8 +88266,9 @@ Coefficient_traits::const_reference numer, Coefficient_traits::const_reference denom) { - if (i.is_universe()) + if (i.is_universe()) { return Poly_Con_Relation::strictly_intersects(); + } PPL_DIRTY_TEMP(mpq_class, bound); assign_r(bound.get_num(), numer, ROUND_NOT_NEEDED); @@ -85938,15 +88301,18 @@ case 1: return Poly_Con_Relation::is_disjoint(); case 0: - if (i.lower_is_open()) + if (i.lower_is_open()) { return Poly_Con_Relation::is_disjoint(); - if (i.is_singleton()) + } + if (i.is_singleton()) { return Poly_Con_Relation::is_included() && Poly_Con_Relation::saturates(); + } return Poly_Con_Relation::strictly_intersects(); case -1: - if (i.upper_is_boundary_infinity()) + if (i.upper_is_boundary_infinity()) { return Poly_Con_Relation::strictly_intersects(); + } else { assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED); sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED); @@ -85954,10 +88320,12 @@ case 1: return Poly_Con_Relation::strictly_intersects(); case 0: - if (i.upper_is_open()) + if (i.upper_is_open()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } case -1: return Poly_Con_Relation::is_disjoint(); } @@ -85977,10 +88345,12 @@ return Poly_Con_Relation::strictly_intersects(); case 0: if (constraint_type == Constraint::STRICT_INEQUALITY - || i.upper_is_open()) + || i.upper_is_open()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } case -1: return Poly_Con_Relation::is_disjoint(); } @@ -85995,22 +88365,26 @@ if (constraint_type == Constraint::NONSTRICT_INEQUALITY || i.lower_is_open()) { Poly_Con_Relation result = Poly_Con_Relation::is_included(); - if (i.is_singleton()) + if (i.is_singleton()) { result = result && Poly_Con_Relation::saturates(); + } return result; } else { PPL_ASSERT(constraint_type == Constraint::STRICT_INEQUALITY && !i.lower_is_open()); - if (i.is_singleton()) + if (i.is_singleton()) { return Poly_Con_Relation::is_disjoint() && Poly_Con_Relation::saturates(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } } case -1: - if (i.upper_is_boundary_infinity()) + if (i.upper_is_boundary_infinity()) { return Poly_Con_Relation::strictly_intersects(); + } else { assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED); sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED); @@ -86019,10 +88393,12 @@ return Poly_Con_Relation::strictly_intersects(); case 0: if (constraint_type == Constraint::STRICT_INEQUALITY - || i.upper_is_open()) + || i.upper_is_open()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } case -1: return Poly_Con_Relation::is_disjoint(); } @@ -86032,8 +88408,9 @@ } else { // `c' is an upper bound. - if (i.upper_is_boundary_infinity()) + if (i.upper_is_boundary_infinity()) { return Poly_Con_Relation::strictly_intersects(); + } else { assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED); sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED); @@ -86044,22 +88421,26 @@ if (constraint_type == Constraint::NONSTRICT_INEQUALITY || i.upper_is_open()) { Poly_Con_Relation result = Poly_Con_Relation::is_included(); - if (i.is_singleton()) + if (i.is_singleton()) { result = result && Poly_Con_Relation::saturates(); + } return result; } else { PPL_ASSERT(constraint_type == Constraint::STRICT_INEQUALITY && !i.upper_is_open()); - if (i.is_singleton()) + if (i.is_singleton()) { return Poly_Con_Relation::is_disjoint() && Poly_Con_Relation::saturates(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } } case 1: - if (i.lower_is_boundary_infinity()) + if (i.lower_is_boundary_infinity()) { return Poly_Con_Relation::strictly_intersects(); + } else { assign_r(bound_diff, i.lower(), ROUND_NOT_NEEDED); sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED); @@ -86068,10 +88449,12 @@ return Poly_Con_Relation::strictly_intersects(); case 0: if (constraint_type == Constraint::STRICT_INEQUALITY - || i.lower_is_open()) + || i.lower_is_open()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::strictly_intersects(); + } case 1: return Poly_Con_Relation::is_disjoint(); } @@ -86092,20 +88475,23 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (cg_space_dim > space_dim) + if (cg_space_dim > space_dim) { throw_dimension_incompatible("relation_with(cg)", cg); - - if (is_empty()) + } + if (is_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { return Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } } if (cg.is_equality()) { @@ -86128,9 +88514,9 @@ r += t; } - if (r.lower_is_boundary_infinity() || r.upper_is_boundary_infinity()) + if (r.lower_is_boundary_infinity() || r.upper_is_boundary_infinity()) { return Poly_Con_Relation::strictly_intersects(); - + } // Find the value that satisfies the congruence and is // nearest to the lower bound such that the point lies on or above it. @@ -86142,8 +88528,9 @@ v = cg.inhomogeneous_term() % mod; assign_r(lower, r.lower(), ROUND_DOWN); v -= ((lower / mod) * mod); - if (v + lower > 0) + if (v + lower > 0) { v -= mod; + } return interval_relation(r, Constraint::EQUALITY, v); } @@ -86154,52 +88541,61 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (c_space_dim > space_dim) + if (c_space_dim > space_dim) { throw_dimension_incompatible("relation_with(c)", c); + } - if (is_empty()) + if (is_empty()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included() && Poly_Con_Relation::is_disjoint(); + } if (space_dim == 0) { if ((c.is_equality() && c.inhomogeneous_term() != 0) - || (c.is_inequality() && c.inhomogeneous_term() < 0)) + || (c.is_inequality() && c.inhomogeneous_term() < 0)) { return Poly_Con_Relation::is_disjoint(); - else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) + } + else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0) { // The constraint 0 > 0 implicitly defines the hyperplane 0 = 0; // thus, the zero-dimensional point also saturates it. return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else if (c.is_equality() || c.inhomogeneous_term() == 0) + } + else if (c.is_equality() || c.inhomogeneous_term() == 0) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); - else + } + else { // The zero-dimensional point saturates // neither the positivity constraint 1 >= 0, // nor the strict positivity constraint 1 > 0. return Poly_Con_Relation::is_included(); + } } dimension_type c_num_vars = 0; dimension_type c_only_var = 0; - if (Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) - if (c_num_vars == 0) + if (Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) { + if (c_num_vars == 0) { // c is a trivial constraint. switch (sgn(c.inhomogeneous_term())) { case -1: return Poly_Con_Relation::is_disjoint(); case 0: - if (c.is_strict_inequality()) + if (c.is_strict_inequality()) { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_disjoint(); - else + } + else { return Poly_Con_Relation::saturates() && Poly_Con_Relation::is_included(); + } case 1: return Poly_Con_Relation::is_included(); } + } else { // c is an interval constraint. return interval_relation(seq[c_only_var], @@ -86207,6 +88603,7 @@ c.inhomogeneous_term(), c.coefficient(Variable(c_only_var))); } + } else { // Deal with a non-trivial and non-interval constraint. PPL_DIRTY_TEMP(Rational_Interval, r); @@ -86240,25 +88637,30 @@ const dimension_type g_space_dim = g.space_dimension(); // Dimension-compatibility check. - if (space_dim < g_space_dim) + if (space_dim < g_space_dim) { throw_dimension_incompatible("relation_with(g)", g); + } // The empty box cannot subsume a generator. - if (is_empty()) + if (is_empty()) { return Poly_Gen_Relation::nothing(); + } // A universe box in a zero-dimensional space subsumes // all the generators of a zero-dimensional space. - if (space_dim == 0) + if (space_dim == 0) { return Poly_Gen_Relation::subsumes(); + } if (g.is_line_or_ray()) { if (g.is_line()) { const Generator::expr_type& e = g.expression(); for (Generator::expr_type::const_iterator i = e.begin(), i_end = e.end(); - i != i_end; ++i) - if (!seq[i.variable().id()].is_universe()) + i != i_end; ++i) { + if (!seq[i.variable().id()].is_universe()) { return Poly_Gen_Relation::nothing(); + } + } return Poly_Gen_Relation::subsumes(); } else { @@ -86269,15 +88671,17 @@ const Variable v = i.variable(); switch (sgn(*i)) { case 1: - if (!seq[v.id()].upper_is_boundary_infinity()) + if (!seq[v.id()].upper_is_boundary_infinity()) { return Poly_Gen_Relation::nothing(); + } break; case 0: PPL_UNREACHABLE; break; case -1: - if (!seq[v.id()].lower_is_boundary_infinity()) + if (!seq[v.id()].lower_is_boundary_infinity()) { return Poly_Gen_Relation::nothing(); + } break; } } @@ -86294,8 +88698,9 @@ // Generator::expr_type::const_iterator. for (dimension_type i = g_space_dim; i-- > 0; ) { const ITV& seq_i = seq[i]; - if (seq_i.is_universe()) + if (seq_i.is_universe()) { continue; + } assign_r(g_coord.get_num(), g.coefficient(Variable(i)), ROUND_NOT_NEEDED); assign_r(g_coord.get_den(), g_divisor, ROUND_NOT_NEEDED); g_coord.canonicalize(); @@ -86304,11 +88709,13 @@ assign_r(bound, seq_i.lower(), ROUND_NOT_NEEDED); if (g_coord <= bound) { if (seq_i.lower_is_open()) { - if (g.is_point() || g_coord != bound) + if (g.is_point() || g_coord != bound) { return Poly_Gen_Relation::nothing(); + } } - else if (g_coord != bound) + else if (g_coord != bound) { return Poly_Gen_Relation::nothing(); + } } } // Check upper bound. @@ -86316,11 +88723,13 @@ assign_r(bound, seq_i.upper(), ROUND_NOT_NEEDED); if (g_coord >= bound) { if (seq_i.upper_is_open()) { - if (g.is_point() || g_coord != bound) + if (g.is_point() || g_coord != bound) { return Poly_Gen_Relation::nothing(); + } } - else if (g_coord != bound) + else if (g_coord != bound) { return Poly_Gen_Relation::nothing(); + } } } } @@ -86337,14 +88746,17 @@ // `expr' should be dimension-compatible with `*this'. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible((maximize ? "maximize(e, ...)" : "minimize(e, ...)"), "e", expr); + } + // Deal with zero-dim Box first. if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { return false; + } else { ext_n = expr.inhomogeneous_term(); ext_d = 1; @@ -86354,8 +88766,9 @@ } // For an empty Box we simply return false. - if (is_empty()) + if (is_empty()) { return false; + } PPL_DIRTY_TEMP(mpq_class, result); assign_r(result, expr.inhomogeneous_term(), ROUND_NOT_NEEDED); @@ -86369,23 +88782,27 @@ assign_r(expr_i, *i, ROUND_NOT_NEEDED); switch (sgn(expr_i) * maximize_sign) { case 1: - if (seq_i.upper_is_boundary_infinity()) + if (seq_i.upper_is_boundary_infinity()) { return false; + } assign_r(bound_i, seq_i.upper(), ROUND_NOT_NEEDED); add_mul_assign_r(result, bound_i, expr_i, ROUND_NOT_NEEDED); - if (seq_i.upper_is_open()) + if (seq_i.upper_is_open()) { is_included = false; + } break; case 0: PPL_UNREACHABLE; break; case -1: - if (seq_i.lower_is_boundary_infinity()) + if (seq_i.lower_is_boundary_infinity()) { return false; + } assign_r(bound_i, seq_i.lower(), ROUND_NOT_NEEDED); add_mul_assign_r(result, bound_i, expr_i, ROUND_NOT_NEEDED); - if (seq_i.lower_is_open()) + if (seq_i.lower_is_open()) { is_included = false; + } break; } } @@ -86404,19 +88821,19 @@ Coefficient& ext_n, Coefficient& ext_d, bool& included, Generator& g) const { - if (!max_min(expr, maximize, ext_n, ext_d, included)) + if (!max_min(expr, maximize, ext_n, ext_d, included)) { return false; - + } // Compute generator `g'. Linear_Expression g_expr; - PPL_DIRTY_TEMP(Coefficient, g_divisor); + PPL_DIRTY_TEMP_COEFFICIENT(g_divisor); g_divisor = 1; const int maximize_sign = maximize ? 1 : -1; PPL_DIRTY_TEMP(mpq_class, g_coord); - PPL_DIRTY_TEMP(Coefficient, numer); - PPL_DIRTY_TEMP(Coefficient, denom); - PPL_DIRTY_TEMP(Coefficient, lcm); - PPL_DIRTY_TEMP(Coefficient, factor); + PPL_DIRTY_TEMP_COEFFICIENT(numer); + PPL_DIRTY_TEMP_COEFFICIENT(denom); + PPL_DIRTY_TEMP_COEFFICIENT(lcm); + PPL_DIRTY_TEMP_COEFFICIENT(factor); // TODO: Check if the following loop can be optimized to exploit the // (possible) sparseness of expr. for (dimension_type i = space_dimension(); i-- > 0; ) { @@ -86429,11 +88846,12 @@ // If 0 belongs to the interval, choose it // (and directly proceed to the next iteration). // FIXME: name qualification issue. - if (seq_i.contains(0)) + if (seq_i.contains(0)) { continue; - if (!seq_i.lower_is_boundary_infinity()) - if (seq_i.lower_is_open()) - if (!seq_i.upper_is_boundary_infinity()) + } + if (!seq_i.lower_is_boundary_infinity()) { + if (seq_i.lower_is_open()) { + if (!seq_i.upper_is_boundary_infinity()) { if (seq_i.upper_is_open()) { // Bounded and open interval: compute middle point. assign_r(g_coord, seq_i.lower(), ROUND_NOT_NEEDED); @@ -86442,24 +88860,30 @@ g_coord += q_seq_i_upper; g_coord /= 2; } - else + else { // The upper bound is in the interval. assign_r(g_coord, seq_i.upper(), ROUND_NOT_NEEDED); + } + } else { // Lower is open, upper is unbounded. assign_r(g_coord, seq_i.lower(), ROUND_NOT_NEEDED); ++g_coord; } - else + } + else { // The lower bound is in the interval. assign_r(g_coord, seq_i.lower(), ROUND_NOT_NEEDED); + } + } else { // Lower is unbounded, hence upper is bounded // (since we know that 0 does not belong to the interval). PPL_ASSERT(!seq_i.upper_is_boundary_infinity()); assign_r(g_coord, seq_i.upper(), ROUND_NOT_NEEDED); - if (seq_i.upper_is_open()) + if (seq_i.upper_is_open()) { --g_coord; + } } break; case -1: @@ -86486,21 +88910,26 @@ Box::contains(const Box& y) const { const Box& x = *this; // Dimension-compatibility check. - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { x.throw_dimension_incompatible("contains(y)", y); + } // If `y' is empty, then `x' contains `y'. - if (y.is_empty()) + if (y.is_empty()) { return true; + } // If `x' is empty, then `x' cannot contain `y'. - if (x.is_empty()) + if (x.is_empty()) { return false; + } - for (dimension_type k = x.seq.size(); k-- > 0; ) + for (dimension_type k = x.seq.size(); k-- > 0; ) { // FIXME: fix this name qualification issue. - if (!x.seq[k].contains(y.seq[k])) + if (!x.seq[k].contains(y.seq[k])) { return false; + } + } return true; } @@ -86509,18 +88938,22 @@ Box::is_disjoint_from(const Box& y) const { const Box& x = *this; // Dimension-compatibility check. - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { x.throw_dimension_incompatible("is_disjoint_from(y)", y); + } // If any of `x' or `y' is marked empty, then they are disjoint. // Note: no need to use `is_empty', as the following loop is anyway correct. - if (x.marked_empty() || y.marked_empty()) + if (x.marked_empty() || y.marked_empty()) { return true; + } - for (dimension_type k = x.seq.size(); k-- > 0; ) + for (dimension_type k = x.seq.size(); k-- > 0; ) { // FIXME: fix this name qualification issue. - if (x.seq[k].is_disjoint_from(y.seq[k])) + if (x.seq[k].is_disjoint_from(y.seq[k])) { return true; + } + } return false; } @@ -86530,12 +88963,14 @@ Box& x = *this; // Dimension-compatibility check. - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { x.throw_dimension_incompatible("upper_bound_assign_if_exact(y)", y); + } // The lub of a box with an empty box is equal to the first box. - if (y.is_empty()) + if (y.is_empty()) { return true; + } if (x.is_empty()) { x = y; return true; @@ -86548,28 +88983,34 @@ const ITV& x_seq_i = x.seq[i]; const ITV& y_seq_i = y.seq[i]; - if (!x_seq_i.can_be_exactly_joined_to(y_seq_i)) + if (!x_seq_i.can_be_exactly_joined_to(y_seq_i)) { return false; + } // Note: the use of `y_i_does_not_contain_x_i' is needed // because we want to temporarily preserve the old value // of `y_j_does_not_contain_x_j'. bool y_i_does_not_contain_x_i = !y_seq_i.contains(x_seq_i); - if (y_i_does_not_contain_x_i && x_j_does_not_contain_y_j) + if (y_i_does_not_contain_x_i && x_j_does_not_contain_y_j) { return false; + } if (!x_seq_i.contains(y_seq_i)) { - if (y_j_does_not_contain_x_j) + if (y_j_does_not_contain_x_j) { return false; - else + } + else { x_j_does_not_contain_y_j = true; + } } - if (y_i_does_not_contain_x_i) + if (y_i_does_not_contain_x_i) { y_j_does_not_contain_x_j = true; + } } // The upper bound is exact: compute it into *this. - for (dimension_type k = x.seq.size(); k-- > 0; ) + for (dimension_type k = x.seq.size(); k-- > 0; ) { x.seq[k].join_assign(y.seq[k]); + } return true; } @@ -86590,9 +89031,11 @@ // A box that is not marked empty must have meaningful intervals. if (!marked_empty()) { - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].OK()) + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].OK()) { return false; + } + } } return true; @@ -86603,16 +89046,20 @@ Box::affine_dimension() const { dimension_type d = space_dimension(); // A zero-space-dim box always has affine dimension zero. - if (d == 0) + if (d == 0) { return 0; + } // An empty box has affine dimension zero. - if (is_empty()) + if (is_empty()) { return 0; + } - for (dimension_type k = d; k-- > 0; ) - if (seq[k].is_singleton()) + for (dimension_type k = d; k-- > 0; ) { + if (seq[k].is_singleton()) { --d; + } + } return d; } @@ -86622,11 +89069,12 @@ Box::check_empty() const { PPL_ASSERT(!marked_empty()); Box& x = const_cast&>(*this); - for (dimension_type k = seq.size(); k-- > 0; ) + for (dimension_type k = seq.size(); k-- > 0; ) { if (seq[k].is_empty()) { x.set_empty(); return true; } + } x.set_nonempty(); return false; } @@ -86634,56 +89082,71 @@ template bool Box::is_universe() const { - if (marked_empty()) + if (marked_empty()) { return false; - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].is_universe()) + } + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].is_universe()) { return false; + } + } return true; } template bool Box::is_topologically_closed() const { - if (ITV::is_always_topologically_closed() || is_empty()) + if (ITV::is_always_topologically_closed() || is_empty()) { return true; + } - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].is_topologically_closed()) + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].is_topologically_closed()) { return false; + } + } return true; } template bool Box::is_discrete() const { - if (is_empty()) + if (is_empty()) { return true; - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].is_singleton()) + } + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].is_singleton()) { return false; + } + } return true; } template bool Box::is_bounded() const { - if (is_empty()) + if (is_empty()) { return true; - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].is_bounded()) + } + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].is_bounded()) { return false; + } + } return true; } template bool Box::contains_integer_point() const { - if (marked_empty()) + if (marked_empty()) { return false; - for (dimension_type k = seq.size(); k-- > 0; ) - if (!seq[k].contains_integer_point()) + } + for (dimension_type k = seq.size(); k-- > 0; ) { + if (!seq[k].contains_integer_point()) { return false; + } + } return true; } @@ -86694,8 +89157,9 @@ Coefficient& val_n, Coefficient& val_d) const { dimension_type space_dim = space_dimension(); // The dimension of `expr' must be at most the dimension of *this. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("frequency(e, ...)", "e", expr); + } // Check if `expr' has a constant value. // If it is constant, set the frequency `freq_n' to 0 @@ -86705,8 +89169,9 @@ // Space dimension is 0: if empty, then return false; // otherwise the frequency is 0 and the value is the inhomogeneous term. if (space_dim == 0) { - if (is_empty()) + if (is_empty()) { return false; + } freq_n = 0; freq_d = 1; val_n = expr.inhomogeneous_term(); @@ -86715,8 +89180,9 @@ } // For an empty Box, we simply return false. - if (is_empty()) + if (is_empty()) { return false; + } // The Box has at least 1 dimension and is not empty. PPL_DIRTY_TEMP_COEFFICIENT(numer); @@ -86759,11 +89225,13 @@ Box::constrains(Variable var) const { // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dimension() < var_space_dim) + if (space_dimension() < var_space_dim) { throw_dimension_incompatible("constrains(v)", "v", var); + } - if (marked_empty() || !seq[var_space_dim-1].is_universe()) + if (marked_empty() || !seq[var_space_dim-1].is_universe()) { return true; + } // Now force an emptiness check. return is_empty(); } @@ -86774,17 +89242,19 @@ // The cylindrification with respect to no dimensions is a no-op. // This case also captures the only legal cylindrification // of a box in a 0-dim space. - if (vars.empty()) + if (vars.empty()) { return; + } // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("unconstrain(vs)", min_space_dim); - + } // If the box is already empty, there is nothing left to do. - if (marked_empty()) + if (marked_empty()) { return; + } // Here the box might still be empty (but we haven't detected it yet): // check emptiness of the interval for each of the variables in @@ -86792,8 +89262,9 @@ for (Variables_Set::const_iterator vsi = vars.begin(), vsi_end = vars.end(); vsi != vsi_end; ++vsi) { ITV& seq_vsi = seq[*vsi]; - if (!seq_vsi.is_empty()) + if (!seq_vsi.is_empty()) { seq_vsi.assign(UNIVERSE); + } else { set_empty(); break; @@ -86805,11 +89276,13 @@ template void Box::topological_closure_assign() { - if (ITV::is_always_topologically_closed() || is_empty()) + if (ITV::is_always_topologically_closed() || is_empty()) { return; + } - for (dimension_type k = seq.size(); k-- > 0; ) + for (dimension_type k = seq.size(); k-- > 0; ) { seq[k].topological_closure_assign(); + } } template @@ -86844,8 +89317,9 @@ // Wrapping no variable only requires refining with *cs_p, if any. if (vars.empty()) { - if (cs_p != 0) + if (cs_p != 0) { refine_with_constraints(*cs_p); + } return; } @@ -86861,8 +89335,9 @@ } // Wrapping an empty polyhedron is a no-op. - if (x.is_empty()) + if (x.is_empty()) { return; + } // FIXME: temporarily (ab-) using Coefficient. // Set `min_value' and `max_value' to the minimum and maximum values @@ -86902,8 +89377,9 @@ // No constraint refinement is needed here. switch (o) { case OVERFLOW_WRAPS: - for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) + for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) { x.seq[*i].wrap_assign(w, r, integer_quadrant_itv); + } reset_empty_up_to_date(); break; case OVERFLOW_UNDEFINED: @@ -86915,8 +89391,9 @@ } break; case OVERFLOW_IMPOSSIBLE: - for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) + for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) { x.seq[*i].intersect_assign(integer_quadrant_itv); + } reset_empty_up_to_date(); break; } @@ -86939,8 +89416,9 @@ // An interval constraint on variable index `c_only_var'. PPL_ASSERT(c_only_var < space_dim); // We do care about c if c_only_var is going to be wrapped. - if (vars.find(c_only_var) != vs_end) + if (vars.find(c_only_var) != vs_end) { var_cs_map[c_only_var].push_back(&c); + } } else { PPL_ASSERT(c_num_vars == 0); @@ -86978,8 +89456,9 @@ x_seq_v.wrap_assign(w, r, refinement_itv); break; case OVERFLOW_UNDEFINED: - if (!rational_quadrant_itv.contains(x_seq_v)) + if (!rational_quadrant_itv.contains(x_seq_v)) { x_seq_v.assign(UNIVERSE); + } break; case OVERFLOW_IMPOSSIBLE: x_seq_v.intersect_assign(refinement_itv); @@ -86994,14 +89473,17 @@ void Box::drop_some_non_integer_points(Complexity_Class) { if (std::numeric_limits::is_integer - && !ITV::info_type::store_open) + && !ITV::info_type::store_open) { return; + } - if (marked_empty()) + if (marked_empty()) { return; + } - for (dimension_type k = seq.size(); k-- > 0; ) + for (dimension_type k = seq.size(); k-- > 0; ) { seq[k].drop_some_non_integer_points(); + } PPL_ASSERT(OK()); } @@ -87012,20 +89494,23 @@ Complexity_Class) { // Dimension-compatibility check. const dimension_type min_space_dim = vars.space_dimension(); - if (space_dimension() < min_space_dim) + if (space_dimension() < min_space_dim) { throw_dimension_incompatible("drop_some_non_integer_points(vs, cmpl)", min_space_dim); - + } if (std::numeric_limits::is_integer - && !ITV::info_type::store_open) + && !ITV::info_type::store_open) { return; + } - if (marked_empty()) + if (marked_empty()) { return; + } for (Variables_Set::const_iterator v_i = vars.begin(), - v_end = vars.end(); v_i != v_end; ++v_i) + v_end = vars.end(); v_i != v_end; ++v_i) { seq[*v_i].drop_some_non_integer_points(); + } PPL_ASSERT(OK()); } @@ -87037,12 +89522,14 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { x.throw_dimension_incompatible("intersection_assign(y)", y); + } // If one of the two boxes is empty, the intersection is empty. - if (x.marked_empty()) + if (x.marked_empty()) { return; + } if (y.marked_empty()) { x.set_empty(); return; @@ -87050,15 +89537,17 @@ // If both boxes are zero-dimensional, then at this point they are // necessarily non-empty, so that their intersection is non-empty too. - if (space_dim == 0) + if (space_dim == 0) { return; + } // FIXME: here we may conditionally exploit a capability of the // underlying interval to eagerly detect empty results. reset_empty_up_to_date(); - for (dimension_type k = space_dim; k-- > 0; ) + for (dimension_type k = space_dim; k-- > 0; ) { x.seq[k].intersect_assign(y.seq[k]); + } PPL_ASSERT(x.OK()); } @@ -87069,19 +89558,22 @@ Box& x = *this; // Dimension-compatibility check. - if (x.space_dimension() != y.space_dimension()) + if (x.space_dimension() != y.space_dimension()) { x.throw_dimension_incompatible("upper_bound_assign(y)", y); + } // The lub of a box with an empty box is equal to the first box. - if (y.is_empty()) + if (y.is_empty()) { return; + } if (x.is_empty()) { x = y; return; } - for (dimension_type k = x.seq.size(); k-- > 0; ) + for (dimension_type k = x.seq.size(); k-- > 0; ) { x.seq[k].join_assign(y.seq[k]); + } PPL_ASSERT(x.OK()); } @@ -87094,12 +89586,14 @@ const dimension_type y_space_dim = y.space_dimension(); // If `y' is marked empty, the result will be empty too. - if (y.marked_empty()) + if (y.marked_empty()) { x.set_empty(); + } // If `y' is a 0-dim space box, there is nothing left to do. - if (y_space_dim == 0) + if (y_space_dim == 0) { return; + } // The resulting space dimension must be at most the maximum. check_space_dimension_overflow(y.space_dimension(), max_space_dimension() - space_dimension(), @@ -87123,8 +89617,9 @@ std::copy(y.seq.begin(), y.seq.end(), std::back_insert_iterator(x.seq)); // Update the `empty_up_to_date' flag. - if (!y.status.test_empty_up_to_date()) + if (!y.status.test_empty_up_to_date()) { reset_empty_up_to_date(); + } PPL_ASSERT(x.OK()); } @@ -87135,13 +89630,14 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("difference_assign(y)", y); + } Box& x = *this; - if (x.is_empty() || y.is_empty()) + if (x.is_empty() || y.is_empty()) { return; - + } switch (space_dim) { case 0: // If `x' is zero-dimensional, then at this point both `x' and `y' @@ -87151,21 +89647,25 @@ case 1: x.seq[0].difference_assign(y.seq[0]); - if (x.seq[0].is_empty()) + if (x.seq[0].is_empty()) { x.set_empty(); + } break; default: { dimension_type index_non_contained = space_dim; dimension_type number_non_contained = 0; - for (dimension_type i = space_dim; i-- > 0; ) + for (dimension_type i = space_dim; i-- > 0; ) { if (!y.seq[i].contains(x.seq[i])) { - if (++number_non_contained == 1) + if (++number_non_contained == 1) { index_non_contained = i; - else + } + else { break; + } } + } switch (number_non_contained) { case 0: @@ -87175,8 +89675,9 @@ case 1: x.seq[index_non_contained] .difference_assign(y.seq[index_non_contained]); - if (x.seq[index_non_contained].is_empty()) + if (x.seq[index_non_contained].is_empty()) { x.set_empty(); + } break; default: // Nothing to do: the difference is `x'. @@ -87194,8 +89695,9 @@ Box& x = *this; const dimension_type num_dims = x.space_dimension(); // Dimension-compatibility check. - if (num_dims != y.space_dimension()) + if (num_dims != y.space_dimension()) { x.throw_dimension_incompatible("simplify_using_context_assign(y)", y); + } // Filter away the zero-dimensional case. if (num_dims == 0) { @@ -87203,14 +89705,16 @@ x.set_nonempty(); return false; } - else + else { return !x.marked_empty(); + } } // Filter away the case when `y' is empty. if (y.is_empty()) { - for (dimension_type i = num_dims; i-- > 0; ) + for (dimension_type i = num_dims; i-- > 0; ) { x.seq[i].assign(UNIVERSE); + } x.set_nonempty(); return false; } @@ -87218,8 +89722,9 @@ if (x.is_empty()) { // Find in `y' a non-universe interval, if any. for (dimension_type i = 0; i < num_dims; ++i) { - if (y.seq[i].is_universe()) + if (y.seq[i].is_universe()) { x.seq[i].assign(UNIVERSE); + } else { // Set x.seq[i] so as to contradict y.seq[i], if possible. ITV& seq_i = x.seq[i]; @@ -87232,8 +89737,9 @@ } // We assigned to `seq_i' a non-empty interval: // set the other intervals to universe and return. - for (++i; i < num_dims; ++i) + for (++i; i < num_dims; ++i) { x.seq[i].assign(UNIVERSE); + } x.set_nonempty(); PPL_ASSERT(x.OK()); return false; @@ -87251,10 +89757,12 @@ PPL_ASSERT(!x.seq[i].is_empty()); // The intersection of `x' and `y' is empty due to the i-th interval: // reset other intervals to UNIVERSE. - for (dimension_type j = num_dims; j-- > i; ) + for (dimension_type j = num_dims; j-- > i; ) { x.seq[j].assign(UNIVERSE); - for (dimension_type j = i; j-- > 0; ) + } + for (dimension_type j = i; j-- > 0; ) { x.seq[j].assign(UNIVERSE); + } PPL_ASSERT(x.OK()); return false; } @@ -87270,13 +89778,15 @@ const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { x.throw_dimension_incompatible("time_elapse_assign(y)", y); + } // Dealing with the zero-dimensional case. if (x_space_dim == 0) { - if (y.marked_empty()) + if (y.marked_empty()) { x.set_empty(); + } return; } @@ -87291,12 +89801,16 @@ for (dimension_type i = x_space_dim; i-- > 0; ) { ITV& x_seq_i = x.seq[i]; const ITV& y_seq_i = y.seq[i]; - if (!x_seq_i.lower_is_boundary_infinity()) - if (y_seq_i.lower_is_boundary_infinity() || y_seq_i.lower() < 0) + if (!x_seq_i.lower_is_boundary_infinity()) { + if (y_seq_i.lower_is_boundary_infinity() || y_seq_i.lower() < 0) { x_seq_i.lower_extend(); - if (!x_seq_i.upper_is_boundary_infinity()) - if (y_seq_i.upper_is_boundary_infinity() || y_seq_i.upper() > 0) + } + } + if (!x_seq_i.upper_is_boundary_infinity()) { + if (y_seq_i.upper_is_boundary_infinity() || y_seq_i.upper() > 0) { x_seq_i.upper_extend(); + } + } } PPL_ASSERT(x.OK()); } @@ -87316,9 +89830,10 @@ // Dimension-compatibility check. const dimension_type vsi_space_dim = vars.space_dimension(); - if (old_space_dim < vsi_space_dim) + if (old_space_dim < vsi_space_dim) { throw_dimension_incompatible("remove_space_dimensions(vs)", vsi_space_dim); + } const dimension_type new_space_dim = old_space_dim - vars.size(); @@ -87340,13 +89855,16 @@ for (++vsi; vsi != vsi_end; ++vsi) { const dimension_type vsi_next = *vsi; // All intervals in between are moved to the left. - while (src < vsi_next) + while (src < vsi_next) { swap(seq[dst++], seq[src++]); + } ++src; } + // Moving the remaining intervals. - while (src < old_space_dim) + while (src < old_space_dim) { swap(seq[dst++], seq[src++]); + } PPL_ASSERT(dst == new_space_dim); seq.resize(new_space_dim); @@ -87360,9 +89878,10 @@ // Dimension-compatibility check: the variable having // maximum index is the one occurring last in the set. const dimension_type space_dim = space_dimension(); - if (new_dimension > space_dim) + if (new_dimension > space_dim) { throw_dimension_incompatible("remove_higher_space_dimensions(nd)", new_dimension); + } // The removal of no dimensions from any box is a no-op. // Note that this case also captures the only legal removal of @@ -87381,8 +89900,9 @@ void Box::map_space_dimensions(const Partial_Function& pfunc) { const dimension_type space_dim = space_dimension(); - if (space_dim == 0) + if (space_dim == 0) { return; + } if (pfunc.has_empty_codomain()) { // All dimensions vanish: the box becomes zero_dimensional. @@ -87402,8 +89922,9 @@ // Map the intervals, exchanging the indexes. for (dimension_type i = 0; i < space_dim; ++i) { dimension_type new_i; - if (pfunc.maps(i, new_i)) + if (pfunc.maps(i, new_i)) { swap(seq[i], tmp.seq[new_i]); + } } m_swap(tmp); PPL_ASSERT(OK()); @@ -87415,22 +89936,25 @@ const Variable dest) { const dimension_type space_dim = space_dimension(); // `dest' should be one of the dimensions of the box. - if (dest.space_dimension() > space_dim) + if (dest.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", "v", dest); + } // The folding of no dimensions is a no-op. - if (vars.empty()) + if (vars.empty()) { return; + } // All variables in `vars' should be dimensions of the box. - if (vars.space_dimension() > space_dim) + if (vars.space_dimension() > space_dim) { throw_dimension_incompatible("fold_space_dimensions(vs, v)", vars.space_dimension()); - + } // Moreover, `dest.id()' should not occur in `vars'. - if (vars.find(dest.id()) != vars.end()) + if (vars.find(dest.id()) != vars.end()) { throw_invalid_argument("fold_space_dimensions(vs, v)", "v should not occur in vs"); + } // Note: the check for emptiness is needed for correctness. if (!is_empty()) { @@ -87438,8 +89962,9 @@ // corresponding to the variables in `vars'. ITV& seq_v = seq[dest.id()]; for (Variables_Set::const_iterator i = vars.begin(), - vs_end = vars.end(); i != vs_end; ++i) + vs_end = vars.end(); i != vs_end; ++i) { seq_v.join_assign(seq[*i]); + } } remove_space_dimensions(vars); } @@ -87452,28 +89977,32 @@ dimension_type c_num_vars = 0; dimension_type c_only_var = 0; // Throw an exception if c is not an interval constraints. - if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) + if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) { throw_invalid_argument("add_constraint(c)", "c is not an interval constraint"); + } // Throw an exception if c is a nontrivial strict constraint // and ITV does not support open boundaries. if (c.is_strict_inequality() && c_num_vars != 0 - && ITV::is_always_topologically_closed()) + && ITV::is_always_topologically_closed()) { throw_invalid_argument("add_constraint(c)", "c is a nontrivial strict constraint"); + } // Avoid doing useless work if the box is known to be empty. - if (marked_empty()) + if (marked_empty()) { return; + } const Coefficient& n = c.inhomogeneous_term(); if (c_num_vars == 0) { // Dealing with a trivial constraint. if (n < 0 || (c.is_equality() && n != 0) - || (c.is_strict_inequality() && n == 0)) + || (c.is_strict_inequality() && n == 0)) { set_empty(); + } return; } @@ -87490,8 +90019,9 @@ // through all the constraints to fulfill the method's contract // for what concerns exception throwing. for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); i != cs_end; ++i) + cs_end = cs.end(); i != cs_end; ++i) { add_constraint_no_check(*i); + } PPL_ASSERT(OK()); } @@ -87506,30 +90036,35 @@ set_empty(); return; } - else if (cg.is_tautological()) + else if (cg.is_tautological()) { return; - else + } + else { throw_invalid_argument("add_congruence(cg)", "cg is a nontrivial proper congruence"); + } } PPL_ASSERT(cg.is_equality()); dimension_type cg_num_vars = 0; dimension_type cg_only_var = 0; // Throw an exception if c is not an interval congruence. - if (!Box_Helpers::extract_interval_congruence(cg, cg_num_vars, cg_only_var)) + if (!Box_Helpers::extract_interval_congruence(cg, cg_num_vars, cg_only_var)) { throw_invalid_argument("add_congruence(cg)", "cg is not an interval congruence"); + } // Avoid doing useless work if the box is known to be empty. - if (marked_empty()) + if (marked_empty()) { return; + } const Coefficient& n = cg.inhomogeneous_term(); if (cg_num_vars == 0) { // Dealing with a trivial equality congruence. - if (n != 0) + if (n != 0) { set_empty(); + } return; } @@ -87546,8 +90081,9 @@ // through all the congruences to fulfill the method's contract // for what concerns exception throwing. for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); i != cgs_end; ++i) + cgs_end = cgs.end(); i != cgs_end; ++i) { add_congruence_no_check(*i); + } PPL_ASSERT(OK()); } @@ -87570,8 +90106,9 @@ // Dealing with a trivial constraint. if (n < 0 || (c.is_equality() && n != 0) - || (c.is_strict_inequality() && n == 0)) + || (c.is_strict_inequality() && n == 0)) { set_empty(); + } return; } @@ -87585,8 +90122,9 @@ Box::refine_no_check(const Constraint_System& cs) { PPL_ASSERT(cs.space_dimension() <= space_dimension()); for (Constraint_System::const_iterator i = cs.begin(), - cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) + cs_end = cs.end(); !marked_empty() && i != cs_end; ++i) { refine_no_check(*i); + } PPL_ASSERT(OK()); } @@ -87600,8 +90138,9 @@ if (cg.is_proper_congruence()) { // A proper congruences is also an interval constraint // if and only if it is trivial. - if (cg.is_inconsistent()) + if (cg.is_inconsistent()) { set_empty(); + } return; } @@ -87615,8 +90154,9 @@ Box::refine_no_check(const Congruence_System& cgs) { PPL_ASSERT(cgs.space_dimension() <= space_dimension()); for (Congruence_System::const_iterator i = cgs.begin(), - cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) + cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i) { refine_no_check(*i); + } PPL_ASSERT(OK()); } @@ -87638,8 +90178,9 @@ return false; case V_LE: case V_GE: - if (open == T_NO) + if (open == T_NO) { open = T_MAYBE; + } return false; case V_EQ: return false; @@ -87676,8 +90217,9 @@ // Constraint c is trivial: check if it is inconsistent. if (c_inhomogeneous_term < 0 || (c_inhomogeneous_term == 0 - && c_type != Constraint::NONSTRICT_INEQUALITY)) + && c_type != Constraint::NONSTRICT_INEQUALITY)) { set_empty(); + } return; } @@ -87693,70 +90235,88 @@ const Coefficient& a_k = *k; const Variable k_var = k.variable(); const int sgn_a_k = sgn(a_k); - if (sgn_a_k == 0) + if (sgn_a_k == 0) { continue; + } Result r; if (sgn_a_k > 0) { open = (c_type == Constraint::STRICT_INEQUALITY) ? T_YES : T_NO; - if (open == T_NO) + if (open == T_NO) { maybe_reset_fpu_inexact(); + } r = assign_r(t_bound, c_inhomogeneous_term, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } r = neg_assign_r(t_bound, t_bound, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } for (Constraint::expr_type::const_iterator i = c_e.begin(), i_end = c_e.lower_bound(Variable(last_k)); i != i_end; ++i) { const Variable i_var = i.variable(); - if (i_var.id() == k_var.id()) + if (i_var.id() == k_var.id()) { continue; + } const Coefficient& a_i = *i; const int sgn_a_i = sgn(a_i); ITV& x_i = seq[i_var.id()]; if (sgn_a_i < 0) { - if (x_i.lower_is_boundary_infinity()) + if (x_i.lower_is_boundary_infinity()) { goto maybe_refine_upper_1; + } r = assign_r(t_a, a_i, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } r = assign_r(t_x, x_i.lower(), ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; - if (x_i.lower_is_open()) + } + if (x_i.lower_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } } else { PPL_ASSERT(sgn_a_i > 0); - if (x_i.upper_is_boundary_infinity()) + if (x_i.upper_is_boundary_infinity()) { goto maybe_refine_upper_1; + } r = assign_r(t_a, a_i, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } r = assign_r(t_x, x_i.upper(), ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; - if (x_i.upper_is_open()) + } + if (x_i.upper_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } } } r = assign_r(t_a, a_k, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } r = div_assign_r(t_bound, t_bound, t_a, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_1; + } // Refine the lower bound of `seq[k]' with `t_bound'. if (open == T_MAYBE - && maybe_check_fpu_inexact() == 1) + && maybe_check_fpu_inexact() == 1) { open = T_YES; + } { const Relation_Symbol rel = (open == T_YES) ? GREATER_THAN : GREATER_OR_EQUAL; @@ -87764,67 +90324,84 @@ } reset_empty_up_to_date(); maybe_refine_upper_1: - if (c_type != Constraint::EQUALITY) + if (c_type != Constraint::EQUALITY) { continue; + } open = T_NO; maybe_reset_fpu_inexact(); r = assign_r(t_bound, c_inhomogeneous_term, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = neg_assign_r(t_bound, t_bound, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } for (Constraint::expr_type::const_iterator i = c_e.begin(), i_end = c_e.lower_bound(Variable(c_space_dim)); i != i_end; ++i) { const Variable i_var = i.variable(); - if (i_var.id() == k_var.id()) + if (i_var.id() == k_var.id()) { continue; + } const Coefficient& a_i = *i; const int sgn_a_i = sgn(a_i); ITV& x_i = seq[i_var.id()]; if (sgn_a_i < 0) { - if (x_i.upper_is_boundary_infinity()) + if (x_i.upper_is_boundary_infinity()) { goto next_k; + } r = assign_r(t_a, a_i, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = assign_r(t_x, x_i.upper(), ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; - if (x_i.upper_is_open()) + } + if (x_i.upper_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } } else { PPL_ASSERT(sgn_a_i > 0); - if (x_i.lower_is_boundary_infinity()) + if (x_i.lower_is_boundary_infinity()) { goto next_k; + } r = assign_r(t_a, a_i, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = assign_r(t_x, x_i.lower(), ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; - if (x_i.lower_is_open()) + } + if (x_i.lower_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } } } r = assign_r(t_a, a_k, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = div_assign_r(t_bound, t_bound, t_a, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } // Refine the upper bound of seq[k] with t_bound. if (open == T_MAYBE - && maybe_check_fpu_inexact() == 1) + && maybe_check_fpu_inexact() == 1) { open = T_YES; + } const Relation_Symbol rel = (open == T_YES) ? LESS_THAN : LESS_OR_EQUAL; seq[k_var.id()].add_constraint(i_constraint(rel, t_bound)); @@ -87833,65 +90410,81 @@ else { PPL_ASSERT(sgn_a_k < 0); open = (c_type == Constraint::STRICT_INEQUALITY) ? T_YES : T_NO; - if (open == T_NO) + if (open == T_NO) { maybe_reset_fpu_inexact(); + } r = assign_r(t_bound, c_inhomogeneous_term, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } r = neg_assign_r(t_bound, t_bound, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } for (Constraint::expr_type::const_iterator i = c_e.begin(), i_end = c_e.lower_bound(Variable(c_space_dim)); i != i_end; ++i) { const Variable i_var = i.variable(); - if (i_var.id() == k_var.id()) + if (i_var.id() == k_var.id()) { continue; + } const Coefficient& a_i = *i; const int sgn_a_i = sgn(a_i); ITV& x_i = seq[i_var.id()]; if (sgn_a_i < 0) { - if (x_i.lower_is_boundary_infinity()) + if (x_i.lower_is_boundary_infinity()) { goto maybe_refine_upper_2; + } r = assign_r(t_a, a_i, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } r = assign_r(t_x, x_i.lower(), ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; - if (x_i.lower_is_open()) + } + if (x_i.lower_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } } else { PPL_ASSERT(sgn_a_i > 0); - if (x_i.upper_is_boundary_infinity()) + if (x_i.upper_is_boundary_infinity()) { goto maybe_refine_upper_2; + } r = assign_r(t_a, a_i, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } r = assign_r(t_x, x_i.upper(), ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; - if (x_i.upper_is_open()) + } + if (x_i.upper_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } } } r = assign_r(t_a, a_k, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; + } r = div_assign_r(t_bound, t_bound, t_a, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto maybe_refine_upper_2; - + } // Refine the upper bound of seq[k] with t_bound. if (open == T_MAYBE - && maybe_check_fpu_inexact() == 1) + && maybe_check_fpu_inexact() == 1) { open = T_YES; + } { const Relation_Symbol rel = (open == T_YES) ? LESS_THAN : LESS_OR_EQUAL; @@ -87899,67 +90492,84 @@ } reset_empty_up_to_date(); maybe_refine_upper_2: - if (c_type != Constraint::EQUALITY) + if (c_type != Constraint::EQUALITY) { continue; + } open = T_NO; maybe_reset_fpu_inexact(); r = assign_r(t_bound, c_inhomogeneous_term, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = neg_assign_r(t_bound, t_bound, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } for (Constraint::expr_type::const_iterator i = c_e.begin(), i_end = c_e.lower_bound(Variable(c_space_dim)); i != i_end; ++i) { const Variable i_var = i.variable(); - if (i_var.id() == k_var.id()) + if (i_var.id() == k_var.id()) { continue; + } const Coefficient& a_i = *i; const int sgn_a_i = sgn(a_i); ITV& x_i = seq[i_var.id()]; if (sgn_a_i < 0) { - if (x_i.upper_is_boundary_infinity()) + if (x_i.upper_is_boundary_infinity()) { goto next_k; + } r = assign_r(t_a, a_i, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = assign_r(t_x, x_i.upper(), ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; - if (x_i.upper_is_open()) + } + if (x_i.upper_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } } else { PPL_ASSERT(sgn_a_i > 0); - if (x_i.lower_is_boundary_infinity()) + if (x_i.lower_is_boundary_infinity()) { goto next_k; + } r = assign_r(t_a, a_i, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = assign_r(t_x, x_i.lower(), ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; - if (x_i.lower_is_open()) + } + if (x_i.lower_is_open()) { open = T_YES; + } r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } } } r = assign_r(t_a, a_k, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } r = div_assign_r(t_bound, t_bound, t_a, ROUND_DOWN); - if (propagate_constraint_check_result(r, open)) + if (propagate_constraint_check_result(r, open)) { goto next_k; + } // Refine the lower bound of seq[k] with t_bound. if (open == T_MAYBE - && maybe_check_fpu_inexact() == 1) + && maybe_check_fpu_inexact() == 1) { open = T_YES; + } const Relation_Symbol rel = (open == T_YES) ? GREATER_THAN : GREATER_OR_EQUAL; seq[k_var.id()].add_constraint(i_constraint(rel, t_bound)); @@ -87997,8 +90607,9 @@ for (Constraint::expr_type::const_iterator j = c_e.begin(), j_end = c_e.lower_bound(Variable(c_space_dim)); j != j_end; ++j) { const Variable j_var = j.variable(); - if (i_var == j_var) + if (i_var == j_var) { continue; + } q.add_assign(q, p[j_var.id()]); } q.div_assign(q, k[i_var.id()]); @@ -88052,8 +90663,9 @@ WEIGHT_BEGIN(); ++num_iterations; copy = seq; - for (Constraint_System::const_iterator i = cs_begin; i != cs_end; ++i) + for (Constraint_System::const_iterator i = cs_begin; i != cs_end; ++i) { propagate_constraint_no_check(*i); + } WEIGHT_ADD_MUL(40, propagation_weight); // Check if the client has requested abandoning all expensive @@ -88063,8 +90675,9 @@ // NOTE: if max_iterations == 0 (i.e., no iteration limit is set) // the following test will anyway trigger on wrap around. - if (num_iterations == max_iterations) + if (num_iterations == max_iterations) { break; + } changed = (copy != seq); } while (changed); @@ -88076,21 +90689,25 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_image(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. const dimension_type space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (space_dim < expr_space_dim) + if (space_dim < expr_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "e", expr); + } // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "v", var); + } - if (is_empty()) + if (is_empty()) { return; + } Tmp_Interval_Type expr_value; Tmp_Interval_Type temp0; @@ -88125,15 +90742,19 @@ // Dimension-compatibility checks. const dimension_type space_dim = space_dimension(); const dimension_type lf_space_dim = lf.space_dimension(); - if (space_dim < lf_space_dim) + if (space_dim < lf_space_dim) { throw_dimension_incompatible("affine_form_image(var, lf)", "lf", lf); + } + // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("affine_form_image(var, lf)", "var", var); + } - if (is_empty()) + if (is_empty()) { return; + } // Intervalization of 'lf'. ITV result = lf.inhomogeneous_term(); @@ -88155,21 +90776,25 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("affine_preimage(v, e, d)", "d == 0"); + } // Dimension-compatibility checks. const dimension_type x_space_dim = space_dimension(); const dimension_type expr_space_dim = expr.space_dimension(); - if (x_space_dim < expr_space_dim) + if (x_space_dim < expr_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr); + } // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (x_space_dim < var_space_dim) + if (x_space_dim < var_space_dim) { throw_dimension_incompatible("affine_preimage(v, e, d)", "v", var); + } - if (is_empty()) + if (is_empty()) { return; + } const Coefficient& expr_v = expr.coefficient(var); const bool invertible = (expr_v != 0); @@ -88191,10 +90816,12 @@ } ITV& x_seq_v = seq[var.id()]; expr_value.intersect_assign(x_seq_v); - if (expr_value.is_empty()) + if (expr_value.is_empty()) { set_empty(); - else + } + else { x_seq_v.assign(UNIVERSE); + } } else { // The affine transformation is invertible. @@ -88217,35 +90844,40 @@ const Linear_Expression& ub_expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0"); + } // Dimension-compatibility checks. const dimension_type space_dim = space_dimension(); // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)", "ub", ub_expr); + } // `var' should be one of the dimensions of the box. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("affine_image(v, e, d)", "v", var); - + } // Any image of an empty box is empty. - if (is_empty()) + if (is_empty()) { return; - + } // Add the constraint implied by the `lb_expr' and `ub_expr'. - if (denominator > 0) + if (denominator > 0) { refine_with_constraint(lb_expr <= ub_expr); - else + } + else { refine_with_constraint(lb_expr >= ub_expr); + } // Check whether `var' occurs in `lb_expr' and/or `ub_expr'. if (lb_expr.coefficient(var) == 0) { @@ -88254,10 +90886,12 @@ LESS_OR_EQUAL, ub_expr, denominator); - if (denominator > 0) + if (denominator > 0) { refine_with_constraint(lb_expr <= denominator*var); - else + } + else { refine_with_constraint(denominator*var <= lb_expr); + } } else if (ub_expr.coefficient(var) == 0) { // Here `var' can only occur in `lb_expr'. @@ -88265,21 +90899,23 @@ GREATER_OR_EQUAL, lb_expr, denominator); - if (denominator > 0) + if (denominator > 0) { refine_with_constraint(denominator*var <= ub_expr); - else + } + else { refine_with_constraint(ub_expr <= denominator*var); + } } else { // Here `var' occurs in both `lb_expr' and `ub_expr'. As boxes // can only use the non-relational constraints, we find the // maximum/minimum values `ub_expr' and `lb_expr' obtain with the // box and use these instead of the `ub-expr' and `lb-expr'. - PPL_DIRTY_TEMP(Coefficient, max_numer); - PPL_DIRTY_TEMP(Coefficient, max_denom); + PPL_DIRTY_TEMP_COEFFICIENT(max_numer); + PPL_DIRTY_TEMP_COEFFICIENT(max_denom); bool max_included; - PPL_DIRTY_TEMP(Coefficient, min_numer); - PPL_DIRTY_TEMP(Coefficient, min_denom); + PPL_DIRTY_TEMP_COEFFICIENT(min_numer); + PPL_DIRTY_TEMP_COEFFICIENT(min_denom); bool min_included; ITV& seq_v = seq[var.id()]; if (maximize(ub_expr, max_numer, max_denom, max_included)) { @@ -88360,29 +90996,34 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. const dimension_type space_dim = space_dimension(); - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0"); + } // Dimension-compatibility checks. // `var' should be one of the dimensions of the polyhedron. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "v", var); + } // The dimension of `lb_expr' and `ub_expr' should not be // greater than the dimension of `*this'. const dimension_type lb_space_dim = lb_expr.space_dimension(); - if (space_dim < lb_space_dim) + if (space_dim < lb_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "lb", lb_expr); + } const dimension_type ub_space_dim = ub_expr.space_dimension(); - if (space_dim < ub_space_dim) + if (space_dim < ub_space_dim) { throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)", "ub", ub_expr); + } // Any preimage of an empty polyhedron is empty. - if (marked_empty()) + if (marked_empty()) { return; + } const bool negative_denom = (denominator < 0); const Coefficient& lb_var_coeff = lb_expr.coefficient(var); @@ -88391,10 +91032,12 @@ // If the implied constraint between `ub_expr and `lb_expr' is // independent of `var', then impose it now. if (lb_var_coeff == ub_var_coeff) { - if (negative_denom) + if (negative_denom) { refine_with_constraint(lb_expr >= ub_expr); - else + } + else { refine_with_constraint(lb_expr <= ub_expr); + } } ITV& seq_var = seq[var.id()]; @@ -88403,35 +91046,38 @@ // so the sign and its (unsigned) value are separated. PPL_DIRTY_TEMP_COEFFICIENT(pos_denominator); pos_denominator = denominator; - if (negative_denom) + if (negative_denom) { neg_assign(pos_denominator, pos_denominator); + } // Store all the information about the upper and lower bounds // for `var' before making this interval unbounded. bool open_lower = seq_var.lower_is_open(); bool unbounded_lower = seq_var.lower_is_boundary_infinity(); PPL_DIRTY_TEMP(mpq_class, q_seq_var_lower); - PPL_DIRTY_TEMP(Coefficient, numer_lower); - PPL_DIRTY_TEMP(Coefficient, denom_lower); + PPL_DIRTY_TEMP_COEFFICIENT(numer_lower); + PPL_DIRTY_TEMP_COEFFICIENT(denom_lower); if (!unbounded_lower) { assign_r(q_seq_var_lower, seq_var.lower(), ROUND_NOT_NEEDED); assign_r(numer_lower, q_seq_var_lower.get_num(), ROUND_NOT_NEEDED); assign_r(denom_lower, q_seq_var_lower.get_den(), ROUND_NOT_NEEDED); - if (negative_denom) + if (negative_denom) { neg_assign(denom_lower, denom_lower); + } numer_lower *= pos_denominator; seq_var.lower_extend(); } bool open_upper = seq_var.upper_is_open(); bool unbounded_upper = seq_var.upper_is_boundary_infinity(); PPL_DIRTY_TEMP(mpq_class, q_seq_var_upper); - PPL_DIRTY_TEMP(Coefficient, numer_upper); - PPL_DIRTY_TEMP(Coefficient, denom_upper); + PPL_DIRTY_TEMP_COEFFICIENT(numer_upper); + PPL_DIRTY_TEMP_COEFFICIENT(denom_upper); if (!unbounded_upper) { assign_r(q_seq_var_upper, seq_var.upper(), ROUND_NOT_NEEDED); assign_r(numer_upper, q_seq_var_upper.get_num(), ROUND_NOT_NEEDED); assign_r(denom_upper, q_seq_var_upper.get_den(), ROUND_NOT_NEEDED); - if (negative_denom) + if (negative_denom) { neg_assign(denom_upper, denom_upper); + } numer_upper *= pos_denominator; seq_var.upper_extend(); } @@ -88442,7 +91088,7 @@ // and adding the lower bound for `var' to the inhomogeneous term. Linear_Expression revised_lb_expr(ub_expr); revised_lb_expr -= ub_var_coeff * var; - PPL_DIRTY_TEMP(Coefficient, d); + PPL_DIRTY_TEMP_COEFFICIENT(d); neg_assign(d, denom_lower); revised_lb_expr *= d; revised_lb_expr += numer_lower; @@ -88450,20 +91096,23 @@ // Find the minimum value for the revised lower bound expression // and use this to refine the appropriate bound. bool included; - PPL_DIRTY_TEMP(Coefficient, denom); + PPL_DIRTY_TEMP_COEFFICIENT(denom); if (minimize(revised_lb_expr, numer_lower, denom, included)) { denom_lower *= (denom * ub_var_coeff); PPL_DIRTY_TEMP(mpq_class, q); assign_r(q.get_num(), numer_lower, ROUND_NOT_NEEDED); assign_r(q.get_den(), denom_lower, ROUND_NOT_NEEDED); q.canonicalize(); - if (!included) + if (!included) { open_lower = true; + } Relation_Symbol rel; - if ((ub_var_coeff >= 0) ? !negative_denom : negative_denom) + if ((ub_var_coeff >= 0) ? !negative_denom : negative_denom) { rel = open_lower ? GREATER_THAN : GREATER_OR_EQUAL; - else + } + else { rel = open_lower ? LESS_THAN : LESS_OR_EQUAL; + } seq_var.add_constraint(i_constraint(rel, q)); if (seq_var.is_empty()) { set_empty(); @@ -88478,7 +91127,7 @@ // and adding the upper bound for `var' to the inhomogeneous term. Linear_Expression revised_ub_expr(lb_expr); revised_ub_expr -= lb_var_coeff * var; - PPL_DIRTY_TEMP(Coefficient, d); + PPL_DIRTY_TEMP_COEFFICIENT(d); neg_assign(d, denom_upper); revised_ub_expr *= d; revised_ub_expr += numer_upper; @@ -88486,20 +91135,23 @@ // Find the maximum value for the revised upper bound expression // and use this to refine the appropriate bound. bool included; - PPL_DIRTY_TEMP(Coefficient, denom); + PPL_DIRTY_TEMP_COEFFICIENT(denom); if (maximize(revised_ub_expr, numer_upper, denom, included)) { denom_upper *= (denom * lb_var_coeff); PPL_DIRTY_TEMP(mpq_class, q); assign_r(q.get_num(), numer_upper, ROUND_NOT_NEEDED); assign_r(q.get_den(), denom_upper, ROUND_NOT_NEEDED); q.canonicalize(); - if (!included) + if (!included) { open_upper = true; + } Relation_Symbol rel; - if ((lb_var_coeff >= 0) ? !negative_denom : negative_denom) + if ((lb_var_coeff >= 0) ? !negative_denom : negative_denom) { rel = open_upper ? LESS_THAN : LESS_OR_EQUAL; - else + } + else { rel = open_upper ? GREATER_THAN : GREATER_OR_EQUAL; + } seq_var.add_constraint(i_constraint(rel, q)); if (seq_var.is_empty()) { set_empty(); @@ -88512,10 +91164,12 @@ // If the implied constraint between `ub_expr and `lb_expr' is // dependent on `var', then impose on the new box. if (lb_var_coeff != ub_var_coeff) { - if (denominator > 0) + if (denominator > 0) { refine_with_constraint(lb_expr <= ub_expr); - else + } + else { refine_with_constraint(lb_expr >= ub_expr); + } } PPL_ASSERT(OK()); @@ -88529,37 +91183,42 @@ const Linear_Expression& expr, Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "d == 0"); + } // Dimension-compatibility checks. const dimension_type space_dim = space_dimension(); // The dimension of `expr' should not be greater than the dimension // of `*this'. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "e", expr); + } // `var' should be one of the dimensions of the box. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "v", var); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(v, r, e, d)", "r is the disequality relation symbol"); + } // First compute the affine image. affine_image(var, expr, denominator); - if (relsym == EQUAL) + if (relsym == EQUAL) { // The affine relation is indeed an affine function. return; - + } // Any image of an empty box is empty. - if (is_empty()) + if (is_empty()) { return; + } ITV& seq_var = seq[var.id()]; switch (relsym) { @@ -88568,16 +91227,18 @@ break; case LESS_THAN: seq_var.lower_extend(); - if (!seq_var.upper_is_boundary_infinity()) + if (!seq_var.upper_is_boundary_infinity()) { seq_var.remove_sup(); + } break; case GREATER_OR_EQUAL: seq_var.upper_extend(); break; case GREATER_THAN: seq_var.upper_extend(); - if (!seq_var.lower_is_boundary_infinity()) + if (!seq_var.lower_is_boundary_infinity()) { seq_var.remove_inf(); + } break; default: // The EQUAL and NOT_EQUAL cases have been already dealt with. @@ -88596,26 +91257,29 @@ Coefficient_traits::const_reference denominator) { // The denominator cannot be zero. - if (denominator == 0) + if (denominator == 0) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "d == 0"); - + } // Dimension-compatibility checks. const dimension_type space_dim = space_dimension(); // The dimension of `expr' should not be greater than the dimension // of `*this'. - if (space_dim < expr.space_dimension()) + if (space_dim < expr.space_dimension()) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", "e", expr); + } // `var' should be one of the dimensions of the box. const dimension_type var_space_dim = var.space_dimension(); - if (space_dim < var_space_dim) + if (space_dim < var_space_dim) { throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)", "v", var); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "r is the disequality relation symbol"); + } // Check whether the affine relation is indeed an affine function. if (relsym == EQUAL) { @@ -88668,12 +91332,12 @@ // First, compute the maximum and minimum value reached by // `denominator*var' on the box as we need to use non-relational // expressions. - PPL_DIRTY_TEMP(Coefficient, max_numer); - PPL_DIRTY_TEMP(Coefficient, max_denom); + PPL_DIRTY_TEMP_COEFFICIENT(max_numer); + PPL_DIRTY_TEMP_COEFFICIENT(max_denom); bool max_included; bool bound_above = maximize(denominator*var, max_numer, max_denom, max_included); - PPL_DIRTY_TEMP(Coefficient, min_numer); - PPL_DIRTY_TEMP(Coefficient, min_denom); + PPL_DIRTY_TEMP_COEFFICIENT(min_numer); + PPL_DIRTY_TEMP_COEFFICIENT(min_denom); bool min_included; bool bound_below = minimize(denominator*var, min_numer, min_denom, min_included); // Use the correct relation symbol @@ -88700,24 +91364,28 @@ switch (corrected_relsym) { case LESS_THAN: - if (bound_below) + if (bound_below) { refine_with_constraint(min_numer < revised_expr); + } break; case LESS_OR_EQUAL: - if (bound_below) + if (bound_below) { (min_included) ? refine_with_constraint(min_numer <= revised_expr) : refine_with_constraint(min_numer < revised_expr); + } break; case GREATER_OR_EQUAL: - if (bound_above) + if (bound_above) { (max_included) ? refine_with_constraint(max_numer >= revised_expr) : refine_with_constraint(max_numer > revised_expr); + } break; case GREATER_THAN: - if (bound_above) + if (bound_above) { refine_with_constraint(max_numer > revised_expr); + } break; default: // The EQUAL and NOT_EQUAL cases have been already dealt with. @@ -88725,8 +91393,9 @@ break; } // If the shrunk box is empty, its preimage is empty too. - if (is_empty()) + if (is_empty()) { return; + } ITV& seq_v = seq[var.id()]; seq_v.assign(UNIVERSE); PPL_ASSERT(OK()); @@ -88743,32 +91412,36 @@ // of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); const dimension_type space_dim = space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e1", lhs); + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e2", rhs); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is the disequality relation symbol"); + } // Any image of an empty box is empty. - if (marked_empty()) + if (marked_empty()) { return; + } // Compute the maximum and minimum value reached by the rhs on the box. - PPL_DIRTY_TEMP(Coefficient, max_numer); - PPL_DIRTY_TEMP(Coefficient, max_denom); + PPL_DIRTY_TEMP_COEFFICIENT(max_numer); + PPL_DIRTY_TEMP_COEFFICIENT(max_denom); bool max_included; bool max_rhs = maximize(rhs, max_numer, max_denom, max_included); - PPL_DIRTY_TEMP(Coefficient, min_numer); - PPL_DIRTY_TEMP(Coefficient, min_denom); + PPL_DIRTY_TEMP_COEFFICIENT(min_numer); + PPL_DIRTY_TEMP_COEFFICIENT(min_denom); bool min_included; bool min_rhs = minimize(rhs, min_numer, min_denom, min_included); @@ -88826,7 +91499,7 @@ // The choice as to which bounds should be set depends on the sign // of the coefficient of the dimension `has_var_id' in the lhs. - if (coeff > 0) + if (coeff > 0) { // The coefficient of the dimension in the lhs is positive. switch (relsym) { case LESS_OR_EQUAL: @@ -88834,23 +91507,28 @@ Relation_Symbol rel = max_included ? LESS_OR_EQUAL : LESS_THAN; seq_var.build(i_constraint(rel, q_max)); } - else + else { seq_var.assign(UNIVERSE); + } break; case LESS_THAN: - if (max_rhs) + if (max_rhs) { seq_var.build(i_constraint(LESS_THAN, q_max)); - else + } + else { seq_var.assign(UNIVERSE); + } break; case EQUAL: { I_Constraint l; I_Constraint u; - if (max_rhs) + if (max_rhs) { u.set(max_included ? LESS_OR_EQUAL : LESS_THAN, q_max); - if (min_rhs) + } + if (min_rhs) { l.set(min_included ? GREATER_OR_EQUAL : GREATER_THAN, q_min); + } seq_var.build(l, u); break; } @@ -88859,21 +91537,25 @@ Relation_Symbol rel = min_included ? GREATER_OR_EQUAL : GREATER_THAN; seq_var.build(i_constraint(rel, q_min)); } - else + else { seq_var.assign(UNIVERSE); + } break; case GREATER_THAN: - if (min_rhs) + if (min_rhs) { seq_var.build(i_constraint(GREATER_THAN, q_min)); - else + } + else { seq_var.assign(UNIVERSE); + } break; default: // The NOT_EQUAL case has been already dealt with. PPL_UNREACHABLE; break; } - else + } + else { // The coefficient of the dimension in the lhs is negative. switch (relsym) { case GREATER_OR_EQUAL: @@ -88881,23 +91563,28 @@ Relation_Symbol rel = min_included ? LESS_OR_EQUAL : LESS_THAN; seq_var.build(i_constraint(rel, q_min)); } - else + else { seq_var.assign(UNIVERSE); + } break; case GREATER_THAN: - if (min_rhs) + if (min_rhs) { seq_var.build(i_constraint(LESS_THAN, q_min)); - else + } + else { seq_var.assign(UNIVERSE); + } break; case EQUAL: { I_Constraint l; I_Constraint u; - if (max_rhs) + if (max_rhs) { l.set(max_included ? GREATER_OR_EQUAL : GREATER_THAN, q_max); - if (min_rhs) + } + if (min_rhs) { u.set(min_included ? LESS_OR_EQUAL : LESS_THAN, q_min); + } seq_var.build(l, u); break; } @@ -88906,20 +91593,24 @@ Relation_Symbol rel = max_included ? GREATER_OR_EQUAL : GREATER_THAN; seq_var.build(i_constraint(rel, q_max)); } - else + else { seq_var.assign(UNIVERSE); + } break; case LESS_THAN: - if (max_rhs) + if (max_rhs) { seq_var.build(i_constraint(GREATER_THAN, q_max)); - else + } + else { seq_var.assign(UNIVERSE); + } break; default: // The NOT_EQUAL case has been already dealt with. PPL_UNREACHABLE; break; } + } } else { @@ -88961,25 +91652,27 @@ // of `*this'. dimension_type lhs_space_dim = lhs.space_dimension(); const dimension_type space_dim = space_dimension(); - if (space_dim < lhs_space_dim) + if (space_dim < lhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e1", lhs); + } // The dimension of `rhs' should not be greater than the dimension // of `*this'. const dimension_type rhs_space_dim = rhs.space_dimension(); - if (space_dim < rhs_space_dim) + if (space_dim < rhs_space_dim) { throw_dimension_incompatible("generalized_affine_image(e1, r, e2)", "e2", rhs); + } // The relation symbol cannot be a disequality. - if (relsym == NOT_EQUAL) + if (relsym == NOT_EQUAL) { throw_invalid_argument("generalized_affine_image(e1, r, e2)", "r is the disequality relation symbol"); - + } // Any image of an empty box is empty. - if (marked_empty()) + if (marked_empty()) { return; - + } // For any dimension occurring in the lhs, swap and change the sign // of this component for the rhs and lhs. Then use these in a call // to generalized_affine_image/3. @@ -89004,11 +91697,12 @@ && Is_Same_Or_Derived::value, void>::type Box::CC76_widening_assign(const T& y, Iterator first, Iterator last) { - if (y.is_empty()) + if (y.is_empty()) { return; - - for (dimension_type i = seq.size(); i-- > 0; ) + } + for (dimension_type i = seq.size(); i-- > 0; ) { seq[i].CC76_widening_assign(y.seq[i], first, last); + } PPL_ASSERT(OK()); } @@ -89033,8 +91727,9 @@ Box x_tmp(x); x_tmp.CC76_widening_assign(y, 0); // If the widening was not precise, use one of the available tokens. - if (!x.contains(x_tmp)) + if (!x.contains(x_tmp)) { --(*tp); + } return; } x.CC76_widening_assign(y, @@ -89056,8 +91751,9 @@ dimension_type c_num_vars = 0; dimension_type c_only_var = 0; // Constraints that are not interval constraints are ignored. - if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) + if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) { continue; + } // Trivial constraints are ignored. if (c_num_vars != 0) { // c is a non-trivial interval constraint. @@ -89065,9 +91761,10 @@ const Coefficient& n = c.inhomogeneous_term(); const Coefficient& d = c.coefficient(Variable(c_only_var)); if (interval_relation(seq[c_only_var], c.type(), n, d) - == Poly_Con_Relation::is_included()) + == Poly_Con_Relation::is_included()) { limiting_box.add_interval_constraint_no_check(c_only_var, c.type(), n, d); + } } } } @@ -89081,29 +91778,31 @@ const dimension_type space_dim = x.space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("limited_CC76_extrapolation_assign(y, cs)", - y); + y); + } // `cs' must be dimension-compatible with the two boxes. const dimension_type cs_space_dim = cs.space_dimension(); - if (space_dim < cs_space_dim) + if (space_dim < cs_space_dim) { throw_constraint_incompatible("limited_CC76_extrapolation_assign(y, cs)"); - + } // The limited CC76-extrapolation between two boxes in a // zero-dimensional space is also a zero-dimensional box - if (space_dim == 0) + if (space_dim == 0) { return; - + } // Assume `y' is contained in or equal to `*this'. PPL_EXPECT_HEAVY(copy_contains(*this, y)); // If `*this' is empty, since `*this' contains `y', `y' is empty too. - if (marked_empty()) + if (marked_empty()) { return; + } // If `y' is empty, we return. - if (y.marked_empty()) + if (y.marked_empty()) { return; - + } // Build a limiting box using all the constraints in cs // that are satisfied by *this. Box limiting_box(space_dim, UNIVERSE); @@ -89124,24 +91823,26 @@ const dimension_type space_dim = space_dimension(); // Dimension-compatibility check. - if (space_dim != y.space_dimension()) + if (space_dim != y.space_dimension()) { throw_dimension_incompatible("CC76_narrowing_assign(y)", y); + } // Assume `*this' is contained in or equal to `y'. PPL_EXPECT_HEAVY(copy_contains(y, *this)); // If both boxes are zero-dimensional, // since `y' contains `*this', we simply return `*this'. - if (space_dim == 0) + if (space_dim == 0) { return; - + } // If `y' is empty, since `y' contains `this', `*this' is empty too. - if (y.is_empty()) + if (y.is_empty()) { return; + } // If `*this' is empty, we return. - if (is_empty()) + if (is_empty()) { return; - + } // Replace each constraint in `*this' by the corresponding constraint // in `y' if the corresponding inhomogeneous terms are both finite. for (dimension_type i = space_dim; i-- > 0; ) { @@ -89149,12 +91850,14 @@ const ITV& y_i = y.seq[i]; if (!x_i.lower_is_boundary_infinity() && !y_i.lower_is_boundary_infinity() - && x_i.lower() != y_i.lower()) + && x_i.lower() != y_i.lower()) { x_i.lower() = y_i.lower(); + } if (!x_i.upper_is_boundary_infinity() && !y_i.upper_is_boundary_infinity() - && x_i.upper() != y_i.upper()) + && x_i.upper() != y_i.upper()) { x_i.upper() = y_i.upper(); + } } PPL_ASSERT(OK()); } @@ -89167,8 +91870,9 @@ cs.set_space_dimension(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cs = Constraint_System::zero_dim_empty(); + } return cs; } @@ -89179,20 +91883,24 @@ for (dimension_type k = 0; k < space_dim; ++k) { const Variable v_k = Variable(k); - PPL_DIRTY_TEMP(Coefficient, n); - PPL_DIRTY_TEMP(Coefficient, d); + PPL_DIRTY_TEMP_COEFFICIENT(n); + PPL_DIRTY_TEMP_COEFFICIENT(d); bool closed = false; if (has_lower_bound(v_k, n, d, closed)) { - if (closed) + if (closed) { cs.insert(d * v_k >= n); - else + } + else { cs.insert(d * v_k > n); + } } if (has_upper_bound(v_k, n, d, closed)) { - if (closed) + if (closed) { cs.insert(d * v_k <= n); - else + } + else { cs.insert(d * v_k < n); + } } } return cs; @@ -89206,8 +91914,9 @@ cs.set_space_dimension(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cs = Constraint_System::zero_dim_empty(); + } return cs; } @@ -89219,26 +91928,31 @@ for (dimension_type k = 0; k < space_dim; ++k) { const Variable v_k = Variable(k); - PPL_DIRTY_TEMP(Coefficient, n); - PPL_DIRTY_TEMP(Coefficient, d); + PPL_DIRTY_TEMP_COEFFICIENT(n); + PPL_DIRTY_TEMP_COEFFICIENT(d); bool closed = false; if (has_lower_bound(v_k, n, d, closed)) { - if (closed) + if (closed) { // Make sure equality constraints are detected. if (seq[k].is_singleton()) { cs.insert(d * v_k == n); continue; } - else + else { cs.insert(d * v_k >= n); - else + } + } + else { cs.insert(d * v_k > n); + } } if (has_upper_bound(v_k, n, d, closed)) { - if (closed) + if (closed) { cs.insert(d * v_k <= n); - else + } + else { cs.insert(d * v_k < n); + } } } return cs; @@ -89251,8 +91965,9 @@ Congruence_System cgs(space_dim); if (space_dim == 0) { - if (marked_empty()) + if (marked_empty()) { cgs = Congruence_System::zero_dim_empty(); + } return cgs; } @@ -89264,13 +91979,15 @@ for (dimension_type k = 0; k < space_dim; ++k) { const Variable v_k = Variable(k); - PPL_DIRTY_TEMP(Coefficient, n); - PPL_DIRTY_TEMP(Coefficient, d); + PPL_DIRTY_TEMP_COEFFICIENT(n); + PPL_DIRTY_TEMP_COEFFICIENT(d); bool closed = false; - if (has_lower_bound(v_k, n, d, closed) && closed) + if (has_lower_bound(v_k, n, d, closed) && closed) { // Make sure equality congruences are detected. - if (seq[k].is_singleton()) + if (seq[k].is_singleton()) { cgs.insert((d * v_k %= n) / 0); + } + } } return cgs; } @@ -89279,8 +91996,9 @@ memory_size_type Box::external_memory_in_bytes() const { memory_size_type n = seq.capacity() * sizeof(ITV); - for (dimension_type k = seq.size(); k-- > 0; ) + for (dimension_type k = seq.size(); k-- > 0; ) { n += seq[k].external_memory_in_bytes(); + } return n; } @@ -89288,20 +92006,25 @@ template std::ostream& IO_Operators::operator<<(std::ostream& s, const Box& box) { - if (box.is_empty()) + if (box.is_empty()) { s << "false"; - else if (box.is_universe()) + } + else if (box.is_universe()) { s << "true"; - else + } + else { for (dimension_type k = 0, space_dim = box.space_dimension(); k < space_dim; ) { s << Variable(k) << " in " << box[k]; ++k; - if (k < space_dim) + if (k < space_dim) { s << ", "; - else + } + else { break; + } } + } return s; } @@ -89313,8 +92036,9 @@ const dimension_type space_dim = space_dimension(); s << "space_dim" << separator << space_dim; s << "\n"; - for (dimension_type i = 0; i < space_dim; ++i) + for (dimension_type i = 0; i < space_dim; ++i) { seq[i].ascii_dump(s); + } } PPL_OUTPUT_TEMPLATE_DEFINITIONS(ITV, Box) @@ -89322,23 +92046,26 @@ template bool Box::ascii_load(std::istream& s) { - if (!status.ascii_load(s)) + if (!status.ascii_load(s)) { return false; - + } std::string str; dimension_type space_dim; - if (!(s >> str) || str != "space_dim") + if (!(s >> str) || str != "space_dim") { return false; - if (!(s >> space_dim)) + } + if (!(s >> space_dim)) { return false; - + } seq.clear(); ITV seq_i; for (dimension_type i = 0; i < space_dim; ++i) { - if (seq_i.ascii_load(s)) + if (seq_i.ascii_load(s)) { seq.push_back(seq_i); - else + } + else { return false; + } } // Check invariants. @@ -89492,15 +92219,17 @@ Temp& tmp0, Temp& tmp1, Temp& tmp2) { const dimension_type x_space_dim = x.space_dimension(); // Dimension-compatibility check. - if (x_space_dim != y.space_dimension()) + if (x_space_dim != y.space_dimension()) { return false; - + } // Zero-dim boxes are equal if and only if they are both empty or universe. if (x_space_dim == 0) { - if (x.marked_empty() == y.marked_empty()) + if (x.marked_empty() == y.marked_empty()) { assign_r(r, 0, ROUND_NOT_NEEDED); - else + } + else { assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED); + } return true; } @@ -89514,8 +92243,9 @@ assign_r(r, 0, ROUND_NOT_NEEDED); return true; } - else + else { goto pinf; + } } assign_r(tmp0, 0, ROUND_NOT_NEEDED); @@ -89524,11 +92254,13 @@ const ITV& y_i = y.seq[i]; // Dealing with the lower bounds. if (x_i.lower_is_boundary_infinity()) { - if (!y_i.lower_is_boundary_infinity()) + if (!y_i.lower_is_boundary_infinity()) { goto pinf; + } } - else if (y_i.lower_is_boundary_infinity()) + else if (y_i.lower_is_boundary_infinity()) { goto pinf; + } else { const Temp* tmp1p; const Temp* tmp2p; @@ -89545,13 +92277,17 @@ Specialization::combine(tmp0, tmp1, dir); } // Dealing with the lower bounds. - if (x_i.upper_is_boundary_infinity()) - if (y_i.upper_is_boundary_infinity()) + if (x_i.upper_is_boundary_infinity()) { + if (y_i.upper_is_boundary_infinity()) { continue; - else + } + else { goto pinf; - else if (y_i.upper_is_boundary_infinity()) + } + } + else if (y_i.upper_is_boundary_infinity()) { goto pinf; + } else { const Temp* tmp1p; const Temp* tmp2p; @@ -89579,7 +92315,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Box_defs.hh line 2285. */ +/* Automatically generated from PPL source file ../src/Box_defs.hh line 2287. */ /* Automatically generated from PPL source file ../src/Linear_Form_templates.hh line 30. */ #include @@ -89592,11 +92328,12 @@ Linear_Form::Linear_Form(const Variable v) : vec() { const dimension_type space_dim = v.space_dimension(); - if (space_dim > max_space_dimension()) + if (space_dim > max_space_dimension()) { throw std::length_error("Linear_Form::" "Linear_Form(v):\n" "v exceeds the maximum allowed " "space dimension."); + } vec.reserve(compute_capacity(space_dim+1, vec_type().max_size())); vec.resize(space_dim+1, zero); vec[v.space_dimension()] = C(typename C::boundary_type(1)); @@ -89608,11 +92345,12 @@ const dimension_type v_space_dim = v.space_dimension(); const dimension_type w_space_dim = w.space_dimension(); const dimension_type space_dim = std::max(v_space_dim, w_space_dim); - if (space_dim > max_space_dimension()) + if (space_dim > max_space_dimension()) { throw std::length_error("Linear_Form::" "Linear_Form(v, w):\n" "v or w exceed the maximum allowed " "space dimension."); + } vec.reserve(compute_capacity(space_dim+1, vec_type().max_size())); vec.resize(space_dim+1, zero); if (v_space_dim != w_space_dim) { @@ -89625,11 +92363,12 @@ Linear_Form::Linear_Form(const Linear_Expression& e) : vec() { const dimension_type space_dim = e.space_dimension(); - if (space_dim > max_space_dimension()) + if (space_dim > max_space_dimension()) { throw std::length_error("Linear_Form::" "Linear_Form(e):\n" "e exceeds the maximum allowed " "space dimension."); + } vec.reserve(compute_capacity(space_dim+1, vec_type().max_size())); vec.resize(space_dim+1); for (dimension_type i = space_dim; i-- > 0; ) @@ -89676,14 +92415,16 @@ Linear_Form operator+(const Variable v, const Linear_Form& f) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Form::max_space_dimension()) + if (v_space_dim > Linear_Form::max_space_dimension()) { throw std::length_error("Linear_Form " "operator+(v, f):\n" "v exceeds the maximum allowed " "space dimension."); + } Linear_Form r(f); - if (v_space_dim > f.space_dimension()) + if (v_space_dim > f.space_dimension()) { r.extend(v_space_dim+1); + } r[v_space_dim] += C(typename C::boundary_type(1)); return r; } @@ -89702,8 +92443,9 @@ Linear_Form operator-(const Linear_Form& f) { Linear_Form r(f); - for (dimension_type i = f.size(); i-- > 0; ) + for (dimension_type i = f.size(); i-- > 0; ) { r[i].neg_assign(r[i]); + } return r; } @@ -89748,16 +92490,19 @@ Linear_Form operator-(const Variable v, const Linear_Form& f) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Form::max_space_dimension()) + if (v_space_dim > Linear_Form::max_space_dimension()) { throw std::length_error("Linear_Form " "operator-(v, e):\n" "v exceeds the maximum allowed " "space dimension."); + } Linear_Form r(f); - if (v_space_dim > f.space_dimension()) + if (v_space_dim > f.space_dimension()) { r.extend(v_space_dim+1); - for (dimension_type i = f.size(); i-- > 0; ) + } + for (dimension_type i = f.size(); i-- > 0; ) { r[i].neg_assign(r[i]); + } r[v_space_dim] += C(typename C::boundary_type(1)); return r; } @@ -89767,14 +92512,16 @@ Linear_Form operator-(const Linear_Form& f, const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Form::max_space_dimension()) + if (v_space_dim > Linear_Form::max_space_dimension()) { throw std::length_error("Linear_Form " "operator-(e, v):\n" "v exceeds the maximum allowed " "space dimension."); + } Linear_Form r(f); - if (v_space_dim > f.space_dimension()) + if (v_space_dim > f.space_dimension()) { r.extend(v_space_dim+1); + } r[v_space_dim] -= C(typename C::boundary_type(1)); return r; } @@ -89784,8 +92531,9 @@ Linear_Form operator-(const C& n, const Linear_Form& f) { Linear_Form r(f); - for (dimension_type i = f.size(); i-- > 0; ) + for (dimension_type i = f.size(); i-- > 0; ) { r[i].neg_assign(r[i]); + } r[0] += n; return r; } @@ -89795,8 +92543,9 @@ Linear_Form operator*(const C& n, const Linear_Form& f) { Linear_Form r(f); - for (dimension_type i = f.size(); i-- > 0; ) + for (dimension_type i = f.size(); i-- > 0; ) { r[i] *= n; + } return r; } @@ -89806,10 +92555,12 @@ operator+=(Linear_Form& f1, const Linear_Form& f2) { dimension_type f1_size = f1.size(); dimension_type f2_size = f2.size(); - if (f1_size < f2_size) + if (f1_size < f2_size) { f1.extend(f2_size); - for (dimension_type i = f2_size; i-- > 0; ) + } + for (dimension_type i = f2_size; i-- > 0; ) { f1[i] += f2[i]; + } return f1; } @@ -89818,12 +92569,14 @@ Linear_Form& operator+=(Linear_Form& f, const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Form::max_space_dimension()) + if (v_space_dim > Linear_Form::max_space_dimension()) { throw std::length_error("Linear_Form& " "operator+=(e, v):\n" "v exceeds the maximum allowed space dimension."); - if (v_space_dim > f.space_dimension()) + } + if (v_space_dim > f.space_dimension()) { f.extend(v_space_dim+1); + } f[v_space_dim] += C(typename C::boundary_type(1)); return f; } @@ -89834,10 +92587,12 @@ operator-=(Linear_Form& f1, const Linear_Form& f2) { dimension_type f1_size = f1.size(); dimension_type f2_size = f2.size(); - if (f1_size < f2_size) + if (f1_size < f2_size) { f1.extend(f2_size); - for (dimension_type i = f2_size; i-- > 0; ) + } + for (dimension_type i = f2_size; i-- > 0; ) { f1[i] -= f2[i]; + } return f1; } @@ -89846,12 +92601,14 @@ Linear_Form& operator-=(Linear_Form& f, const Variable v) { const dimension_type v_space_dim = v.space_dimension(); - if (v_space_dim > Linear_Form::max_space_dimension()) + if (v_space_dim > Linear_Form::max_space_dimension()) { throw std::length_error("Linear_Form& " "operator-=(e, v):\n" "v exceeds the maximum allowed space dimension."); - if (v_space_dim > f.space_dimension()) + } + if (v_space_dim > f.space_dimension()) { f.extend(v_space_dim+1); + } f[v_space_dim] -= C(typename C::boundary_type(1)); return f; } @@ -89861,8 +92618,9 @@ Linear_Form& operator*=(Linear_Form& f, const C& n) { dimension_type f_size = f.size(); - for (dimension_type i = f_size; i-- > 0; ) + for (dimension_type i = f_size; i-- > 0; ) { f[i] *= n; + } return f; } @@ -89871,8 +92629,9 @@ Linear_Form& operator/=(Linear_Form& f, const C& n) { dimension_type f_size = f.size(); - for (dimension_type i = f_size; i-- > 0; ) + for (dimension_type i = f_size; i-- > 0; ) { f[i] /= n; + } return f; } @@ -89883,23 +92642,28 @@ const dimension_type x_size = x.size(); const dimension_type y_size = y.size(); if (x_size >= y_size) { - for (dimension_type i = y_size; i-- > 0; ) - if (x[i] != y[i]) + for (dimension_type i = y_size; i-- > 0; ) { + if (x[i] != y[i]) { return false; - - for (dimension_type i = x_size; --i >= y_size; ) - if (x[i] != x.zero) + } + } + for (dimension_type i = x_size; --i >= y_size; ) { + if (x[i] != x.zero) { return false; - + } + } } else { - for (dimension_type i = x_size; i-- > 0; ) - if (x[i] != y[i]) + for (dimension_type i = x_size; i-- > 0; ) { + if (x[i] != y[i]) { return false; - - for (dimension_type i = y_size; --i >= x_size; ) - if (y[i] != x.zero) + } + } + for (dimension_type i = y_size; --i >= x_size; ) { + if (y[i] != x.zero) { return false; + } + } } @@ -89909,8 +92673,9 @@ template void Linear_Form::negate() { - for (dimension_type i = vec.size(); i-- > 0; ) + for (dimension_type i = vec.size(); i-- > 0; ) { vec[i].neg_assign(vec[i]); + } return; } @@ -89918,8 +92683,9 @@ inline memory_size_type Linear_Form::external_memory_in_bytes() const { memory_size_type n = 0; - for (dimension_type i = size(); i-- > 0; ) + for (dimension_type i = size(); i-- > 0; ) { n += vec[i].external_memory_in_bytes(); + } n += vec.capacity()*sizeof(C); return n; } @@ -89927,9 +92693,11 @@ template bool Linear_Form::OK() const { - for (dimension_type i = size(); i-- > 0; ) - if (!vec[i].OK()) + for (dimension_type i = size(); i-- > 0; ) { + if (!vec[i].OK()) { return false; + } + } return true; } @@ -90019,8 +92787,9 @@ for (dimension_type i = 0; i < dimension; ++i) { C current_addend = coefficient(Variable(i)); C curr_int; - if (!oracle.get_interval(i, curr_int)) + if (!oracle.get_interval(i, curr_int)) { return false; + } current_addend *= curr_int; result += current_addend; } @@ -90038,19 +92807,23 @@ const C& fv = f[v+1]; if (fv != typename C::boundary_type(0)) { if (first) { - if (fv == typename C::boundary_type(-1)) + if (fv == typename C::boundary_type(-1)) { s << "-"; - else if (fv != typename C::boundary_type(1)) + } + else if (fv != typename C::boundary_type(1)) { s << fv << "*"; + } first = false; } else { - if (fv == typename C::boundary_type(-1)) + if (fv == typename C::boundary_type(-1)) { s << " - "; + } else { s << " + "; - if (fv != typename C::boundary_type(1)) + if (fv != typename C::boundary_type(1)) { s << fv << "*"; + } } } s << Variable(v); @@ -90059,16 +92832,19 @@ // Inhomogeneous term. const C& it = f[0]; if (it != 0) { - if (!first) + if (!first) { s << " + "; - else + } + else { first = false; + } s << it; } - if (first) + if (first) { // The null linear form. s << Linear_Form::zero; + } return s; } @@ -90444,17 +93220,16 @@ static bool add_linearize(const Binary_Operator& bop_expr, const FP_Oracle& oracle, - const std::map >& lf_store, + const std::map >& + lf_store, Linear_Form& result) { PPL_ASSERT(bop_expr.binary_operator() == Binary_Operator::ADD); - typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; - if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) + if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) { return false; + } Floating_Point_Format analyzed_format = bop_expr.type().floating_point_format(); @@ -90463,8 +93238,9 @@ result += rel_error; FP_Linear_Form linearized_second_operand; if (!linearize(*(bop_expr.right_hand_side()), oracle, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } result += linearized_second_operand; linearized_second_operand.relative_error(analyzed_format, rel_error); @@ -90562,13 +93338,11 @@ Linear_Form& result) { PPL_ASSERT(bop_expr.binary_operator() == Binary_Operator::SUB); - typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; - if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) + if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) { return false; + } Floating_Point_Format analyzed_format = bop_expr.type().floating_point_format(); @@ -90577,8 +93351,9 @@ result += rel_error; FP_Linear_Form linearized_second_operand; if (!linearize(*(bop_expr.right_hand_side()), oracle, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } result -= linearized_second_operand; linearized_second_operand.relative_error(analyzed_format, rel_error); @@ -90707,8 +93482,6 @@ typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; /* FIXME: We currently adopt the "Interval-Size Local" strategy in order to @@ -90726,19 +93499,24 @@ bool intervalize_first; FP_Linear_Form linearized_first_operand; if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, - linearized_first_operand)) + linearized_first_operand)) { return false; + } FP_Interval_Type intervalized_first_operand; - if (!linearized_first_operand.intervalize(oracle, intervalized_first_operand)) + if (!linearized_first_operand.intervalize(oracle, + intervalized_first_operand)) { return false; + } FP_Linear_Form linearized_second_operand; if (!linearize(*(bop_expr.right_hand_side()), oracle, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } FP_Interval_Type intervalized_second_operand; if (!linearized_second_operand.intervalize(oracle, - intervalized_second_operand)) + intervalized_second_operand)) { return false; + } // FIXME: we are not sure that what we do here is policy-proof. if (intervalized_first_operand.is_bounded()) { @@ -90749,19 +93527,24 @@ analyzer_format second_interval_size = intervalized_second_operand.upper() - intervalized_second_operand.lower(); - if (first_interval_size <= second_interval_size) + if (first_interval_size <= second_interval_size) { intervalize_first = true; - else + } + else { intervalize_first = false; + } } - else + else { intervalize_first = true; + } } else { - if (intervalized_second_operand.is_bounded()) + if (intervalized_second_operand.is_bounded()) { intervalize_first = false; - else + } + else { return false; + } } // Here we do the actual computation. @@ -90891,29 +93674,28 @@ Linear_Form& result) { PPL_ASSERT(bop_expr.binary_operator() == Binary_Operator::DIV); - typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; FP_Linear_Form linearized_second_operand; if (!linearize(*(bop_expr.right_hand_side()), oracle, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } FP_Interval_Type intervalized_second_operand; if (!linearized_second_operand.intervalize(oracle, - intervalized_second_operand)) + intervalized_second_operand)) { return false; - + } // Check if we may divide by zero. - if ((intervalized_second_operand.lower_is_boundary_infinity() || - intervalized_second_operand.lower() <= 0) && - (intervalized_second_operand.upper_is_boundary_infinity() || - intervalized_second_operand.upper() >= 0)) + if ((intervalized_second_operand.lower_is_boundary_infinity() + || intervalized_second_operand.lower() <= 0) && + (intervalized_second_operand.upper_is_boundary_infinity() + || intervalized_second_operand.upper() >= 0)) { return false; - - if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) + } + if (!linearize(*(bop_expr.left_hand_side()), oracle, lf_store, result)) { return false; + } Floating_Point_Format analyzed_format = bop_expr.type().floating_point_format(); @@ -90967,19 +93749,18 @@ Linear_Form& result) { typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; Floating_Point_Format analyzed_format = cast_expr.type().floating_point_format(); const Concrete_Expression* cast_arg = cast_expr.argument(); if (cast_arg->type().is_floating_point()) { - if (!linearize(*cast_arg, oracle, lf_store, result)) + if (!linearize(*cast_arg, oracle, lf_store, result)) { return false; + } if (!is_less_precise_than(analyzed_format, - cast_arg->type().floating_point_format()) || - result == FP_Linear_Form(FP_Interval_Type(0)) || - result == FP_Linear_Form(FP_Interval_Type(1))) + cast_arg->type().floating_point_format()) + || result == FP_Linear_Form(FP_Interval_Type(0)) + || result == FP_Linear_Form(FP_Interval_Type(1))) { /* FIXME: find a general way to check if the casted constant is exactly representable in the less precise format. @@ -90989,15 +93770,16 @@ a definitely safe value: do not add errors. */ return true; + } } else { FP_Interval_Type expr_value; if (!oracle.get_integer_expr_value(*cast_arg, expr_value)) return false; result = FP_Linear_Form(expr_value); - if (is_less_precise_than(Float::Binary::floating_point_format, analyzed_format) || - result == FP_Linear_Form(FP_Interval_Type(0)) || - result == FP_Linear_Form(FP_Interval_Type(1))) + if (is_less_precise_than(Float::Binary::floating_point_format, analyzed_format) + || result == FP_Linear_Form(FP_Interval_Type(0)) + || result == FP_Linear_Form(FP_Interval_Type(1))) { /* FIXME: find a general way to check if the casted constant is exactly representable in the less precise format. @@ -91007,6 +93789,7 @@ a definitely safe value: do not add errors. */ return true; + } } FP_Linear_Form rel_error; @@ -91060,8 +93843,8 @@ Linear_Form& result) { typedef typename FP_Interval_Type::boundary_type analyzer_format; typedef Linear_Form FP_Linear_Form; - typedef Box FP_Interval_Abstract_Store; - typedef std::map FP_Linear_Form_Abstract_Store; + typedef std::map + FP_Linear_Form_Abstract_Store; PPL_ASSERT(expr.type().is_floating_point()); // Check that analyzer_format is a floating point type. @@ -91078,8 +93861,9 @@ const Floating_Point_Constant* fpc_expr = expr.template as(); FP_Interval_Type constant_value; - if (!oracle.get_fp_constant_value(*fpc_expr, constant_value)) + if (!oracle.get_fp_constant_value(*fpc_expr, constant_value)) { return false; + } result = FP_Linear_Form(constant_value); return true; } @@ -91091,8 +93875,9 @@ case Unary_Operator::UPLUS: return linearize(*(uop_expr->argument()), oracle, lf_store, result); case Unary_Operator::UMINUS: - if (!linearize(*(uop_expr->argument()), oracle, lf_store, result)) + if (!linearize(*(uop_expr->argument()), oracle, lf_store, result)) { return false; + } result.negate(); return true; @@ -91138,12 +93923,13 @@ expr.template as(); std::set associated_dimensions; if (!oracle.get_associated_dimensions(*ref_expr, associated_dimensions) - || associated_dimensions.empty()) + || associated_dimensions.empty()) { /* We were unable to find any associated space dimension: linearization fails. */ return false; + } if (associated_dimensions.size() == 1) { /* If a linear form associated to the only referenced @@ -91153,7 +93939,7 @@ PPL_ASSERT(variable_index != not_a_dimension()); typename FP_Linear_Form_Abstract_Store::const_iterator - variable_value = lf_store.find(variable_index); + variable_value = lf_store.find(variable_index); if (variable_value == lf_store.end()) { result = FP_Linear_Form(Variable(variable_index)); return true; @@ -91170,15 +93956,17 @@ of all intervals associated to each space dimension. */ PPL_ASSERT(associated_dimensions.size() > 1); - std::set::const_iterator i = associated_dimensions.begin(); - std::set::const_iterator i_end = - associated_dimensions.end(); + std::set::const_iterator i + = associated_dimensions.begin(); + std::set::const_iterator i_end + = associated_dimensions.end(); FP_Interval_Type lub(EMPTY); for (; i != i_end; ++i) { FP_Interval_Type curr_int; PPL_ASSERT(*i != not_a_dimension()); - if (!oracle.get_interval(*i, curr_int)) + if (!oracle.get_interval(*i, curr_int)) { return false; + } lub.join_assign(curr_int); } @@ -91226,13 +94014,11 @@ */ -/* Automatically generated from PPL source file ../src/PIP_Problem_defs.hh line 35. */ +/* Automatically generated from PPL source file ../src/PIP_Problem_defs.hh line 36. */ #include #include #include -/* Automatically generated from PPL source file ../src/PIP_Problem_defs.hh line 40. */ - namespace Parma_Polyhedra_Library { namespace IO_Operators { @@ -92066,8 +94852,9 @@ swap(first_pending_constraint, y.first_pending_constraint); swap(parameters, y.parameters); swap(initial_context, y.initial_context); - for (dimension_type i = CONTROL_PARAMETER_NAME_SIZE; i-- > 0; ) + for (dimension_type i = CONTROL_PARAMETER_NAME_SIZE; i-- > 0; ) { swap(control_parameters[i], y.control_parameters[i]); + } swap(big_parameter_dimension, y.big_parameter_dimension); } @@ -92132,11 +94919,12 @@ } // Check for space dimension overflow. - if (dim > max_space_dimension()) + if (dim > max_space_dimension()) { throw std::length_error("PPL::PIP_Problem::" "PIP_Problem(dim, first, last, p_vars):\n" "dim exceeds the maximum allowed " "space dimension."); + } // Check the constraints. for (In i = first; i != last; ++i) { if (i->space_dimension() > dim) { @@ -92156,7 +94944,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/PIP_Problem_defs.hh line 833. */ +/* Automatically generated from PPL source file ../src/PIP_Problem_defs.hh line 832. */ /* Automatically generated from PPL source file ../src/PIP_Tree_defs.hh line 36. */ @@ -92988,10 +95776,6 @@ return denom; } -inline -PIP_Tree_Node::~PIP_Tree_Node() { -} - inline void PIP_Tree_Node::set_parent(const PIP_Decision_Node* p) { parent_ = p; @@ -93080,7 +95864,7 @@ */ -/* Automatically generated from PPL source file ../src/BHRZ03_Certificate_defs.hh line 31. */ +/* Automatically generated from PPL source file ../src/BHRZ03_Certificate_defs.hh line 30. */ #include //! The convergence certificate for the BHRZ03 widening operator. @@ -93171,6 +95955,8 @@ */ +/* Automatically generated from PPL source file ../src/BHRZ03_Certificate_inlines.hh line 28. */ + namespace Parma_Polyhedra_Library { inline @@ -93207,14 +95993,14 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/BHRZ03_Certificate_defs.hh line 117. */ +/* Automatically generated from PPL source file ../src/BHRZ03_Certificate_defs.hh line 116. */ /* Automatically generated from PPL source file ../src/H79_Certificate_defs.hh line 1. */ /* H79_Certificate class declaration. */ -/* Automatically generated from PPL source file ../src/H79_Certificate_defs.hh line 31. */ +/* Automatically generated from PPL source file ../src/H79_Certificate_defs.hh line 30. */ #include //! A convergence certificate for the H79 widening operator. @@ -93329,7 +96115,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/H79_Certificate_defs.hh line 97. */ +/* Automatically generated from PPL source file ../src/H79_Certificate_defs.hh line 96. */ /* Automatically generated from PPL source file ../src/Grid_Certificate_defs.hh line 1. */ /* Grid_Certificate class declaration. @@ -93338,7 +96124,7 @@ /* Automatically generated from PPL source file ../src/Grid_Certificate_defs.hh line 28. */ -/* Automatically generated from PPL source file ../src/Grid_Certificate_defs.hh line 32. */ +/* Automatically generated from PPL source file ../src/Grid_Certificate_defs.hh line 31. */ #include //! The convergence certificate for the Grid widening operator. @@ -93414,6 +96200,8 @@ */ +/* Automatically generated from PPL source file ../src/Grid_Certificate_inlines.hh line 28. */ + namespace Parma_Polyhedra_Library { inline @@ -93448,7 +96236,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Grid_Certificate_defs.hh line 103. */ +/* Automatically generated from PPL source file ../src/Grid_Certificate_defs.hh line 102. */ /* Automatically generated from PPL source file ../src/Partial_Function_defs.hh line 1. */ /* Partial_Function class declaration. @@ -93526,8 +96314,8 @@ */ +/* Automatically generated from PPL source file ../src/Partial_Function_inlines.hh line 28. */ #include -/* Automatically generated from PPL source file ../src/Partial_Function_inlines.hh line 29. */ namespace Parma_Polyhedra_Library { @@ -93544,9 +96332,10 @@ inline dimension_type Partial_Function::max_in_codomain() const { - if (has_empty_codomain()) + if (has_empty_codomain()) { throw std::runtime_error("Partial_Function::max_in_codomain() called" " when has_empty_codomain()"); + } PPL_ASSERT(codomain.begin() != codomain.end() && max == *codomain.rbegin()); return max; @@ -93562,27 +96351,31 @@ // Expand `vec' if needed. const dimension_type sz = vec.size(); - if (i >= sz) + if (i >= sz) { vec.insert(vec.end(), i - sz + 1, not_a_dimension()); + } // We cannot remap the same index to another one. PPL_ASSERT(i < vec.size() && vec[i] == not_a_dimension()); vec[i] = j; // Maybe update `max'. - if (j > max) + if (j > max) { max = j; + } PPL_ASSERT(codomain.begin() != codomain.end() && max == *codomain.rbegin()); } inline bool Partial_Function::maps(dimension_type i, dimension_type& j) const { - if (i >= vec.size()) + if (i >= vec.size()) { return false; + } const dimension_type vec_i = vec[i]; - if (vec_i == not_a_dimension()) + if (vec_i == not_a_dimension()) { return false; + } j = vec_i; return true; } @@ -96095,11 +98888,13 @@ y.reduce(); D1 d1_copy = d1; bool ub_exact = d1_copy.upper_bound_assign_if_exact(y.d1); - if (!ub_exact) + if (!ub_exact) { return false; + } ub_exact = d2.upper_bound_assign_if_exact(y.d2); - if (!ub_exact) + if (!ub_exact) { return false; + } using std::swap; swap(d1, d1_copy); return true; @@ -96442,8 +99237,9 @@ ::concatenate_assign(const Partially_Reduced_Product& y) { d1.concatenate_assign(y.d1); d2.concatenate_assign(y.d2); - if (!is_reduced() || !y.is_reduced()) + if (!is_reduced() || !y.is_reduced()) { clear_reduced_flag(); + } } template @@ -96512,8 +99308,9 @@ Partially_Reduced_Product::reduce() const { Partially_Reduced_Product& dp = const_cast(*this); - if (dp.is_reduced()) + if (dp.is_reduced()) { return false; + } R r; r.product_reduce(dp.d1, dp.d2); set_reduced_flag(); @@ -96686,8 +99483,9 @@ Constraint_System cs = d2.constraints(); const Constraint_System& cs1 = d1.constraints(); for (Constraint_System::const_iterator i = cs1.begin(), - cs_end = cs1.end(); i != cs_end; ++i) + cs_end = cs1.end(); i != cs_end; ++i) { cs.insert(*i); + } return cs; } @@ -96698,8 +99496,9 @@ Constraint_System cs = d2.constraints(); const Constraint_System& cs1 = d1.constraints(); for (Constraint_System::const_iterator i = cs1.begin(), - cs_end = cs1.end(); i != cs_end; ++i) + cs_end = cs1.end(); i != cs_end; ++i) { cs.insert(*i); + } if (cs.has_strict_inequalities()) { NNC_Polyhedron ph(cs); return ph.minimized_constraints(); @@ -96717,8 +99516,9 @@ Congruence_System cgs = d2.congruences(); const Congruence_System& cgs1 = d1.congruences(); for (Congruence_System::const_iterator i = cgs1.begin(), - cgs_end = cgs1.end(); i != cgs_end; ++i) + cgs_end = cgs1.end(); i != cgs_end; ++i) { cgs.insert(*i); + } return cgs; } @@ -96729,8 +99529,9 @@ Congruence_System cgs = d2.congruences(); const Congruence_System& cgs1 = d1.congruences(); for (Congruence_System::const_iterator i = cgs1.begin(), - cgs_end = cgs1.end(); i != cgs_end; ++i) + cgs_end = cgs1.end(); i != cgs_end; ++i) { cgs.insert(*i); + } Grid gr(cgs); return gr.minimized_congruences(); } @@ -96743,7 +99544,7 @@ d2.refine_with_constraints(cs); d1.add_recycled_constraints(cs); } - else + else { if (d2.can_recycle_constraint_systems()) { d1.refine_with_constraints(cs); d2.add_recycled_constraints(cs); @@ -96752,6 +99553,7 @@ d1.add_constraints(cs); d2.add_constraints(cs); } + } clear_reduced_flag(); } @@ -96763,7 +99565,7 @@ d2.refine_with_congruences(cgs); d1.add_recycled_congruences(cgs); } - else + else { if (d2.can_recycle_congruence_systems()) { d1.refine_with_congruences(cgs); d2.add_recycled_congruences(cgs); @@ -96772,6 +99574,7 @@ d1.add_congruences(cgs); d2.add_congruences(cgs); } + } clear_reduced_flag(); } @@ -96781,10 +99584,12 @@ ::relation_with(const Generator& g) const { reduce(); if (Poly_Gen_Relation::nothing() == d1.relation_with(g) - || Poly_Gen_Relation::nothing() == d2.relation_with(g)) + || Poly_Gen_Relation::nothing() == d2.relation_with(g)) { return Poly_Gen_Relation::nothing(); - else + } + else { return Poly_Gen_Relation::subsumes(); + } } template @@ -96797,18 +99602,24 @@ Poly_Con_Relation result = Poly_Con_Relation::nothing(); - if (relation1.implies(Poly_Con_Relation::is_included())) + if (relation1.implies(Poly_Con_Relation::is_included())) { result = result && Poly_Con_Relation::is_included(); - else if (relation2.implies(Poly_Con_Relation::is_included())) + } + else if (relation2.implies(Poly_Con_Relation::is_included())) { result = result && Poly_Con_Relation::is_included(); - if (relation1.implies(Poly_Con_Relation::saturates())) + } + if (relation1.implies(Poly_Con_Relation::saturates())) { result = result && Poly_Con_Relation::saturates(); - else if (relation2.implies(Poly_Con_Relation::saturates())) + } + else if (relation2.implies(Poly_Con_Relation::saturates())) { result = result && Poly_Con_Relation::saturates(); - if (relation1.implies(Poly_Con_Relation::is_disjoint())) + } + if (relation1.implies(Poly_Con_Relation::is_disjoint())) { result = result && Poly_Con_Relation::is_disjoint(); - else if (relation2.implies(Poly_Con_Relation::is_disjoint())) + } + else if (relation2.implies(Poly_Con_Relation::is_disjoint())) { result = result && Poly_Con_Relation::is_disjoint(); + } return result; } @@ -96823,18 +99634,24 @@ Poly_Con_Relation result = Poly_Con_Relation::nothing(); - if (relation1.implies(Poly_Con_Relation::is_included())) + if (relation1.implies(Poly_Con_Relation::is_included())) { result = result && Poly_Con_Relation::is_included(); - else if (relation2.implies(Poly_Con_Relation::is_included())) + } + else if (relation2.implies(Poly_Con_Relation::is_included())) { result = result && Poly_Con_Relation::is_included(); - if (relation1.implies(Poly_Con_Relation::saturates())) + } + if (relation1.implies(Poly_Con_Relation::saturates())) { result = result && Poly_Con_Relation::saturates(); - else if (relation2.implies(Poly_Con_Relation::saturates())) + } + else if (relation2.implies(Poly_Con_Relation::saturates())) { result = result && Poly_Con_Relation::saturates(); - if (relation1.implies(Poly_Con_Relation::is_disjoint())) + } + if (relation1.implies(Poly_Con_Relation::is_disjoint())) { result = result && Poly_Con_Relation::is_disjoint(); - else if (relation2.implies(Poly_Con_Relation::is_disjoint())) + } + else if (relation2.implies(Poly_Con_Relation::is_disjoint())) { result = result && Poly_Con_Relation::is_disjoint(); + } return result; } @@ -96848,8 +99665,9 @@ bool& maximum) const { reduce(); - if (is_empty()) + if (is_empty()) { return false; + } PPL_DIRTY_TEMP_COEFFICIENT(sup1_n); PPL_DIRTY_TEMP_COEFFICIENT(sup1_d); @@ -96860,8 +99678,9 @@ bool r1 = d1.maximize(expr, sup1_n, sup1_d, maximum1); bool r2 = d2.maximize(expr, sup2_n, sup2_d, maximum2); // If neither is bounded from above, return false. - if (!r1 && !r2) + if (!r1 && !r2) { return false; + } // If only d2 is bounded from above, then use the values for d2. if (!r1) { sup_n = sup2_n; @@ -96899,8 +99718,9 @@ bool& minimum) const { reduce(); - if (is_empty()) + if (is_empty()) { return false; + } PPL_ASSERT(reduced); PPL_DIRTY_TEMP_COEFFICIENT(inf1_n); @@ -96912,8 +99732,9 @@ bool r1 = d1.minimize(expr, inf1_n, inf1_d, minimum1); bool r2 = d2.minimize(expr, inf2_n, inf2_d, minimum2); // If neither is bounded from below, return false. - if (!r1 && !r2) + if (!r1 && !r2) { return false; + } // If only d2 is bounded from below, then use the values for d2. if (!r1) { inf_n = inf2_n; @@ -96952,8 +99773,9 @@ Generator& g) const { reduce(); - if (is_empty()) + if (is_empty()) { return false; + } PPL_ASSERT(reduced); PPL_DIRTY_TEMP_COEFFICIENT(sup1_n); @@ -96967,8 +99789,9 @@ bool r1 = d1.maximize(expr, sup1_n, sup1_d, maximum1, g1); bool r2 = d2.maximize(expr, sup2_n, sup2_d, maximum2, g2); // If neither is bounded from above, return false. - if (!r1 && !r2) + if (!r1 && !r2) { return false; + } // If only d2 is bounded from above, then use the values for d2. if (!r1) { sup_n = sup2_n; @@ -97011,8 +99834,9 @@ Generator& g) const { reduce(); - if (is_empty()) + if (is_empty()) { return false; + } PPL_ASSERT(reduced); PPL_DIRTY_TEMP_COEFFICIENT(inf1_n); @@ -97026,8 +99850,9 @@ bool r1 = d1.minimize(expr, inf1_n, inf1_d, minimum1, g1); bool r2 = d2.minimize(expr, inf2_n, inf2_d, minimum2, g2); // If neither is bounded from below, return false. - if (!r1 && !r2) + if (!r1 && !r2) { return false; + } // If only d2 is bounded from below, then use the values for d2. if (!r1) { inf_n = inf2_n; @@ -97069,8 +99894,9 @@ /* Force dp1 reduction */ dp1.clear_reduced_flag(); dp1.reduce(); - if (dp1 != dp2) + if (dp1 != dp2) { return false; + } } return d1.OK() && d2.OK(); } @@ -97081,23 +99907,30 @@ const char yes = '+'; const char no = '-'; std::string str; - if (!(s >> str) || str != "Partially_Reduced_Product") + if (!(s >> str) || str != "Partially_Reduced_Product") { return false; + } if (!(s >> str) || (str[0] != yes && str[0] != no) - || str.substr(1) != "reduced") + || str.substr(1) != "reduced") { return false; + } reduced = (str[0] == yes); - if (!(s >> str) || str != "Domain") + if (!(s >> str) || str != "Domain") { return false; - if (!(s >> str) || str != "1:") + } + if (!(s >> str) || str != "1:") { return false; - if (!d1.ascii_load(s)) + } + if (!d1.ascii_load(s)) { return false; - if (!(s >> str) || str != "Domain") + } + if (!(s >> str) || str != "Domain") { return false; - if (!(s >> str) || str != "2:") + } + if (!(s >> str) || str != "2:") { return false; + } return d2.ascii_load(s); } @@ -97186,17 +100019,21 @@ PPL_DIRTY_TEMP_COEFFICIENT(min_increased); // Find the amount by which the maximum value may be decreased. shrink_amount = max_numer % mod; - if (!max_included && shrink_amount == 0) + if (!max_included && shrink_amount == 0) { shrink_amount = mod; - if (shrink_amount < 0) + } + if (shrink_amount < 0) { shrink_amount += mod; + } max_decreased = max_numer - shrink_amount; // Find the amount by which the minimum value may be increased. shrink_amount = min_numer % mod; - if (!min_included && shrink_amount == 0) + if (!min_included && shrink_amount == 0) { shrink_amount = - mod; - if (shrink_amount > 0) + } + if (shrink_amount > 0) { shrink_amount -= mod; + } min_increased = min_numer - shrink_amount; if (max_decreased == min_increased) { // The domain element d2 intersects exactly one hyperplane @@ -97238,26 +100075,32 @@ for (Congruence_System::const_iterator i = cgs1.begin(), cgs_end = cgs1.end(); i != cgs_end; ++i) { const Congruence& cg1 = *i; - if (cg1.is_equality()) + if (cg1.is_equality()) { d2.refine_with_congruence(cg1); - else + } + else { if (!Parma_Polyhedra_Library:: - shrink_to_congruence_no_check(d1, d2, cg1)) + shrink_to_congruence_no_check(d1, d2, cg1)) { // The product is empty. return; + } + } } // Use the congruences representing d2 to shrink both components. const Congruence_System cgs2 = d2.minimized_congruences(); for (Congruence_System::const_iterator i = cgs2.begin(), cgs_end = cgs2.end(); i != cgs_end; ++i) { const Congruence& cg2 = *i; - if (cg2.is_equality()) + if (cg2.is_equality()) { d1.refine_with_congruence(cg2); - else + } + else { if (!Parma_Polyhedra_Library:: - shrink_to_congruence_no_check(d2, d1, cg2)) + shrink_to_congruence_no_check(d2, d1, cg2)) { // The product is empty. return; + } + } } } @@ -97267,8 +100110,9 @@ // First do the congruences reduction. Parma_Polyhedra_Library::Congruences_Reduction cgr; cgr.product_reduce(d1, d2); - if (d1.is_empty()) + if (d1.is_empty()) { return; + } PPL_DIRTY_TEMP_COEFFICIENT(freq_n); PPL_DIRTY_TEMP_COEFFICIENT(freq_d); @@ -97281,17 +100125,20 @@ for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { const Constraint& c = *i; - if (c.is_equality()) + if (c.is_equality()) { continue; + } // Check the frequency and value of the linear expression for // the constraint `c'. Linear_Expression le(c.expression()); - if (!d1.frequency(le, freq_n, freq_d, val_n, val_d)) + if (!d1.frequency(le, freq_n, freq_d, val_n, val_d)) { // Nothing to do. continue; - if (val_n == 0) + } + if (val_n == 0) { // Nothing to do. continue; + } // Adjust the value of the inhomogeneous term to satisfy // the implied congruence. if (val_n < 0) { @@ -97310,18 +100157,21 @@ for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { const Constraint& c = *i; - if (c.is_equality()) + if (c.is_equality()) { // Equalities already shared. continue; + } // Check the frequency and value of the linear expression for // the constraint `c'. Linear_Expression le(c.expression()); - if (!d2.frequency(le, freq_n, freq_d, val_n, val_d)) + if (!d2.frequency(le, freq_n, freq_d, val_n, val_d)) { // Nothing to do. continue; - if (val_n == 0) + } + if (val_n == 0) { // Nothing to do. continue; + } // Adjust the value of the inhomogeneous term to satisfy // the implied congruence. if (val_n < 0) { @@ -97361,7 +100211,6 @@ /* Automatically generated from PPL source file ../src/Determinate_defs.hh line 32. */ #include -/* Automatically generated from PPL source file ../src/Determinate_defs.hh line 34. */ namespace Parma_Polyhedra_Library { @@ -97758,16 +100607,18 @@ template inline Determinate::~Determinate() { - if (prep->del_reference()) + if (prep->del_reference()) { delete prep; + } } template inline Determinate& Determinate::operator=(const Determinate& y) { y.prep->new_reference(); - if (prep->del_reference()) + if (prep->del_reference()) { delete prep; + } prep = y.prep; return *this; } @@ -97940,7 +100791,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Determinate_defs.hh line 330. */ +/* Automatically generated from PPL source file ../src/Determinate_defs.hh line 329. */ /* Automatically generated from PPL source file ../src/Powerset_defs.hh line 1. */ /* Powerset class declaration. @@ -97976,7 +100827,6 @@ } // namespace Parma_Polyhedra_Library /* Automatically generated from PPL source file ../src/iterator_to_const_defs.hh line 29. */ -//#include "Ask_Tell_types.hh" #include #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS @@ -98346,7 +101196,7 @@ } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/iterator_to_const_defs.hh line 220. */ +/* Automatically generated from PPL source file ../src/iterator_to_const_defs.hh line 219. */ /* Automatically generated from PPL source file ../src/Powerset_defs.hh line 30. */ #include @@ -98771,8 +101621,8 @@ */ +/* Automatically generated from PPL source file ../src/Powerset_inlines.hh line 28. */ #include -/* Automatically generated from PPL source file ../src/Powerset_inlines.hh line 29. */ namespace Parma_Polyhedra_Library { @@ -98871,9 +101721,8 @@ template inline void Powerset::m_swap(Powerset& y) { - using std::swap; - swap(sequence, y.sequence); - swap(reduced, y.reduced); + std::swap(sequence, y.sequence); + std::swap(reduced, y.reduced); } template @@ -98937,8 +101786,9 @@ template inline void Powerset::collapse() { - if (!empty()) + if (!empty()) { collapse(sequence.begin()); + } } template @@ -98980,10 +101830,9 @@ */ -/* Automatically generated from PPL source file ../src/Powerset_templates.hh line 28. */ -#include -/* Automatically generated from PPL source file ../src/Powerset_templates.hh line 30. */ +/* Automatically generated from PPL source file ../src/Powerset_templates.hh line 29. */ #include +#include namespace Parma_Polyhedra_Library { @@ -98996,17 +101845,21 @@ iterator next_x_sink = x_sink; ++next_x_sink; iterator x_end = end(); - for (const_iterator xi = next_x_sink; xi != x_end; ++xi) + for (const_iterator xi = next_x_sink; xi != x_end; ++xi) { d.upper_bound_assign(*xi); + } // Drop the surplus disjuncts. drop_disjuncts(next_x_sink, x_end); // Ensure omega-reduction. - for (iterator xi = begin(); xi != x_sink; ) - if (xi->definitely_entails(d)) + for (iterator xi = begin(); xi != x_sink; ) { + if (xi->definitely_entails(d)) { xi = drop_disjunct(xi); - else + } + else { ++xi; + } + } PPL_ASSERT_HEAVY(OK()); } @@ -99014,38 +101867,47 @@ template void Powerset::omega_reduce() const { - if (reduced) + if (reduced) { return; - + } Powerset& x = const_cast(*this); // First remove all bottom elements. - for (iterator xi = x.begin(), x_end = x.end(); xi != x_end; ) - if (xi->is_bottom()) + for (iterator xi = x.begin(), x_end = x.end(); xi != x_end; ) { + if (xi->is_bottom()) { xi = x.drop_disjunct(xi); - else + } + else { ++xi; + } + } // Then remove non-maximal elements. for (iterator xi = x.begin(); xi != x.end(); ) { const D& xv = *xi; bool dropping_xi = false; - for (iterator yi = x.begin(); yi != x.end(); ) - if (xi == yi) + for (iterator yi = x.begin(); yi != x.end(); ) { + if (xi == yi) { ++yi; + } else { const D& yv = *yi; - if (yv.definitely_entails(xv)) + if (yv.definitely_entails(xv)) { yi = x.drop_disjunct(yi); + } else if (xv.definitely_entails(yv)) { dropping_xi = true; break; } - else + else { ++yi; + } } - if (dropping_xi) + } + if (dropping_xi) { xi = x.drop_disjunct(xi); - else + } + else { ++xi; + } if (abandon_expensive_computations != 0 && xi != x.end()) { // Hurry up! x.collapse(xi.base); @@ -99081,14 +101943,17 @@ for (const_iterator x_begin = begin(), x_end = end(), xi = x_begin; xi != x_end; ++xi) { const D& xv = *xi; - if (xv.is_bottom()) + if (xv.is_bottom()) { return false; + } for (const_iterator yi = x_begin; yi != x_end; ++yi) { - if (xi == yi) + if (xi == yi) { continue; + } const D& yv = *yi; - if (xv.definitely_entails(yv) || yv.definitely_entails(xv)) + if (xv.definitely_entails(yv) || yv.definitely_entails(xv)) { return false; + } } } return true; @@ -99097,8 +101962,9 @@ template bool Powerset::is_omega_reduced() const { - if (!reduced && check_omega_reduced()) + if (!reduced && check_omega_reduced()) { reduced = true; + } return reduced; } @@ -99110,15 +101976,18 @@ PPL_ASSERT_HEAVY(!d.is_bottom()); for (iterator xi = first; xi != last; ) { const D& xv = *xi; - if (d.definitely_entails(xv)) + if (d.definitely_entails(xv)) { return first; + } else if (xv.definitely_entails(d)) { - if (xi == first) + if (xi == first) { ++first; + } xi = drop_disjunct(xi); } - else + else { ++xi; + } } sequence.push_back(d); PPL_ASSERT_HEAVY(OK()); @@ -99134,8 +102003,9 @@ x_end = x.end(); found && xi != x_end; ++xi) { found = false; for (const_iterator yi = y.begin(), - y_end = y.end(); !found && yi != y_end; ++yi) + y_end = y.end(); !found && yi != y_end; ++yi) { found = (*xi).definitely_entails(*yi); + } } return found; } @@ -99146,8 +102016,9 @@ operator==(const Powerset& x, const Powerset& y) { x.omega_reduce(); y.omega_reduce(); - if (x.size() != y.size()) + if (x.size() != y.size()) { return false; + } // Take a copy of `y' and work with it. Powerset z = y; for (typename Powerset::const_iterator xi = x.begin(), @@ -99155,10 +102026,12 @@ typename Powerset::iterator zi = z.begin(); typename Powerset::iterator z_end = z.end(); zi = std::find(zi, z_end, *xi); - if (zi == z_end) + if (zi == z_end) { return false; - else + } + else { z.drop_disjunct(zi); + } } return true; } @@ -99173,16 +102046,17 @@ y.omega_reduce(); Sequence new_sequence; for (const_iterator xi = begin(), x_end = end(), - y_begin = y.begin(), y_end = y.end(); xi != x_end; ++xi) + y_begin = y.begin(), y_end = y.end(); xi != x_end; ++xi) { for (const_iterator yi = y_begin; yi != y_end; ++yi) { D zi = *xi; op_assign(zi, *yi); - if (!zi.is_bottom()) + if (!zi.is_bottom()) { new_sequence.push_back(zi); + } } + } // Put the new sequence in place. - using std::swap; - swap(sequence, new_sequence); + std::swap(sequence, new_sequence); reduced = false; PPL_ASSERT_HEAVY(OK()); } @@ -99195,10 +102069,11 @@ y.omega_reduce(); iterator old_begin = begin(); iterator old_end = end(); - for (const_iterator i = y.begin(), y_end = y.end(); i != y_end; ++i) + for (const_iterator i = y.begin(), y_end = y.end(); i != y_end; ++i) { old_begin = add_non_bottom_disjunct_preserve_reduction(*i, old_begin, old_end); + } PPL_ASSERT_HEAVY(OK()); } @@ -99208,18 +102083,22 @@ template std::ostream& operator<<(std::ostream& s, const Powerset& x) { - if (x.is_bottom()) + if (x.is_bottom()) { s << "false"; - else if (x.is_top()) + } + else if (x.is_top()) { s << "true"; - else + } + else { for (typename Powerset::const_iterator i = x.begin(), x_end = x.end(); i != x_end; ) { s << "{ " << *i << " }"; ++i; - if (i != x_end) + if (i != x_end) { s << ", "; + } } + } return s; } @@ -99243,8 +102122,9 @@ bool Powerset::OK(const bool disallow_bottom) const { for (const_iterator xi = begin(), x_end = end(); xi != x_end; ++xi) { - if (!xi->OK()) + if (!xi->OK()) { return false; + } if (disallow_bottom && xi->is_bottom()) { #ifndef NDEBUG std::cerr << "Bottom element in powerset!" @@ -100521,6 +103401,13 @@ typename Cert::Compare>& y_cert_ms) const; + /*! \brief + Template helper: common implementation for constraints + and congruences. + */ + template + Poly_Con_Relation relation_with_aux(const Cons_or_Congr& c) const; + // FIXME: here it should be enough to befriend the template constructor // template // Pointset_Powerset(const Pointset_Powerset&), @@ -100699,8 +103586,9 @@ Degenerate_Element kind) : Base(), space_dim(num_dimensions) { Pointset_Powerset& x = *this; - if (kind == UNIVERSE) + if (kind == UNIVERSE) { x.sequence.push_back(Determinate(PSET(num_dimensions, kind))); + } PPL_ASSERT_HEAVY(x.OK()); } @@ -100718,11 +103606,13 @@ : Base(), space_dim(ph.space_dimension()) { Pointset_Powerset& x = *this; if (complexity == ANY_COMPLEXITY) { - if (ph.is_empty()) + if (ph.is_empty()) { return; + } } - else + else { x.reduced = false; + } x.sequence.push_back(Determinate(PSET(ph, complexity))); x.reduced = false; PPL_ASSERT_HEAVY(OK()); @@ -100735,11 +103625,13 @@ : Base(), space_dim(ph.space_dimension()) { Pointset_Powerset& x = *this; if (complexity == ANY_COMPLEXITY) { - if (ph.is_empty()) + if (ph.is_empty()) { return; + } } - else + else { x.reduced = false; + } x.sequence.push_back(Determinate(PSET(ph, complexity))); PPL_ASSERT_HEAVY(OK()); } @@ -100765,11 +103657,13 @@ : Base(), space_dim(prp.space_dimension()) { Pointset_Powerset& x = *this; if (complexity == ANY_COMPLEXITY) { - if (prp.is_empty()) + if (prp.is_empty()) { return; + } } - else + else { x.reduced = false; + } x.sequence.push_back(Determinate(PSET(prp, complexity))); x.reduced = false; PPL_ASSERT_HEAVY(OK()); @@ -100781,8 +103675,9 @@ Complexity_Class) : Base(), space_dim(box.space_dimension()) { Pointset_Powerset& x = *this; - if (!box.is_empty()) + if (!box.is_empty()) { x.sequence.push_back(Determinate(PSET(box))); + } PPL_ASSERT_HEAVY(OK()); } @@ -100792,8 +103687,9 @@ Complexity_Class) : Base(), space_dim(os.space_dimension()) { Pointset_Powerset& x = *this; - if (!os.is_empty()) + if (!os.is_empty()) { x.sequence.push_back(Determinate(PSET(os))); + } PPL_ASSERT_HEAVY(OK()); } @@ -100803,8 +103699,9 @@ Complexity_Class) : Base(), space_dim(bds.space_dimension()) { Pointset_Powerset& x = *this; - if (!bds.is_empty()) + if (!bds.is_empty()) { x.sequence.push_back(Determinate(PSET(bds))); + } PPL_ASSERT_HEAVY(OK()); } @@ -100854,18 +103751,28 @@ inline void Pointset_Powerset::intersection_assign(const Pointset_Powerset& y) { Pointset_Powerset& x = *this; - x.pairwise_apply_assign - (y, - Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::intersection_assign))); + x.pairwise_apply_assign(y, + Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::intersection_assign))); } template inline void Pointset_Powerset::time_elapse_assign(const Pointset_Powerset& y) { Pointset_Powerset& x = *this; - x.pairwise_apply_assign - (y, - Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::time_elapse_assign))); + x.pairwise_apply_assign(y, + Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::time_elapse_assign))); +} + +template +inline Poly_Con_Relation +Pointset_Powerset::relation_with(const Constraint& c) const { + return relation_with_aux(c); +} + +template +inline Poly_Con_Relation +Pointset_Powerset::relation_with(const Congruence& cg) const { + return relation_with_aux(cg); } template @@ -101000,10 +103907,11 @@ : Base(), space_dim(y.space_dimension()) { Pointset_Powerset& x = *this; for (typename Pointset_Powerset::const_iterator i = y.begin(), - y_end = y.end(); i != y_end; ++i) + y_end = y.end(); i != y_end; ++i) { x.sequence.push_back(Determinate (NNC_Polyhedron(i->pointset(), complexity))); + } // FIXME: If the domain elements can be represented _exactly_ as NNC // polyhedra, then having x.reduced = y.reduced is correct. This is // the case if the domains are both linear and convex which holds @@ -101026,8 +103934,9 @@ : Base(), space_dim(y.space_dimension()) { Pointset_Powerset& x = *this; for (typename Pointset_Powerset::const_iterator i = y.begin(), - y_end = y.end(); i != y_end; ++i) + y_end = y.end(); i != y_end; ++i) { x.sequence.push_back(Determinate(PSET(i->pointset(), complexity))); + } // Note: this might be non-reduced even when `y' is known to be // omega-reduced, because the constructor of PSET may have made // different QH elements to become comparable. @@ -101056,12 +103965,14 @@ && (xi != x_end) && (y_begin != y_end)) { // Hurry up! PSET x_ph = xi->pointset(); - for (++xi; xi != x_end; ++xi) + for (++xi; xi != x_end; ++xi) { x_ph.upper_bound_assign(xi->pointset()); + } const_iterator yi = y_begin; PSET y_ph = yi->pointset(); - for (++yi; yi != y_end; ++yi) + for (++yi; yi != y_end; ++yi) { y_ph.upper_bound_assign(yi->pointset()); + } x_ph.concatenate_assign(y_ph); swap(x, new_x); x.add_disjunct(x_ph); @@ -101078,8 +103989,9 @@ Pointset_Powerset::add_constraint(const Constraint& c) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_constraint(c); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -101089,8 +104001,9 @@ Pointset_Powerset::refine_with_constraint(const Constraint& c) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().refine_with_constraint(c); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -101100,8 +104013,9 @@ Pointset_Powerset::add_constraints(const Constraint_System& cs) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_constraints(cs); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -101111,8 +104025,9 @@ Pointset_Powerset::refine_with_constraints(const Constraint_System& cs) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().refine_with_constraints(cs); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -101122,8 +104037,9 @@ Pointset_Powerset::add_congruence(const Congruence& cg) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_congruence(cg); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -101133,8 +104049,9 @@ Pointset_Powerset::refine_with_congruence(const Congruence& cg) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().refine_with_congruence(cg); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -101144,8 +104061,9 @@ Pointset_Powerset::add_congruences(const Congruence_System& cgs) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_congruences(cgs); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -101155,8 +104073,9 @@ Pointset_Powerset::refine_with_congruences(const Congruence_System& cgs) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().refine_with_congruences(cgs); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -101190,8 +104109,9 @@ Pointset_Powerset::add_space_dimensions_and_embed(dimension_type m) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_space_dimensions_and_embed(m); + } x.space_dim += m; PPL_ASSERT_HEAVY(x.OK()); } @@ -101201,8 +104121,9 @@ Pointset_Powerset::add_space_dimensions_and_project(dimension_type m) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().add_space_dimensions_and_project(m); + } x.space_dim += m; PPL_ASSERT_HEAVY(x.OK()); } @@ -101248,16 +104169,18 @@ dimension_type n = 0; for (dimension_type i = x.space_dim; i-- > 0; ) { dimension_type new_i; - if (pfunc.maps(i, new_i)) + if (pfunc.maps(i, new_i)) { ++n; + } } x.space_dim = n; } else { Sequence_iterator s_begin = x.sequence.begin(); for (Sequence_iterator si = s_begin, - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().map_space_dimensions(pfunc); + } x.space_dim = s_begin->pointset().space_dimension(); x.reduced = false; } @@ -101270,8 +104193,9 @@ dimension_type m) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().expand_space_dimension(var, m); + } x.space_dim += m; PPL_ASSERT_HEAVY(x.OK()); } @@ -101284,8 +104208,9 @@ Variables_Set::size_type num_folded = vars.size(); if (num_folded > 0) { for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().fold_space_dimensions(vars, dest); + } } x.space_dim -= num_folded; PPL_ASSERT_HEAVY(x.OK()); @@ -101442,8 +104367,9 @@ for (Constraint_System::const_iterator i = cs.begin(), cs_end = cs.end(); i != cs_end; ++i) { const Constraint& c = *i; - if (c.is_equality()) + if (c.is_equality()) { phi.add_constraint(c); + } } x_ph.poly_hull_assign(phi); } @@ -101457,11 +104383,13 @@ Pointset_Powerset::is_universe() const { const Pointset_Powerset& x = *this; // Exploit omega-reduction, if already computed. - if (x.is_omega_reduced()) + if (x.is_omega_reduced()) { return x.size() == 1 && x.begin()->pointset().is_universe(); + } // A powerset is universe iff one of its disjuncts is. - for (const_iterator x_i = x.begin(), x_end = x.end(); x_i != x_end; ++x_i) + for (const_iterator x_i = x.begin(), x_end = x.end(); + x_i != x_end; ++x_i) { if (x_i->pointset().is_universe()) { // Speculative omega-reduction, if it is worth. if (x.size() > 1) { @@ -101471,6 +104399,7 @@ } return true; } + } return false; } @@ -101479,9 +104408,11 @@ Pointset_Powerset::is_empty() const { const Pointset_Powerset& x = *this; for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().is_empty()) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().is_empty()) { return false; + } + } return true; } @@ -101490,9 +104421,11 @@ Pointset_Powerset::is_discrete() const { const Pointset_Powerset& x = *this; for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().is_discrete()) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().is_discrete()) { return false; + } + } return true; } @@ -101504,9 +104437,11 @@ // topological closure. x.omega_reduce(); for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().is_topologically_closed()) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().is_topologically_closed()) { return false; + } + } return true; } @@ -101515,9 +104450,11 @@ Pointset_Powerset::is_bounded() const { const Pointset_Powerset& x = *this; for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().is_bounded()) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().is_bounded()) { return false; + } + } return true; } @@ -101537,11 +104474,15 @@ // omega_reduction needed, since a redundant disjunct may constrain var. x.omega_reduce(); // An empty powerset constrains all variables. - if (x.is_empty()) + if (x.is_empty()) { return true; - for (const_iterator x_i = x.begin(), x_end = x.end(); x_i != x_end; ++x_i) - if (x_i->pointset().constrains(var)) + } + for (const_iterator x_i = x.begin(), x_end = x.end(); + x_i != x_end; ++x_i) { + if (x_i->pointset().constrains(var)) { return true; + } + } return false; } @@ -101555,8 +104496,9 @@ for (Sequence_const_iterator sj = y.sequence.begin(), y_s_end = y.sequence.end(); sj != y_s_end; ++sj) { const PSET& pj = sj->pointset(); - if (!pi.is_disjoint_from(pj)) + if (!pi.is_disjoint_from(pj)) { return false; + } } } return true; @@ -101569,8 +104511,9 @@ Complexity_Class complexity) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().drop_some_non_integer_points(vars, complexity); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -101581,8 +104524,9 @@ ::drop_some_non_integer_points(Complexity_Class complexity) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().drop_some_non_integer_points(complexity); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -101592,8 +104536,9 @@ Pointset_Powerset::topological_closure_assign() { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().topological_closure_assign(); + } PPL_ASSERT_HEAVY(x.OK()); } @@ -101612,8 +104557,9 @@ PSET context_i(si->pointset()); context_i.intersection_assign(enlarged); PSET enlarged_i(dest); - if (enlarged_i.simplify_using_context_assign(context_i)) + if (enlarged_i.simplify_using_context_assign(context_i)) { nonempty_intersection = true; + } // TODO: merge the sorted constraints of `enlarged' and `enlarged_i'? enlarged.intersection_assign(enlarged_i); } @@ -101633,8 +104579,9 @@ // if it has been made redundant by any of the elements preceding it // (which have been already simplified). x.omega_reduce(); - if (x.is_empty()) + if (x.is_empty()) { return false; + } y.omega_reduce(); if (y.is_empty()) { x = y; @@ -101647,22 +104594,26 @@ for (Sequence_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ) { PSET& x_i = si->pointset(); - if (x_i.simplify_using_context_assign(y_i)) + if (x_i.simplify_using_context_assign(y_i)) { ++si; - else + } + else { // Intersection is empty: drop the disjunct. si = x.sequence.erase(si); + } } } else { // The context is not a singleton. for (Sequence_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ) { - if (y.intersection_preserving_enlarge_element(si->pointset())) + if (y.intersection_preserving_enlarge_element(si->pointset())) { ++si; - else + } + else { // Intersection with `*si' is empty: drop the disjunct. si = x.sequence.erase(si); + } } } x.reduced = false; @@ -101683,11 +104634,13 @@ (sj != x_s_end && !pi_is_contained); ++sj) { const PSET& pj = sj->pointset(); - if (pj.contains(pi)) + if (pj.contains(pi)) { pi_is_contained = true; + } } - if (!pi_is_contained) + if (!pi_is_contained) { return false; + } } return true; } @@ -101708,100 +104661,74 @@ x_s_end = x.sequence.end(); (sj != x_s_end && !pi_is_strictly_contained); ++sj) { const PSET& pj = sj->pointset(); - if (pj.strictly_contains(pi)) + if (pj.strictly_contains(pi)) { pi_is_strictly_contained = true; + } } - if (!pi_is_strictly_contained) + if (!pi_is_strictly_contained) { return false; + } } return true; } template +template Poly_Con_Relation -Pointset_Powerset::relation_with(const Congruence& cg) const { - const Pointset_Powerset& x = *this; - - /* *this is included in cg if every disjunct is included in cg */ - bool is_included = true; - /* *this is disjoint with cg if every disjunct is disjoint with cg */ - bool is_disjoint = true; - /* *this strictly_intersects with cg if some disjunct strictly - intersects with cg */ - bool is_strictly_intersecting = false; - /* *this saturates cg if some disjunct saturates cg and - every disjunct is either disjoint from cg or saturates cg */ - bool saturates_once = false; - bool may_saturate = true; - for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) { - Poly_Con_Relation relation_i = si->pointset().relation_with(cg); - if (!relation_i.implies(Poly_Con_Relation::is_included())) - is_included = false; - if (!relation_i.implies(Poly_Con_Relation::is_disjoint())) - is_disjoint = false; - if (relation_i.implies(Poly_Con_Relation::strictly_intersects())) - is_strictly_intersecting = true; - if (relation_i.implies(Poly_Con_Relation::saturates())) - saturates_once = true; - else if (!relation_i.implies(Poly_Con_Relation::is_disjoint())) - may_saturate = false; - } - - Poly_Con_Relation result = Poly_Con_Relation::nothing(); - if (is_included) - result = result && Poly_Con_Relation::is_included(); - if (is_disjoint) - result = result && Poly_Con_Relation::is_disjoint(); - if (is_strictly_intersecting) - result = result && Poly_Con_Relation::strictly_intersects(); - if (saturates_once && may_saturate) - result = result && Poly_Con_Relation::saturates(); - - return result; -} - -template -Poly_Con_Relation -Pointset_Powerset::relation_with(const Constraint& c) const { +Pointset_Powerset::relation_with_aux(const Cons_or_Congr& c) const { const Pointset_Powerset& x = *this; /* *this is included in c if every disjunct is included in c */ bool is_included = true; /* *this is disjoint with c if every disjunct is disjoint with c */ bool is_disjoint = true; - /* *this strictly_intersects with c if some disjunct strictly - intersects with c */ + /* *this strictly_intersects with c if: + - some disjunct strictly intersects with c + or + - there exists two disjoints d1 and d2 + such that d1 is included in c and d2 is disjoint with c + */ bool is_strictly_intersecting = false; - /* *this saturates c if some disjunct saturates c and - every disjunct is either disjoint from c or saturates c */ - bool saturates_once = false; - bool may_saturate = true; + bool included_once = false; + bool disjoint_once = false; + /* *this saturates c if all disjuncts saturate c */ + bool saturates = true; for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { Poly_Con_Relation relation_i = si->pointset().relation_with(c); - if (!relation_i.implies(Poly_Con_Relation::is_included())) + if (relation_i.implies(Poly_Con_Relation::is_included())) { + included_once = true; + } + else { is_included = false; - if (!relation_i.implies(Poly_Con_Relation::is_disjoint())) + } + if (relation_i.implies(Poly_Con_Relation::is_disjoint())) { + disjoint_once = true; + } + else { is_disjoint = false; - if (relation_i.implies(Poly_Con_Relation::strictly_intersects())) + } + if (relation_i.implies(Poly_Con_Relation::strictly_intersects())) { is_strictly_intersecting = true; - if (relation_i.implies(Poly_Con_Relation::saturates())) - saturates_once = true; - else if (!relation_i.implies(Poly_Con_Relation::is_disjoint())) - may_saturate = false; + } + if (!relation_i.implies(Poly_Con_Relation::saturates())) { + saturates = false; + } } Poly_Con_Relation result = Poly_Con_Relation::nothing(); - if (is_included) + if (is_included) { result = result && Poly_Con_Relation::is_included(); - if (is_disjoint) + } + if (is_disjoint) { result = result && Poly_Con_Relation::is_disjoint(); - if (is_strictly_intersecting) + } + if (is_strictly_intersecting || (included_once && disjoint_once)) { result = result && Poly_Con_Relation::strictly_intersects(); - if (saturates_once && may_saturate) + } + if (saturates) { result = result && Poly_Con_Relation::saturates(); - + } return result; } @@ -101813,8 +104740,9 @@ for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { Poly_Gen_Relation relation_i = si->pointset().relation_with(g); - if (relation_i.implies(Poly_Gen_Relation::subsumes())) + if (relation_i.implies(Poly_Gen_Relation::subsumes())) { return Poly_Gen_Relation::subsumes(); + } } return Poly_Gen_Relation::nothing(); @@ -101827,9 +104755,11 @@ const Pointset_Powerset& x = *this; x.omega_reduce(); for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().bounds_from_above(expr)) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().bounds_from_above(expr)) { return false; + } + } return true; } @@ -101840,9 +104770,11 @@ const Pointset_Powerset& x = *this; x.omega_reduce(); for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (!si->pointset().bounds_from_below(expr)) + s_end = x.sequence.end(); si != s_end; ++si) { + if (!si->pointset().bounds_from_below(expr)) { return false; + } + } return true; } @@ -101854,8 +104786,9 @@ bool& maximum) const { const Pointset_Powerset& x = *this; x.omega_reduce(); - if (x.is_empty()) + if (x.is_empty()) { return false; + } bool first = true; @@ -101875,8 +104808,9 @@ for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { - if (!si->pointset().maximize(expr, iter_sup_n, iter_sup_d, iter_max)) + if (!si->pointset().maximize(expr, iter_sup_n, iter_sup_d, iter_max)) { return false; + } else if (first) { first = false; @@ -101891,8 +104825,9 @@ best_sup_d = iter_sup_d; best_max = iter_max; } - else if (tmp == 0) + else if (tmp == 0) { best_max = (best_max || iter_max); + } } } sup_n = best_sup_n; @@ -101910,8 +104845,9 @@ Generator& g) const { const Pointset_Powerset& x = *this; x.omega_reduce(); - if (x.is_empty()) + if (x.is_empty()) { return false; + } bool first = true; @@ -101934,9 +104870,10 @@ for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { if (!si->pointset().maximize(expr, - iter_sup_n, iter_sup_d, iter_max, iter_g)) + iter_sup_n, iter_sup_d, iter_max, iter_g)) { return false; - else + } + else { if (first) { first = false; best_sup_n = iter_sup_n; @@ -101957,6 +104894,7 @@ best_g = iter_g; } } + } } sup_n = best_sup_n; sup_d = best_sup_d; @@ -101973,8 +104911,9 @@ bool& minimum) const { const Pointset_Powerset& x = *this; x.omega_reduce(); - if (x.is_empty()) + if (x.is_empty()) { return false; + } bool first = true; @@ -101994,9 +104933,10 @@ for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { - if (!si->pointset().minimize(expr, iter_inf_n, iter_inf_d, iter_min)) + if (!si->pointset().minimize(expr, iter_inf_n, iter_inf_d, iter_min)) { return false; - else + } + else { if (first) { first = false; best_inf_n = iter_inf_n; @@ -102010,9 +104950,11 @@ best_inf_d = iter_inf_d; best_min = iter_min; } - else if (tmp == 0) + else if (tmp == 0) { best_min = (best_min || iter_min); + } } + } } inf_n = best_inf_n; inf_d = best_inf_d; @@ -102029,8 +104971,9 @@ Generator& g) const { const Pointset_Powerset& x = *this; x.omega_reduce(); - if (x.is_empty()) + if (x.is_empty()) { return false; + } bool first = true; @@ -102053,9 +104996,10 @@ for (Sequence_const_iterator si = x.sequence.begin(), s_end = x.sequence.end(); si != s_end; ++si) { if (!si->pointset().minimize(expr, - iter_inf_n, iter_inf_d, iter_min, iter_g)) + iter_inf_n, iter_inf_d, iter_min, iter_g)) { return false; - else + } + else { if (first) { first = false; best_inf_n = iter_inf_n; @@ -102076,6 +105020,7 @@ best_g = iter_g; } } + } } inf_n = best_inf_n; inf_d = best_inf_d; @@ -102089,9 +105034,11 @@ Pointset_Powerset::contains_integer_point() const { const Pointset_Powerset& x = *this; for (Sequence_const_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) - if (si->pointset().contains_integer_point()) + s_end = x.sequence.end(); si != s_end; ++si) { + if (si->pointset().contains_integer_point()) { return true; + } + } return false; } @@ -102106,9 +105053,10 @@ bool wrap_individually) { Pointset_Powerset& x = *this; for (Sequence_iterator si = x.sequence.begin(), - s_end = x.sequence.end(); si != s_end; ++si) + s_end = x.sequence.end(); si != s_end; ++si) { si->pointset().wrap_assign(vars, w, r, o, cs_p, complexity_threshold, wrap_individually); + } x.reduced = false; PPL_ASSERT_HEAVY(x.OK()); } @@ -102130,14 +105078,16 @@ Sequence_iterator s_end = x.sequence.end(); unsigned si_index = 0; for (Sequence_iterator si = s_begin; si != s_end; ++si, ++si_index) { - if (marked[si_index]) + if (marked[si_index]) { continue; + } PSET& pi = si->pointset(); Sequence_const_iterator sj = si; unsigned sj_index = si_index; for (++sj, ++sj_index; sj != s_end; ++sj, ++sj_index) { - if (marked[sj_index]) + if (marked[sj_index]) { continue; + } const PSET& pj = sj->pointset(); if (pi.upper_bound_assign_if_exact(pj)) { marked[si_index] = true; @@ -102154,12 +105104,14 @@ iterator new_x_end = new_x.end(); unsigned xi_index = 0; for (const_iterator xi = x.begin(), - x_end = x.end(); xi != x_end; ++xi, ++xi_index) - if (!marked[xi_index]) + x_end = x.end(); xi != x_end; ++xi, ++xi_index) { + if (!marked[xi_index]) { new_x_begin = new_x.add_non_bottom_disjunct_preserve_reduction(*xi, new_x_begin, new_x_end); + } + } using std::swap; swap(x.sequence, new_x.sequence); n -= deleted; @@ -102191,7 +105143,8 @@ const_iterator x_end = x.end(); unsigned i_index = 0; for (const_iterator i = x_begin, - y_begin = y.begin(), y_end = y.end(); i != x_end; ++i, ++i_index) + y_begin = y.begin(), y_end = y.end(); + i != x_end; ++i, ++i_index) { for (const_iterator j = y_begin; j != y_end; ++j) { const PSET& pi = i->pointset(); const PSET& pj = j->pointset(); @@ -102202,15 +105155,18 @@ marked[i_index] = true; } } + } iterator new_x_begin = new_x.begin(); iterator new_x_end = new_x.end(); i_index = 0; - for (const_iterator i = x_begin; i != x_end; ++i, ++i_index) - if (!marked[i_index]) + for (const_iterator i = x_begin; i != x_end; ++i, ++i_index) { + if (!marked[i_index]) { new_x_begin = new_x.add_non_bottom_disjunct_preserve_reduction(*i, new_x_begin, new_x_end); + } + } using std::swap; swap(x.sequence, new_x.sequence); PPL_ASSERT_HEAVY(x.OK()); @@ -102237,8 +105193,9 @@ #endif x.pairwise_reduce(); - if (max_disjuncts != 0) + if (max_disjuncts != 0) { x.collapse(max_disjuncts); + } x.BGP99_heuristics_assign(y, widen_fun); } @@ -102284,9 +105241,10 @@ ++xi; ++yi; } - else + else { // Different number of occurrences: can decide ordering. return xi_count < yi_count; + } break; } case 1: @@ -102324,25 +105282,29 @@ // If `y' is the empty collection, do nothing. PPL_ASSERT(x.size() > 0); - if (y.size() == 0) + if (y.size() == 0) { return; + } // Compute the poly-hull of `x'. PSET x_hull(x.space_dim, EMPTY); - for (const_iterator i = x.begin(), x_end = x.end(); i != x_end; ++i) + for (const_iterator i = x.begin(), x_end = x.end(); i != x_end; ++i) { x_hull.upper_bound_assign(i->pointset()); + } // Compute the poly-hull of `y'. PSET y_hull(y.space_dim, EMPTY); - for (const_iterator i = y.begin(), y_end = y.end(); i != y_end; ++i) + for (const_iterator i = y.begin(), y_end = y.end(); i != y_end; ++i) { y_hull.upper_bound_assign(i->pointset()); + } // Compute the certificate for `y_hull'. const Cert y_hull_cert(y_hull); // If the hull is stabilizing, do nothing. int hull_stabilization = y_hull_cert.compare(x_hull); - if (hull_stabilization == 1) + if (hull_stabilization == 1) { return; + } // Multiset ordering is only useful when `y' is not a singleton. const bool y_is_not_a_singleton = y.size() > 1; @@ -102358,8 +105320,9 @@ y.collect_certificates(y_cert_ms); y_cert_ms_computed = true; // If multiset ordering is stabilizing, do nothing. - if (x.is_cert_multiset_stabilizing(y_cert_ms)) + if (x.is_cert_multiset_stabilizing(y_cert_ms)) { return; + } } // Second widening technique: try the BGP99 powerset heuristics. @@ -102369,8 +105332,9 @@ // Compute the poly-hull of `bgp99_heuristics'. PSET bgp99_heuristics_hull(x.space_dim, EMPTY); for (const_iterator i = bgp99_heuristics.begin(), - b_h_end = bgp99_heuristics.end(); i != b_h_end; ++i) + b_h_end = bgp99_heuristics.end(); i != b_h_end; ++i) { bgp99_heuristics_hull.upper_bound_assign(i->pointset()); + } // Check for stabilization and, if successful, // commit to the result of the extrapolation. @@ -102427,8 +105391,10 @@ s << "size " << x.size() << "\nspace_dim " << x.space_dim << "\n"; - for (const_iterator xi = x.begin(), x_end = x.end(); xi != x_end; ++xi) + for (const_iterator xi = x.begin(), x_end = x.end(); + xi != x_end; ++xi) { xi->pointset().ascii_dump(s); + } } PPL_OUTPUT_TEMPLATE_DEFINITIONS(PSET, Pointset_Powerset) @@ -102439,25 +105405,30 @@ Pointset_Powerset& x = *this; std::string str; - if (!(s >> str) || str != "size") + if (!(s >> str) || str != "size") { return false; + } size_type sz; - if (!(s >> sz)) + if (!(s >> sz)) { return false; + } - if (!(s >> str) || str != "space_dim") + if (!(s >> str) || str != "space_dim") { return false; + } - if (!(s >> x.space_dim)) + if (!(s >> x.space_dim)) { return false; + } Pointset_Powerset new_x(x.space_dim, EMPTY); while (sz-- > 0) { PSET ph; - if (!ph.ascii_load(s)) + if (!ph.ascii_load(s)) { return false; + } new_x.add_disjunct(ph); } swap(x, new_x); @@ -102507,8 +105478,9 @@ const Constraint& neg_c = c.is_strict_inequality() ? (le <= 0) : (le < 0); NNC_Polyhedron nnc_ph_pset(pset); nnc_ph_pset.add_constraint(neg_c); - if (!nnc_ph_pset.is_empty()) + if (!nnc_ph_pset.is_empty()) { r.add_disjunct(nnc_ph_pset); + } pset.add_constraint(c); } @@ -102536,19 +105508,19 @@ linear_partition_aux(le <= 0, pset, r); linear_partition_aux(le >= 0, pset, r); } - else + else { linear_partition_aux(c, pset, r); + } } return std::make_pair(pset, r); } } // namespace Parma_Polyhedra_Library -/* Automatically generated from PPL source file ../src/Pointset_Powerset_defs.hh line 1448. */ +/* Automatically generated from PPL source file ../src/Pointset_Powerset_defs.hh line 1455. */ /* Automatically generated from PPL source file ../src/algorithms.hh line 29. */ #include -/* Automatically generated from PPL source file ../src/algorithms.hh line 31. */ namespace Parma_Polyhedra_Library { @@ -102578,12 +105550,14 @@ partition = linear_partition(q, poly_hull); const Pointset_Powerset& s = partition.second; typedef Pointset_Powerset::const_iterator iter; - for (iter i = s.begin(), s_end = s.end(); i != s_end; ++i) + for (iter i = s.begin(), s_end = s.end(); i != s_end; ++i) { // The polyhedral hull is exact if and only if all the elements // of the partition of the polyhedral hull of `p' and `q' with // respect to `q' are included in `p' - if (!nnc_p.contains(i->pointset())) + if (!nnc_p.contains(i->pointset())) { return false; + } + } p = poly_hull; return true; } @@ -103110,46 +106084,62 @@ dimension_type id = v.id(); switch (output_function_MS_which) { case 0: - if (id < output_function_MS_n) + if (id < output_function_MS_n) { s << "x'" << id + 1; - else if (id < 2*output_function_MS_n) + } + else if (id < 2*output_function_MS_n) { s << "x" << id - output_function_MS_n + 1; - else + } + else { s << "WHAT?"; + } break; case 1: - if (id < output_function_MS_n) + if (id < output_function_MS_n) { s << "mu" << id + 1; - else if (id == output_function_MS_n) + } + else if (id == output_function_MS_n) { s << "WHAT?"; - else if (id <= output_function_MS_n + output_function_MS_m) + } + else if (id <= output_function_MS_n + output_function_MS_m) { s << "y" << id - output_function_MS_n; - else + } + else { s << "WHAT?"; + } break; case 2: case 4: - if (id < output_function_MS_n) + if (id < output_function_MS_n) { s << "mu" << id + 1; - else if (id == output_function_MS_n) + } + else if (id == output_function_MS_n) { s << "mu0"; + } else if (output_function_MS_which == 2 - && id <= output_function_MS_n + output_function_MS_m + 2) + && id <= output_function_MS_n + output_function_MS_m + 2) { s << "z" << id - output_function_MS_n; - else + } + else { s << "WHAT?"; + } break; case 3: - if (id < output_function_MS_n) + if (id < output_function_MS_n) { s << "mu" << id + 1; - else if (id == output_function_MS_n) + } + else if (id == output_function_MS_n) { s << "mu0"; - else if (id <= output_function_MS_n + output_function_MS_m) + } + else if (id <= output_function_MS_n + output_function_MS_m) { s << "y" << id - output_function_MS_n; - else if (id <= output_function_MS_n + 2*output_function_MS_m + 2) + } + else if (id <= output_function_MS_n + 2*output_function_MS_m + 2) { s << "z" << id - (output_function_MS_n + output_function_MS_m); - else + } + else { s << "WHAT?"; + } break; default: abort(); @@ -103167,14 +106157,18 @@ inline void output_function_PR(std::ostream& s, const Variable v) { dimension_type id = v.id(); - if (id < output_function_PR_s) + if (id < output_function_PR_s) { s << "u3_" << id + 1; - else if (id < output_function_PR_s + output_function_PR_r) + } + else if (id < output_function_PR_s + output_function_PR_r) { s << "u2_" << id - output_function_PR_s + 1; - else if (id < output_function_PR_s + 2*output_function_PR_r) + } + else if (id < output_function_PR_s + 2*output_function_PR_r) { s << "u1_" << id - (output_function_PR_s + output_function_PR_r) + 1; - else + } + else { s << "WHAT?"; + } } #endif @@ -103253,8 +106247,9 @@ ::assign_all_inequalities_approximation(pset_after, cs_after); // FIXME: provide an "append" for constraint systems. for (Constraint_System::const_iterator i = cs_after.begin(), - cs_after_end = cs_after.end(); i != cs_after_end; ++i) + cs_after_end = cs_after.end(); i != cs_after_end; ++i) { cs.insert(*i); + } } template @@ -103853,8 +106848,9 @@ ::linearize(const FP_Interval_Abstract_Store& int_store, const FP_Linear_Form_Abstract_Store& lf_store, FP_Linear_Form& result) const { - if (!expr->linearize(int_store, lf_store, result)) + if (!expr->linearize(int_store, lf_store, result)) { return false; + } FP_Linear_Form rel_error; relative_error(result, rel_error); result += rel_error; @@ -104305,10 +107301,12 @@ FP_Linear_Form_Abstract_Store& lf_store) const { for (typename FP_Linear_Form_Abstract_Store::iterator i = lf_store.begin(); i != lf_store.end(); ) { - if ((i->second).coefficient(Variable(variable_index)) != 0) + if ((i->second).coefficient(Variable(variable_index)) != 0) { i = lf_store.erase(i); - else + } + else { ++i; + } } lf_store[variable_index] = lf; return; @@ -104583,15 +107581,17 @@ ::linearize(const FP_Interval_Abstract_Store& int_store, const FP_Linear_Form_Abstract_Store& lf_store, FP_Linear_Form& result) const { - if (!first_operand->linearize(int_store, lf_store, result)) + if (!first_operand->linearize(int_store, lf_store, result)) { return false; + } FP_Linear_Form rel_error; relative_error(result, rel_error); result += rel_error; FP_Linear_Form linearized_second_operand; if (!second_operand->linearize(int_store, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } result += linearized_second_operand; relative_error(linearized_second_operand, rel_error); result += rel_error; @@ -104823,7 +107823,7 @@ ::Difference_Floating_Point_Expression( Floating_Point_Expression* const x, Floating_Point_Expression* const y) - : first_operand(x), second_operand(y){ + : first_operand(x), second_operand(y) { assert(x != 0); assert(y != 0); } @@ -104868,15 +107868,17 @@ ::linearize(const FP_Interval_Abstract_Store& int_store, const FP_Linear_Form_Abstract_Store& lf_store, FP_Linear_Form& result) const { - if (!first_operand->linearize(int_store, lf_store, result)) + if (!first_operand->linearize(int_store, lf_store, result)) { return false; + } FP_Linear_Form rel_error; relative_error(result, rel_error); result += rel_error; FP_Linear_Form linearized_second_operand; if (!second_operand->linearize(int_store, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } result -= linearized_second_operand; relative_error(linearized_second_operand, rel_error); result += rel_error; @@ -105200,15 +108202,17 @@ bool intervalize_first; FP_Linear_Form linearized_first_operand; if (!first_operand->linearize(int_store, lf_store, - linearized_first_operand)) + linearized_first_operand)) { return false; + } FP_Interval_Type intervalized_first_operand; this->intervalize(linearized_first_operand, int_store, intervalized_first_operand); FP_Linear_Form linearized_second_operand; if (!second_operand->linearize(int_store, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } FP_Interval_Type intervalized_second_operand; this->intervalize(linearized_second_operand, int_store, intervalized_second_operand); @@ -105222,19 +108226,24 @@ boundary_type second_interval_size = intervalized_second_operand.upper() - intervalized_second_operand.lower(); - if (first_interval_size <= second_interval_size) + if (first_interval_size <= second_interval_size) { intervalize_first = true; - else + } + else { intervalize_first = false; + } } - else + else { intervalize_first = true; + } } else { - if (intervalized_second_operand.is_bounded()) + if (intervalized_second_operand.is_bounded()) { intervalize_first = false; - else + } + else { return false; + } } // Here we do the actual computation. @@ -105542,19 +108551,22 @@ FP_Linear_Form& result) const { FP_Linear_Form linearized_second_operand; if (!second_operand->linearize(int_store, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } FP_Interval_Type intervalized_second_operand; this->intervalize(linearized_second_operand, int_store, intervalized_second_operand); // Check if we may divide by zero. if (intervalized_second_operand.lower() <= 0 - && intervalized_second_operand.upper() >= 0) + && intervalized_second_operand.upper() >= 0) { return false; + } - if (!first_operand->linearize(int_store, lf_store, result)) + if (!first_operand->linearize(int_store, lf_store, result)) { return false; + } FP_Linear_Form rel_error; relative_error(result, rel_error); result /= intervalized_second_operand; @@ -105785,8 +108797,9 @@ ::linearize(const FP_Interval_Abstract_Store& int_store, const FP_Linear_Form_Abstract_Store& lf_store, FP_Linear_Form& result) const { - if (!operand->linearize(int_store, lf_store, result)) + if (!operand->linearize(int_store, lf_store, result)) { return false; + } result.negate(); return true; @@ -106687,9 +109700,11 @@ template inline bool EList::OK() const { - for (const_iterator i = begin(), lend = end(); i != lend; ++i) - if (!i->OK()) + for (const_iterator i = begin(), lend = end(); i != lend; ++i) { + if (!i->OK()) { return false; + } + } return true; } @@ -106828,15 +109843,16 @@ for (iterator active_list_end = active_list.end(); position != active_list_end && Traits::less_than(position->deadline(), deadline); - ++position) - ; + ++position) { + } iterator pending_element_p; // Only allocate a new element if the free list is empty. - if (free_list.empty()) + if (free_list.empty()) { pending_element_p = new Pending_Element(deadline, handler, expired_flag); + } else { pending_element_p = free_list.begin(); free_list.erase(pending_element_p); @@ -106850,11 +109866,12 @@ template bool Pending_List::OK() const { - if (!active_list.OK()) + if (!active_list.OK()) { return false; - - if (!free_list.OK()) + } + if (!free_list.OK()) { return false; + } const typename Traits::Threshold* old; const_iterator i = active_list.begin(); @@ -107054,7 +110071,7 @@ virtual void act() const; private: - // declare holder as reference to volatile pointer to const Flag_Base + // Declare holder as reference to volatile pointer to const Flag_Base. const Flag_Base* volatile& h; Flag& f; }; @@ -107085,10 +110102,6 @@ namespace Watchdog { -inline -Handler::~Handler() { -} - template Handler_Flag::Handler_Flag(const Flag_Base* volatile& holder, Flag& flag) @@ -107098,8 +110111,9 @@ template void Handler_Flag::act() const { - if (h == 0 || static_cast(*h).priority() < f.priority()) + if (h == 0 || static_cast(*h).priority() < f.priority()) { h = &f; + } } inline @@ -107107,11 +110121,6 @@ : f(function) { } -inline void -Handler_Function::act() const { - (*f)(); -} - } // namespace Watchdog } // namespace Implementation @@ -107135,9 +110144,10 @@ handler(*new Implementation::Watchdog::Handler_Flag(holder, flag)) { - if (csecs == 0) + if (csecs == 0) { throw std::invalid_argument("Watchdog constructor called with a" " non-positive number of centiseconds"); + } in_critical_section = true; pending_position = new_watchdog_event(csecs, handler, expired); in_critical_section = false; @@ -107147,9 +110157,10 @@ Watchdog::Watchdog(long csecs, void (* const function)()) : expired(false), handler(*new Implementation::Watchdog::Handler_Function(function)) { - if (csecs == 0) + if (csecs == 0) { throw std::invalid_argument("Watchdog constructor called with a" " non-positive number of centiseconds"); + } in_critical_section = true; pending_position = new_watchdog_event(csecs, handler, expired); in_critical_section = false; @@ -107280,10 +110291,9 @@ */ +/* Automatically generated from PPL source file ../src/Threshold_Watcher_inlines.hh line 28. */ #include -/* Automatically generated from PPL source file ../src/Threshold_Watcher_inlines.hh line 30. */ - namespace Parma_Polyhedra_Library { template @@ -107298,22 +110308,25 @@ flag)) { typename Traits::Threshold threshold; Traits::from_delta(threshold, delta); - if (!Traits::less_than(Traits::get(), threshold)) + if (!Traits::less_than(Traits::get(), threshold)) { throw std::invalid_argument("Threshold_Watcher constructor called with a" " threshold already reached"); + } pending_position = add_threshold(threshold, handler, expired); } template inline -Threshold_Watcher::Threshold_Watcher(const typename Traits::Delta& delta, void (*function)()) +Threshold_Watcher +::Threshold_Watcher(const typename Traits::Delta& delta, void (*function)()) : expired(false), handler(*new Implementation::Watchdog::Handler_Function(function)) { typename Traits::Threshold threshold; Traits::from_delta(threshold, delta); - if (!Traits::less_than(Traits::get(), threshold)) + if (!Traits::less_than(Traits::get(), threshold)) { throw std::invalid_argument("Threshold_Watcher constructor called with a" " threshold already reached"); + } pending_position = add_threshold(threshold, handler, expired); } @@ -107340,15 +110353,17 @@ Threshold_Watcher ::remove_threshold(typename TW_Pending_List::iterator position) { typename TW_Pending_List::iterator i = init.pending.erase(position); - if (init.pending.empty()) + if (init.pending.empty()) { Traits::check_function = 0; + } return i; } template Threshold_Watcher::~Threshold_Watcher() { - if (!expired) + if (!expired) { remove_threshold(pending_position); + } delete &handler; } @@ -107362,8 +110377,9 @@ i->handler().act(); i->expired_flag() = true; i = remove_threshold(i); - if (i == init.pending.end()) + if (i == init.pending.end()) { break; + } } } diff -Nru ppl-1.1/src/Ptr_Iterator_defs.hh ppl-1.2/src/Ptr_Iterator_defs.hh --- ppl-1.1/src/Ptr_Iterator_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Ptr_Iterator_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Ptr_Iterator class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Ptr_Iterator_inlines.hh ppl-1.2/src/Ptr_Iterator_inlines.hh --- ppl-1.1/src/Ptr_Iterator_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Ptr_Iterator_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Ptr_Iterator class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,9 +24,6 @@ #ifndef PPL_Ptr_Iterator_inlines_hh #define PPL_Ptr_Iterator_inlines_hh 1 -#include -#include "assert.hh" - namespace Parma_Polyhedra_Library { namespace Implementation { diff -Nru ppl-1.1/src/Ptr_Iterator_types.hh ppl-1.2/src/Ptr_Iterator_types.hh --- ppl-1.1/src/Ptr_Iterator_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Ptr_Iterator_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Rational_Box.hh ppl-1.2/src/Rational_Box.hh --- ppl-1.1/src/Rational_Box.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Rational_Box.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Rational_Box class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Rational_Interval.hh ppl-1.2/src/Rational_Interval.hh --- ppl-1.1/src/Rational_Interval.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Rational_Interval.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Rational_Interval class declaration and implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Result_defs.hh ppl-1.2/src/Result_defs.hh --- ppl-1.1/src/Result_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Result_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Result enum and supporting function declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Result_inlines.hh ppl-1.2/src/Result_inlines.hh --- ppl-1.1/src/Result_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Result_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Result supporting functions implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,7 +24,7 @@ #ifndef PPL_Result_inlines_hh #define PPL_Result_inlines_hh 1 -#include "assert.hh" +#include "assertions.hh" namespace Parma_Polyhedra_Library { diff -Nru ppl-1.1/src/Rounding_Dir_defs.hh ppl-1.2/src/Rounding_Dir_defs.hh --- ppl-1.1/src/Rounding_Dir_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Rounding_Dir_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Declaration of Rounding_Dir and related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Rounding_Dir_inlines.hh ppl-1.2/src/Rounding_Dir_inlines.hh --- ppl-1.1/src/Rounding_Dir_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Rounding_Dir_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Inline functions operating on enum Rounding_Dir values. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,7 +24,7 @@ #ifndef PPL_Rounding_Dir_inlines_hh #define PPL_Rounding_Dir_inlines_hh 1 -#include "assert.hh" +#include "assertions.hh" namespace Parma_Polyhedra_Library { diff -Nru ppl-1.1/src/Scalar_Products.cc ppl-1.2/src/Scalar_Products.cc --- ppl-1.1/src/Scalar_Products.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Scalar_Products.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Scalar_Products class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Scalar_Products_defs.hh ppl-1.2/src/Scalar_Products_defs.hh --- ppl-1.1/src/Scalar_Products_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Scalar_Products_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Scalar_Products class definition. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Scalar_Products_inlines.hh ppl-1.2/src/Scalar_Products_inlines.hh --- ppl-1.1/src/Scalar_Products_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Scalar_Products_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Scalar_Products class implementation (inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Scalar_Products_types.hh ppl-1.2/src/Scalar_Products_types.hh --- ppl-1.1/src/Scalar_Products_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Scalar_Products_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/set_GMP_memory_alloc_funcs.cc ppl-1.2/src/set_GMP_memory_alloc_funcs.cc --- ppl-1.1/src/set_GMP_memory_alloc_funcs.cc 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/src/set_GMP_memory_alloc_funcs.cc 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,31 @@ +/* Default definition of ppl_set_GMP_memory_allocation_functions(). + Copyright (C) 2001-2010 Roberto Bagnara + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) + +This file is part of the Parma Polyhedra Library (PPL). + +The PPL is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The PPL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. + +For the most up-to-date information see the Parma Polyhedra Library +site: http://bugseng.com/products/ppl/ . */ + +#include "ppl-config.h" + +extern "C" void +ppl_set_GMP_memory_allocation_functions(void); + +void +ppl_set_GMP_memory_allocation_functions(void) { +} diff -Nru ppl-1.1/src/Slow_Copy.hh ppl-1.2/src/Slow_Copy.hh --- ppl-1.1/src/Slow_Copy.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Slow_Copy.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Basic Slow_Copy classes declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Sparse_Row.cc ppl-1.2/src/Sparse_Row.cc --- ppl-1.1/src/Sparse_Row.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Sparse_Row.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Sparse_Row class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -31,18 +31,20 @@ class Sparse_Row_from_Dense_Row_helper_iterator { public: - Sparse_Row_from_Dense_Row_helper_iterator(const PPL::Dense_Row& row1, + Sparse_Row_from_Dense_Row_helper_iterator(const PPL::Dense_Row& r, PPL::dimension_type sz) - : row(row1), sz(sz), i(0) { - if (row.size() != 0 && row[0] == 0) + : row(r), sz(sz), idx(0) { + if (row.size() != 0 && row[0] == 0) { ++(*this); + } } Sparse_Row_from_Dense_Row_helper_iterator& operator++() { - PPL_ASSERT(i < sz); - ++i; - while (i < sz && row[i] == 0) - ++i; + PPL_ASSERT(idx < sz); + ++idx; + while (idx < sz && row[idx] == 0) { + ++idx; + } return *this; } @@ -54,20 +56,20 @@ PPL::Coefficient_traits::const_reference operator*() const { - PPL_ASSERT(i < sz); - return row[i]; + PPL_ASSERT(idx < sz); + return row[idx]; } PPL::dimension_type index() const { - PPL_ASSERT(i < sz); - return i; + PPL_ASSERT(idx < sz); + return idx; } bool operator==(const Sparse_Row_from_Dense_Row_helper_iterator& itr) const { PPL_ASSERT(&row == &(itr.row)); - return i == itr.i; + return idx == itr.idx; } bool @@ -78,7 +80,7 @@ private: const PPL::Dense_Row& row; PPL::dimension_type sz; - PPL::dimension_type i; + PPL::dimension_type idx; }; // Returns the number of nonzero elements in row. @@ -86,9 +88,11 @@ Sparse_Row_from_Dense_Row_helper_function(const PPL::Dense_Row& row, PPL::dimension_type sz) { PPL::dimension_type count = 0; - for (PPL::dimension_type i = sz; i-- > 0; ) - if (row[i] != 0) + for (PPL::dimension_type i = sz; i-- > 0; ) { + if (row[i] != 0) { ++count; + } + } return count; } @@ -124,17 +128,19 @@ PPL_ASSERT(i < size_); PPL_ASSERT(j < size_); - if (tree.empty()) + if (tree.empty()) { return; + } using std::swap; iterator itr_i = tree.bisect(i); iterator itr_j = tree.bisect(j); - if (itr_i.index() == i) - if (itr_j.index() == j) + if (itr_i.index() == i) { + if (itr_j.index() == j) { // Both elements are in the tree. swap(*itr_i, *itr_j); + } else { // i is in the tree, j is not. PPL_DIRTY_TEMP_COEFFICIENT(tmp); @@ -144,7 +150,8 @@ itr_j = tree.insert(j); swap(*itr_j, tmp); } - else + } + else { if (itr_j.index() == j) { // j is in the tree, i is not. PPL_DIRTY_TEMP_COEFFICIENT(tmp); @@ -157,20 +164,24 @@ else { // Do nothing, elements are both non-stored zeroes. } + } } PPL::Sparse_Row::iterator PPL::Sparse_Row::reset(iterator first, iterator last) { - if (first == last) + if (first == last) { return first; + } + PPL_ASSERT(last != end()); --last; const dimension_type j = last.index(); PPL_ASSERT(first.index() <= j); // We can't just compare first and last at each iteration, because last will // be invalidated by the first erase. - while (first.index() < j) + while (first.index() < j) { first = reset(first); + } first = reset(first); @@ -188,8 +199,9 @@ // reset(). const iterator& itr_end = end(); - while (itr != itr_end) + while (itr != itr_end) { itr = reset(itr); + } PPL_ASSERT(OK()); } @@ -204,8 +216,9 @@ Coefficient_traits::const_reference x_i = *i; if (const int x_i_sign = sgn(x_i)) { gcd = x_i; - if (x_i_sign < 0) + if (x_i_sign < 0) { neg_assign(gcd); + } goto compute_gcd; } } @@ -213,8 +226,9 @@ return; compute_gcd: - if (gcd == 1) + if (gcd == 1) { return; + } for (++i; i != i_end; ++i) { Coefficient_traits::const_reference x_i = *i; if (x_i != 0) { @@ -230,8 +244,9 @@ // integers we cannot make any assumption, so here we draw. // Overall, we win. gcd_assign(gcd, x_i, gcd); - if (gcd == 1) + if (gcd == 1) { return; + } } } // Divide the coefficients by the GCD. @@ -260,10 +275,12 @@ } void operator++() { - if (from_i) + if (from_i) { ++i; - if (from_j) + } + if (from_j) { ++j; + } update_current_data(); } @@ -363,8 +380,9 @@ for (const_iterator j = y.begin(), j_end = y.end(); j != j_end; ++j) { i = insert(i, j.index()); add_mul_assign(*i, *j, coeff2); - if (*i == 0) + if (*i == 0) { i = reset(i); + } } return; } @@ -382,25 +400,29 @@ if (i.index() == j.index()) { ++i; ++j; - if (i == i_end) + if (i == i_end) { break; + } } - else + else { if (i.index() < j.index()) { i = lower_bound(i, j.index()); - if (i == i_end) + if (i == i_end) { break; + } } else { PPL_ASSERT(i.index() > j.index()); ++counter; ++j; } + } } } PPL_ASSERT(i == i_end || j == j_end); - for ( ; j != j_end; ++j) + for ( ; j != j_end; ++j) { ++counter; + } } // This condition is arbitrary. Changing it affects performance but not // correctness. The values have been tuned using some ppl_lpsol benchmarks @@ -418,13 +440,15 @@ if (i.index() == j.index()) { (*i) *= coeff1; add_mul_assign(*i, *j, coeff2); - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } ++j; } - else + else { if (i.index() < j.index()) { (*i) *= coeff1; ++i; @@ -436,10 +460,12 @@ ++i; ++j; } + } } PPL_ASSERT(i == i_end || j == j_end); - for ( ; i != i_end; ++i) + for ( ; i != i_end; ++i) { (*i) *= coeff1; + } for ( ; j != j_end; ++j) { i = insert(i, j.index(), *j); (*i) *= coeff2; @@ -466,8 +492,9 @@ i = reset(i); PPL_ASSERT(find(old_index) == end()); } - else + else { ++i; + } } } } @@ -489,8 +516,9 @@ j_end = y.lower_bound(end); j != j_end; ++j) { i = insert(i, j.index()); *i += *j; - if (*i == 0) + if (*i == 0) { i = reset(i); + } } return; } @@ -501,8 +529,9 @@ j_end = y.lower_bound(end); j != j_end; ++j) { i = insert(i, j.index()); *i -= *j; - if (*i == 0) + if (*i == 0) { i = reset(i); + } } return; } @@ -512,8 +541,9 @@ j_end = y.lower_bound(end); j != j_end; ++j) { i = insert(i, j.index()); add_mul_assign(*i, *j, coeff2); - if (*i == 0) + if (*i == 0) { i = reset(i); + } } return; } @@ -531,13 +561,15 @@ if (i.index() == j.index()) { (*i) *= coeff1; *i += *j; - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } ++j; } - else + else { if (i.index() < j.index()) { (*i) *= coeff1; ++i; @@ -548,12 +580,15 @@ ++i; ++j; } + } } PPL_ASSERT(i == i_end || j == j_end); - for ( ; i != i_end && i.index() < end; ++i) + for ( ; i != i_end && i.index() < end; ++i) { (*i) *= coeff1; - for ( ; j != j_end; ++j) + } + for ( ; j != j_end; ++j) { i = insert(i, j.index(), *j); + } return; } @@ -570,13 +605,15 @@ if (i.index() == j.index()) { (*i) *= coeff1; *i -= *j; - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } ++j; } - else + else { if (i.index() < j.index()) { (*i) *= coeff1; ++i; @@ -588,10 +625,12 @@ ++i; ++j; } + } } PPL_ASSERT(i == i_end || j == j_end); - for ( ; i != i_end && i.index() < end; ++i) + for ( ; i != i_end && i.index() < end; ++i) { (*i) *= coeff1; + } for ( ; j != j_end; ++j) { i = insert(i, j.index(), *j); neg_assign(*i); @@ -610,13 +649,15 @@ if (i.index() == j.index()) { (*i) *= coeff1; add_mul_assign(*i, *j, coeff2); - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } ++j; } - else + else { if (i.index() < j.index()) { (*i) *= coeff1; ++i; @@ -628,10 +669,12 @@ ++i; ++j; } + } } PPL_ASSERT(i == i_end || j == j_end); - for ( ; i != i_end && i.index() < end; ++i) + for ( ; i != i_end && i.index() < end; ++i) { (*i) *= coeff1; + } for ( ; j != j_end; ++j) { i = insert(i, j.index(), *j); (*i) *= coeff2; @@ -642,11 +685,13 @@ PPL::Sparse_Row::ascii_dump(std::ostream& s) const { s << "size " << size_ << ' '; dimension_type n_elements = 0; - for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) + for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) { ++n_elements; + } s << "elements " << n_elements << ' '; - for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) + for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) { s << "[ " << i.index() << " ]= " << *i << ' '; + } s << "\n"; } @@ -655,30 +700,38 @@ bool PPL::Sparse_Row::ascii_load(std::istream& s) { std::string str; - if (!(s >> str) || str != "size") + if (!(s >> str) || str != "size") { return false; - if (!(s >> size_)) + } + if (!(s >> size_)) { return false; + } clear(); - if (!(s >> str) || str != "elements") + if (!(s >> str) || str != "elements") { return false; + } dimension_type n_elements; - if (!(s >> n_elements)) + if (!(s >> n_elements)) { return false; + } PPL_DIRTY_TEMP_COEFFICIENT(current_data); for (dimension_type i = 0; i < n_elements; ++i) { dimension_type current_key; - if (!(s >> str) || str != "[") + if (!(s >> str) || str != "[") { return false; - if (!(s >> current_key)) + } + if (!(s >> current_key)) { return false; - if (!(s >> str) || str != "]=") + } + if (!(s >> str) || str != "]=") { return false; - if (!(s >> current_data)) + } + if (!(s >> current_data)) { return false; + } tree.insert(current_key, current_data); } PPL_ASSERT(OK()); @@ -687,8 +740,9 @@ bool PPL::Sparse_Row::OK() const { - if (begin() == end()) + if (begin() == end()) { return true; + } const_iterator last = end(); --last; return (last.index() < size_); @@ -702,39 +756,47 @@ /*! \relates Parma_Polyhedra_Library::Sparse_Row */ bool PPL::operator==(const Sparse_Row& x, const Sparse_Row& y) { - if (x.size() != y.size()) + if (x.size() != y.size()) { return false; + } Sparse_Row::const_iterator i = x.begin(); Sparse_Row::const_iterator i_end = x.end(); Sparse_Row::const_iterator j = y.begin(); Sparse_Row::const_iterator j_end = y.end(); while (i != i_end && j != j_end) { if (i.index() == j.index()) { - if (*i != *j) + if (*i != *j) { return false; + } ++i; ++j; } else { if (i.index() < j.index()) { - if (*i != 0) + if (*i != 0) { return false; + } ++i; } else { PPL_ASSERT(i.index() > j.index()); - if (*j != 0) + if (*j != 0) { return false; + } ++j; } } } - for ( ; i != i_end; ++i) - if (*i != 0) + for ( ; i != i_end; ++i) { + if (*i != 0) { return false; - for ( ; j != j_end; ++j) - if (*j != 0) + } + } + for ( ; j != j_end; ++j) { + if (*j != 0) { return false; + } + } return true; } @@ -746,18 +808,21 @@ bool PPL::operator==(const Dense_Row& x, const Sparse_Row& y) { - if (x.size() != y.size()) + if (x.size() != y.size()) { return false; + } Sparse_Row::const_iterator itr = y.end(); for (dimension_type i = 0; i < x.size(); ++i) { itr = y.lower_bound(itr, i); if (itr != y.end() && itr.index() == i) { - if (x[i] != *itr) + if (x[i] != *itr) { return false; + } } else { - if (x[i] != 0) + if (x[i] != 0) { return false; + } } } return true; @@ -791,8 +856,9 @@ for (dimension_type i = 0; i < y.size(); ++i) { itr = x.lower_bound(itr, i); if (itr == x.end() || itr.index() != i) { - if (y[i] == 0) + if (y[i] == 0) { continue; + } itr = x.insert(itr, i, y[i]); (*itr) *= coeff2; PPL_ASSERT((*itr) != 0); @@ -801,8 +867,9 @@ PPL_ASSERT(itr.index() == i); (*itr) *= coeff1; add_mul_assign(*itr, y[i], coeff2); - if (*itr == 0) + if (*itr == 0) { itr = x.reset(itr); + } } } } @@ -824,20 +891,23 @@ if (coeff2 == 1) { for (dimension_type i = start; i < end; ++i) { PPL_ASSERT(itr == x.end() || itr.index() + 1 >= i); - if (itr != x.end() && itr.index() < i) + if (itr != x.end() && itr.index() < i) { ++itr; + } PPL_ASSERT(itr == x.end() || itr.index() >= i); if (itr == x.end() || itr.index() != i) { - if (y[i] == 0) + if (y[i] == 0) { continue; + } itr = x.insert(itr, i, y[i]); PPL_ASSERT((*itr) != 0); } else { PPL_ASSERT(itr.index() == i); (*itr) += y[i]; - if (*itr == 0) + if (*itr == 0) { itr = x.reset(itr); + } } } return; @@ -845,12 +915,14 @@ if (coeff2 == -1) { for (dimension_type i = start; i < end; ++i) { PPL_ASSERT(itr == x.end() || itr.index() + 1 >= i); - if (itr != x.end() && itr.index() < i) + if (itr != x.end() && itr.index() < i) { ++itr; + } PPL_ASSERT(itr == x.end() || itr.index() >= i); if (itr == x.end() || itr.index() != i) { - if (y[i] == 0) + if (y[i] == 0) { continue; + } itr = x.insert(itr, i, y[i]); neg_assign(*itr); PPL_ASSERT((*itr) != 0); @@ -858,20 +930,23 @@ else { PPL_ASSERT(itr.index() == i); (*itr) -= y[i]; - if (*itr == 0) + if (*itr == 0) { itr = x.reset(itr); + } } } return; } for (dimension_type i = start; i < end; ++i) { PPL_ASSERT(itr == x.end() || itr.index() + 1 >= i); - if (itr != x.end() && itr.index() < i) + if (itr != x.end() && itr.index() < i) { ++itr; + } PPL_ASSERT(itr == x.end() || itr.index() >= i); if (itr == x.end() || itr.index() != i) { - if (y[i] == 0) + if (y[i] == 0) { continue; + } itr = x.insert(itr, i, y[i]); (*itr) *= coeff2; PPL_ASSERT((*itr) != 0); @@ -879,8 +954,9 @@ else { PPL_ASSERT(itr.index() == i); add_mul_assign(*itr, y[i], coeff2); - if (*itr == 0) + if (*itr == 0) { itr = x.reset(itr); + } } } return; @@ -889,12 +965,14 @@ if (coeff2 == 1) { for (dimension_type i = start; i < end; ++i) { PPL_ASSERT(itr == x.end() || itr.index() + 1 >= i); - if (itr != x.end() && itr.index() < i) + if (itr != x.end() && itr.index() < i) { ++itr; + } PPL_ASSERT(itr == x.end() || itr.index() >= i); if (itr == x.end() || itr.index() != i) { - if (y[i] == 0) + if (y[i] == 0) { continue; + } itr = x.insert(itr, i, y[i]); PPL_ASSERT((*itr) != 0); } @@ -902,8 +980,9 @@ PPL_ASSERT(itr.index() == i); (*itr) *= coeff1; (*itr) += y[i]; - if (*itr == 0) + if (*itr == 0) { itr = x.reset(itr); + } } } return; @@ -911,12 +990,14 @@ if (coeff2 == -1) { for (dimension_type i = start; i < end; ++i) { PPL_ASSERT(itr == x.end() || itr.index() + 1 >= i); - if (itr != x.end() && itr.index() < i) + if (itr != x.end() && itr.index() < i) { ++itr; + } PPL_ASSERT(itr == x.end() || itr.index() >= i); if (itr == x.end() || itr.index() != i) { - if (y[i] == 0) + if (y[i] == 0) { continue; + } itr = x.insert(itr, i, y[i]); neg_assign(*itr); PPL_ASSERT((*itr) != 0); @@ -925,8 +1006,9 @@ PPL_ASSERT(itr.index() == i); (*itr) *= coeff1; (*itr) -= y[i]; - if (*itr == 0) + if (*itr == 0) { itr = x.reset(itr); + } } } return; @@ -934,12 +1016,14 @@ for (dimension_type i = start; i < end; ++i) { PPL_ASSERT(itr == x.end() || itr.index() + 1 >= i); - if (itr != x.end() && itr.index() < i) + if (itr != x.end() && itr.index() < i) { ++itr; + } PPL_ASSERT(itr == x.end() || itr.index() >= i); if (itr == x.end() || itr.index() != i) { - if (y[i] == 0) + if (y[i] == 0) { continue; + } itr = x.insert(itr, i, y[i]); (*itr) *= coeff2; PPL_ASSERT((*itr) != 0); @@ -948,8 +1032,9 @@ PPL_ASSERT(itr.index() == i); (*itr) *= coeff1; add_mul_assign(*itr, y[i], coeff2); - if (*itr == 0) + if (*itr == 0) { itr = x.reset(itr); + } } } } @@ -961,8 +1046,9 @@ PPL_ASSERT(x.size() >= y.size()); if (coeff1 == 1) { for (Sparse_Row::const_iterator i = y.begin(), - i_end = y.end(); i != i_end; ++i) + i_end = y.end(); i != i_end; ++i) { add_mul_assign(x[i.index()], *i, coeff2); + } return; } @@ -973,8 +1059,9 @@ itr = y.lower_bound(itr, i); - if (itr == y.end() || itr.index() != i) + if (itr == y.end() || itr.index() != i) { continue; + } add_mul_assign(x[i], *itr, coeff2); } @@ -994,17 +1081,20 @@ if (coeff1 == 1) { Sparse_Row::const_iterator itr_end = y.lower_bound(end); if (coeff2 == 1) { - for ( ; itr != itr_end; ++itr) + for ( ; itr != itr_end; ++itr) { x[itr.index()] += *itr; + } return; } if (coeff2 == -1) { - for ( ; itr != itr_end; ++itr) + for ( ; itr != itr_end; ++itr) { x[itr.index()] -= *itr; + } return; } - for ( ; itr != itr_end; ++itr) + for ( ; itr != itr_end; ++itr) { add_mul_assign(x[itr.index()], *itr, coeff2); + } return; } @@ -1013,12 +1103,14 @@ x[i] *= coeff1; PPL_ASSERT(itr == y.end() || itr.index() + 1 >= i); - if (itr != y.end() && itr.index() < i) + if (itr != y.end() && itr.index() < i) { ++itr; + } PPL_ASSERT(itr == y.end() || itr.index() >= i); - if (itr == y.end() || itr.index() != i) + if (itr == y.end() || itr.index() != i) { continue; + } x[i] += *itr; } @@ -1029,12 +1121,14 @@ x[i] *= coeff1; PPL_ASSERT(itr == y.end() || itr.index() + 1 >= i); - if (itr != y.end() && itr.index() < i) + if (itr != y.end() && itr.index() < i) { ++itr; + } PPL_ASSERT(itr == y.end() || itr.index() >= i); - if (itr == y.end() || itr.index() != i) + if (itr == y.end() || itr.index() != i) { continue; + } x[i] -= *itr; } @@ -1045,12 +1139,14 @@ x[i] *= coeff1; PPL_ASSERT(itr == y.end() || itr.index() + 1 >= i); - if (itr != y.end() && itr.index() < i) + if (itr != y.end() && itr.index() < i) { ++itr; + } PPL_ASSERT(itr == y.end() || itr.index() >= i); - if (itr == y.end() || itr.index() != i) + if (itr == y.end() || itr.index() != i) { continue; + } add_mul_assign(x[i], *itr, coeff2); } @@ -1075,8 +1171,10 @@ PPL::swap(Sparse_Row& x, Dense_Row& y) { Dense_Row new_dense(x.size(), x.size()); - for (Sparse_Row::iterator i = x.begin(), i_end = x.end(); i != i_end; ++i) + for (Sparse_Row::iterator i = x.begin(), i_end = x.end(); + i != i_end; ++i) { swap(new_dense[i.index()], *i); + } // NOTE: This copies the coefficients, but it could steal them. // Implementing a stealing-based algorithm takes a lot of time and it's diff -Nru ppl-1.1/src/Sparse_Row_defs.hh ppl-1.2/src/Sparse_Row_defs.hh --- ppl-1.1/src/Sparse_Row_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Sparse_Row_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Sparse_Row class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Sparse_Row_inlines.hh ppl-1.2/src/Sparse_Row_inlines.hh --- ppl-1.1/src/Sparse_Row_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Sparse_Row_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Sparse_Row class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -74,8 +74,9 @@ inline void Sparse_Row::resize(dimension_type n) { - if (n < size_) + if (n < size_) { reset_after(n); + } size_ = n; PPL_ASSERT(OK()); } @@ -163,13 +164,16 @@ inline Coefficient_traits::const_reference Sparse_Row::get(dimension_type i) const { PPL_ASSERT(i < size_); - if (tree.empty()) + if (tree.empty()) { return Coefficient_zero(); + } const_iterator itr = find(i); - if (itr != end()) + if (itr != end()) { return *itr; - else + } + else { return Coefficient_zero(); + } } inline Sparse_Row::iterator @@ -178,9 +182,9 @@ iterator itr = tree.bisect(i); - if (itr != end() && itr.index() == i) + if (itr != end() && itr.index() == i) { return itr; - + } return end(); } @@ -190,9 +194,9 @@ iterator itr = tree.bisect_near(hint, i); - if (itr != end() && itr.index() == i) + if (itr != end() && itr.index() == i) { return itr; - + } return end(); } @@ -202,8 +206,9 @@ const_iterator itr = tree.bisect(i); - if (itr != end() && itr.index() == i) + if (itr != end() && itr.index() == i) { return itr; + } return end(); } @@ -214,9 +219,9 @@ const_iterator itr = tree.bisect_near(hint, i); - if (itr != end() && itr.index() == i) + if (itr != end() && itr.index() == i) { return itr; - + } return end(); } @@ -226,11 +231,13 @@ iterator itr = tree.bisect(i); - if (itr == end()) + if (itr == end()) { return end(); + } - if (itr.index() < i) + if (itr.index() < i) { ++itr; + } PPL_ASSERT(itr == end() || itr.index() >= i); @@ -243,11 +250,13 @@ iterator itr = tree.bisect_near(hint, i); - if (itr == end()) + if (itr == end()) { return end(); + } - if (itr.index() < i) + if (itr.index() < i) { ++itr; + } PPL_ASSERT(itr == end() || itr.index() >= i); @@ -260,11 +269,13 @@ const_iterator itr = tree.bisect(i); - if (itr == end()) + if (itr == end()) { return end(); + } - if (itr.index() < i) + if (itr.index() < i) { ++itr; + } PPL_ASSERT(itr == end() || itr.index() >= i); @@ -277,11 +288,13 @@ const_iterator itr = tree.bisect_near(hint, i); - if (itr == end()) + if (itr == end()) { return end(); + } - if (itr.index() < i) + if (itr.index() < i) { ++itr; + } PPL_ASSERT(itr == end() || itr.index() >= i); diff -Nru ppl-1.1/src/Sparse_Row_templates.hh ppl-1.2/src/Sparse_Row_templates.hh --- ppl-1.1/src/Sparse_Row_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Sparse_Row_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Sparse_Row class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -32,8 +32,9 @@ Sparse_Row::combine_needs_first(const Sparse_Row& y, const Func1& f, const Func2& g) { if (this == &y) { - for (iterator i = begin(), i_end = end(); i != i_end; ++i) + for (iterator i = begin(), i_end = end(); i != i_end; ++i) { g(*i, *i); + } } else { iterator i = begin(); @@ -43,31 +44,39 @@ const iterator& i_end = end(); const_iterator j = y.begin(); const_iterator j_end = y.end(); - while (i != i_end && j != j_end) + while (i != i_end && j != j_end) { if (i.index() == j.index()) { g(*i, *j); - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } ++j; } else if (i.index() < j.index()) { f(*i); - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } } - else + else { j = y.lower_bound(j, i.index()); + } + } while (i != i_end) { f(*i); - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } } } } @@ -81,8 +90,9 @@ for (const_iterator j = y.begin(), j_end = y.end(); j != j_end; ++j) { i = insert(i, j.index()); g(*i, *j); - if (*i == 0) + if (*i == 0) { i = reset(i); + } } } @@ -91,8 +101,9 @@ Sparse_Row::combine(const Sparse_Row& y, const Func1& f, const Func2& g, const Func3& h) { if (this == &y) { - for (iterator i = begin(), i_end = end(); i != i_end; ++i) + for (iterator i = begin(), i_end = end(); i != i_end; ++i) { g(*i, *i); + } } else { iterator i = begin(); @@ -105,44 +116,53 @@ while (i != i_end && j != j_end) { if (i.index() == j.index()) { g(*i, *j); - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } ++j; } else if (i.index() < j.index()) { f(*i); - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } } else { PPL_ASSERT(i.index() > j.index()); i = insert(i, j.index()); h(*i, *j); - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } ++j; } } PPL_ASSERT(i == i_end || j == j_end); while (i != i_end) { f(*i); - if (*i == 0) + if (*i == 0) { i = reset(i); - else + } + else { ++i; + } } while (j != j_end) { i = insert(i, j.index()); h(*i, *j); - if (*i == 0) + if (*i == 0) { i = reset(i); + } ++j; } } diff -Nru ppl-1.1/src/Sparse_Row_types.hh ppl-1.2/src/Sparse_Row_types.hh --- ppl-1.1/src/Sparse_Row_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Sparse_Row_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/stdiobuf.cc ppl-1.2/src/stdiobuf.cc --- ppl-1.1/src/stdiobuf.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/stdiobuf.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* stdiobuf class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,7 +24,7 @@ #include "ppl-config.h" #include "stdiobuf_defs.hh" #include "globals_defs.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace Parma_Polyhedra_Library { @@ -45,10 +45,12 @@ stdiobuf::xsgetn(char_type* s, std::streamsize n) { PPL_ASSERT(n >= 0); const size_t r = fread(s, 1, static_cast(n), fp); - if (r > 0) + if (r > 0) { unget_char_buf = traits_type::to_int_type(s[r - 1]); - else + } + else { unget_char_buf = traits_type::eof(); + } return static_cast(r); } @@ -70,10 +72,12 @@ stdiobuf::int_type stdiobuf::overflow(int_type c) { const int_type eof = traits_type::eof(); - if (traits_type::eq_int_type(c, eof)) + if (traits_type::eq_int_type(c, eof)) { return (fflush(fp) != 0) ? eof : traits_type::not_eof(c); - else + } + else { return putc(c, fp); + } } int diff -Nru ppl-1.1/src/stdiobuf_defs.hh ppl-1.2/src/stdiobuf_defs.hh --- ppl-1.1/src/stdiobuf_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/stdiobuf_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* stdiobuf class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/stdiobuf_inlines.hh ppl-1.2/src/stdiobuf_inlines.hh --- ppl-1.1/src/stdiobuf_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/stdiobuf_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* stdiobuf class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/stdiobuf_types.hh ppl-1.2/src/stdiobuf_types.hh --- ppl-1.1/src/stdiobuf_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/stdiobuf_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Sum_Floating_Point_Expression_defs.hh ppl-1.2/src/Sum_Floating_Point_Expression_defs.hh --- ppl-1.1/src/Sum_Floating_Point_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Sum_Floating_Point_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declarations for the Sum_Floating_Point_Expression class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Sum_Floating_Point_Expression_inlines.hh ppl-1.2/src/Sum_Floating_Point_Expression_inlines.hh --- ppl-1.1/src/Sum_Floating_Point_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Sum_Floating_Point_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Sum_Floating_Point_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Sum_Floating_Point_Expression_templates.hh ppl-1.2/src/Sum_Floating_Point_Expression_templates.hh --- ppl-1.1/src/Sum_Floating_Point_Expression_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Sum_Floating_Point_Expression_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Sum_Floating_Point_Expression class implementation: non-inline template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -32,15 +32,17 @@ ::linearize(const FP_Interval_Abstract_Store& int_store, const FP_Linear_Form_Abstract_Store& lf_store, FP_Linear_Form& result) const { - if (!first_operand->linearize(int_store, lf_store, result)) + if (!first_operand->linearize(int_store, lf_store, result)) { return false; + } FP_Linear_Form rel_error; relative_error(result, rel_error); result += rel_error; FP_Linear_Form linearized_second_operand; if (!second_operand->linearize(int_store, lf_store, - linearized_second_operand)) + linearized_second_operand)) { return false; + } result += linearized_second_operand; relative_error(linearized_second_operand, rel_error); result += rel_error; diff -Nru ppl-1.1/src/Sum_Floating_Point_Expression_types.hh ppl-1.2/src/Sum_Floating_Point_Expression_types.hh --- ppl-1.1/src/Sum_Floating_Point_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Sum_Floating_Point_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/swapping_sort_templates.hh ppl-1.2/src/swapping_sort_templates.hh --- ppl-1.1/src/swapping_sort_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/swapping_sort_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Sorting objects for which copies cost more than swaps. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -112,8 +112,9 @@ PPL_ASSERT(num_elems >= 2); std::vector iv; iv.reserve(num_elems); - for (index_type i = 0, i_end = num_elems; i != i_end; ++i) + for (index_type i = 0, i_end = num_elems; i != i_end; ++i) { iv.push_back(i); + } typedef typename std::vector::iterator Iter; const Iter iv_begin = iv.begin(); @@ -140,23 +141,27 @@ } // Restore `iv' indices to 0 .. num_elems-1 for the call to unique. - for (index_type i = num_elems; i-- > 0; ) + for (index_type i = num_elems; i-- > 0; ) { iv[i] = i; + } // Unique `iv' by comparing the rows indexed by its elements. iv_end = std::unique(iv_begin, iv_end, unique_cmp); const index_type num_sorted = static_cast(iv_end - iv_begin); const index_type num_duplicates = num_elems - num_sorted; - if (num_duplicates == 0) + if (num_duplicates == 0) { return 0; + } // There were duplicates: swap the rows according to `iv'. index_type dst = 0; - while (dst < num_sorted && dst == iv[dst]) + while (dst < num_sorted && dst == iv[dst]) { ++dst; - if (dst == num_sorted) + } + if (dst == num_sorted) { return num_duplicates; + } do { const index_type src = iv[dst]; indirect_swap(src, dst); diff -Nru ppl-1.1/src/Swapping_Vector_defs.hh ppl-1.2/src/Swapping_Vector_defs.hh --- ppl-1.1/src/Swapping_Vector_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Swapping_Vector_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Swapping_Vector class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -26,9 +26,7 @@ #include "Swapping_Vector_types.hh" #include "globals_defs.hh" - #include -#include "assert.hh" namespace Parma_Polyhedra_Library { diff -Nru ppl-1.1/src/Swapping_Vector_inlines.hh ppl-1.2/src/Swapping_Vector_inlines.hh --- ppl-1.1/src/Swapping_Vector_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Swapping_Vector_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Swapping_Vector class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,6 +24,8 @@ #ifndef PPL_Swapping_Vector_inlines_hh #define PPL_Swapping_Vector_inlines_hh 1 +#include "assertions.hh" + namespace Parma_Polyhedra_Library { template @@ -67,8 +69,9 @@ using std::swap; // Steal the old elements. - for (dimension_type i = impl.size(); i-- > 0; ) + for (dimension_type i = impl.size(); i-- > 0; ) { swap(new_impl[i], impl[i]); + } // Put the new vector into place. swap(impl, new_impl); @@ -156,8 +159,9 @@ Swapping_Vector::external_memory_in_bytes() const { // Estimate the size of vector. memory_size_type n = impl.capacity() * sizeof(T); - for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) + for (const_iterator i = begin(), i_end = end(); i != i_end; ++i) { n += i->external_memory_in_bytes(); + } return n; } @@ -193,8 +197,9 @@ const dimension_type old_i = itr - begin(); dimension_type i = old_i; ++i; - while (i != size()) + while (i != size()) { swap(impl[i-1], impl[i]); + } impl.pop_back(); return begin() + old_i; } @@ -210,8 +215,9 @@ const diff_t k = last - first; const dimension_type n = static_cast(end() - last); using std::swap; - for (dimension_type i = 0; i < n; ++i, ++first) + for (dimension_type i = 0; i < n; ++i, ++first) { swap(*first, *(first + k)); + } impl.erase(end() - k, end()); return old_first; } diff -Nru ppl-1.1/src/Swapping_Vector_types.hh ppl-1.2/src/Swapping_Vector_types.hh --- ppl-1.1/src/Swapping_Vector_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Swapping_Vector_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Temp_defs.hh ppl-1.2/src/Temp_defs.hh --- ppl-1.1/src/Temp_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Temp_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Temp_* classes declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -51,8 +51,20 @@ //! Pointer to the next item in the free list. Temp_Item* next; + class Free_List { + public: + Free_List(); + ~Free_List(); + Temp_Item* head_ptr; + private: + Free_List(const Free_List&); // Not implemented. + Free_List& operator=(const Free_List&); // Not implemented. + }; // class Free_List + + friend class Free_List; + //! Head of the free list. - static Temp_Item* free_list_head; + static Temp_Item*& free_list_ref(); //! Default constructor. Temp_Item(); diff -Nru ppl-1.1/src/Temp_inlines.hh ppl-1.2/src/Temp_inlines.hh --- ppl-1.1/src/Temp_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Temp_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Temp_* classes implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -41,22 +41,36 @@ } template +inline +Temp_Item::Free_List::Free_List() + : head_ptr(0) { +} + +template +inline Temp_Item*& +Temp_Item::free_list_ref() { + static Free_List free_list; + return free_list.head_ptr; +} + +template inline Temp_Item& Temp_Item::obtain() { - if (free_list_head != 0) { - Temp_Item* const p = free_list_head; - free_list_head = free_list_head->next; + Temp_Item* const p = free_list_ref(); + if (p != 0) { + free_list_ref() = p->next; return *p; } - else + else { return *new Temp_Item(); + } } template inline void Temp_Item::release(Temp_Item& p) { - p.next = free_list_head; - free_list_head = &p; + p.next = free_list_ref(); + free_list_ref() = &p; } template diff -Nru ppl-1.1/src/Temp_templates.hh ppl-1.2/src/Temp_templates.hh --- ppl-1.1/src/Temp_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Temp_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Temp_* classes implementation: non-inline template members. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -27,7 +27,13 @@ namespace Parma_Polyhedra_Library { template -Temp_Item* Temp_Item::free_list_head = 0; +Temp_Item::Free_List::~Free_List() { + while (head_ptr != 0) { + Temp_Item* const p = head_ptr; + head_ptr = head_ptr->next; + delete p; + } +} } // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/src/termination.cc ppl-1.2/src/termination.cc --- ppl-1.1/src/termination.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/termination.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Utilities for termination analysis: non-inline, non-template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -51,14 +51,16 @@ const Linear_Expression expr(c.expression()); cs_out.insert(expr >= 0); } - else + else { // Insert as is. cs_out.insert(c); + } } } - else + else { // No strict inequality and no equality constraints. cs_out = cs_in; + } } template <> @@ -77,14 +79,16 @@ cs.insert(expr >= 0); cs.insert(expr <= 0); } - else + else { // Insert as is. cs.insert(c); + } } } - else + else { // No equality constraints (and no strict inequalities). cs = ph_cs; + } } /*! \brief @@ -353,8 +357,9 @@ const dimension_type m = r + s; // Make sure linear expressions are not reallocated multiple times. - if (m > 0) + if (m > 0) { le_out.set_space_dimension(m + r); + } std::vector les_eq(2*n, le_out); dimension_type row_index = 0; @@ -376,9 +381,10 @@ add_mul_assign(les_eq[v.id() + n], A_ij_B, u2_i); } Coefficient_traits::const_reference b_B = e_i.inhomogeneous_term(); - if (b_B != 0) + if (b_B != 0) { // u2 b_B, in the context of the strict inequality constraint. add_mul_assign(le_out, b_B, u2_i); + } } row_index = 0; @@ -405,17 +411,20 @@ add_mul_assign(les_eq[j.variable().id() + n], Ap_ij_C, u3_i); } Coefficient_traits::const_reference b_C = e_i.inhomogeneous_term(); - if (b_C != 0) + if (b_C != 0) { // u3 b_C, in the context of the strict inequality constraint. add_mul_assign(le_out, b_C, u3_i); + } } // Add the nonnegativity constraints for u_1, u_2 and u_3. - for (dimension_type i = s + 2*r; i-- > 0; ) + for (dimension_type i = s + 2*r; i-- > 0; ) { cs_out.insert(Variable(i) >= 0); + } - for (dimension_type j = 2*n; j-- > 0; ) + for (dimension_type j = 2*n; j-- > 0; ) { cs_out.insert(les_eq[j] == 0); + } } void @@ -427,8 +436,9 @@ const dimension_type m = num_constraints(cs); // Make sure linear expressions are not reallocated multiple times. - if (m > 0) + if (m > 0) { le_out.set_space_dimension(2*m); + } std::vector les_eq(3*n, le_out); dimension_type row_index = 0; @@ -458,17 +468,20 @@ add_mul_assign(les_eq[v.id()+n], A_ij, lambda2_i); } Coefficient_traits::const_reference b = e_i.inhomogeneous_term(); - if (b != 0) + if (b != 0) { // lambda2 b add_mul_assign(le_out, b, lambda2_i); + } } // Add the non-negativity constraints for lambda_1 and lambda_2. - for (dimension_type i = 2*m; i-- > 0; ) + for (dimension_type i = 2*m; i-- > 0; ) { cs_out.insert(Variable(i) >= 0); + } - for (dimension_type j = 3*n; j-- > 0; ) + for (dimension_type j = 3*n; j-- > 0; ) { cs_out.insert(les_eq[j] == 0); + } } bool @@ -486,9 +499,9 @@ fill_constraint_systems_MS(cs, cs_mip, cs_mip); const MIP_Problem mip = MIP_Problem(cs_mip.space_dimension(), cs_mip); - if (!mip.is_satisfiable()) + if (!mip.is_satisfiable()) { return false; - + } const Generator fp = mip.feasible_point(); PPL_ASSERT(fp.is_point()); const dimension_type n = cs.space_dimension() / 2; @@ -688,8 +701,9 @@ cs_mip.insert(le_ineq <= -1); const MIP_Problem mip(cs_mip.space_dimension(), cs_mip); - if (!mip.is_satisfiable()) + if (!mip.is_satisfiable()) { return false; + } const Generator& fp = mip.feasible_point(); PPL_ASSERT(fp.is_point()); @@ -707,8 +721,9 @@ ++i, ++row_index) { Coefficient_traits::const_reference fp_i = fp.coefficient(Variable(row_index)); - if (fp_i != 0) + if (fp_i != 0) { le.linear_combine(i->expr, 1, -fp_i, 1, n + 1); + } } // Note that we can neglect the divisor of `fp' since it is positive. mu = point(le); @@ -740,9 +755,9 @@ cs_mip.insert(le_ineq <= -1); const MIP_Problem mip = MIP_Problem(cs_mip.space_dimension(), cs_mip); - if (!mip.is_satisfiable()) + if (!mip.is_satisfiable()) { return false; - + } const Generator& fp = mip.feasible_point(); PPL_ASSERT(fp.is_point()); // mu_0 is zero: properly set space dimension. @@ -755,8 +770,9 @@ cs_end = cs.end(); i != cs_end; ++i, ++row_index) { const Variable lambda_2(row_index); Coefficient_traits::const_reference fp_i = fp.coefficient(lambda_2); - if (fp_i != 0) + if (fp_i != 0) { le.linear_combine(i->expr, 1, -fp_i, 1, n + 1); + } } // Note that we can neglect the divisor of `fp' since it is positive. mu = point(le); @@ -807,9 +823,10 @@ Generator_System gs_out; Generator_System::const_iterator gs_in_it = gs_in.begin(); Generator_System::const_iterator gs_in_end = gs_in.end(); - if (gs_in_it == gs_in_end) + if (gs_in_it == gs_in_end) { // The system is unsatisfiable. mu_space = NNC_Polyhedron(n + 1, EMPTY); + } else { for ( ; gs_in_it != gs_in_end; ++gs_in_it) { const Generator& g = *gs_in_it; @@ -823,19 +840,22 @@ ++i, ++row_index) { Coefficient_traits::const_reference g_i = g.coefficient(Variable(row_index)); - if (g_i != 0) + if (g_i != 0) { le.linear_combine(i->expr, 1, -g_i, 1, n + 1); + } } // Add to gs_out the transformed generator. switch (g.type()) { case Generator::LINE: - if (!le.all_homogeneous_terms_are_zero()) + if (!le.all_homogeneous_terms_are_zero()) { gs_out.insert(line(le)); + } break; case Generator::RAY: - if (!le.all_homogeneous_terms_are_zero()) + if (!le.all_homogeneous_terms_are_zero()) { gs_out.insert(ray(le)); + } break; case Generator::POINT: gs_out.insert(point(le, g.divisor())); @@ -888,9 +908,10 @@ const Generator_System& gs_in = ph.generators(); Generator_System::const_iterator gs_in_it = gs_in.begin(); Generator_System::const_iterator gs_in_end = gs_in.end(); - if (gs_in_it == gs_in_end) + if (gs_in_it == gs_in_end) { // The system is unsatisfiable. mu_space = NNC_Polyhedron(n + 1, EMPTY); + } else { Generator_System gs_out; for ( ; gs_in_it != gs_in_end; ++gs_in_it) { @@ -903,19 +924,22 @@ cs_end = cs.end(); i != cs_end; ++i, ++row_index) { const Variable lambda2_i(row_index); Coefficient_traits::const_reference g_i = g.coefficient(lambda2_i); - if (g_i != 0) + if (g_i != 0) { le.linear_combine(i->expr, 1, -g_i, 1, n + 1); + } } // Add to gs_out the transformed generator. switch (g.type()) { case Generator::LINE: - if (!le.all_homogeneous_terms_are_zero()) + if (!le.all_homogeneous_terms_are_zero()) { gs_out.insert(line(le)); + } break; case Generator::RAY: - if (!le.all_homogeneous_terms_are_zero()) + if (!le.all_homogeneous_terms_are_zero()) { gs_out.insert(ray(le)); + } break; case Generator::POINT: gs_out.insert(point(le, g.divisor())); diff -Nru ppl-1.1/src/termination_defs.hh ppl-1.2/src/termination_defs.hh --- ppl-1.1/src/termination_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/termination_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Utilities for termination analysis: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/termination_templates.hh ppl-1.2/src/termination_templates.hh --- ppl-1.1/src/termination_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/termination_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Utilities for termination analysis: template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -69,46 +69,62 @@ dimension_type id = v.id(); switch (output_function_MS_which) { case 0: - if (id < output_function_MS_n) + if (id < output_function_MS_n) { s << "x'" << id + 1; - else if (id < 2*output_function_MS_n) + } + else if (id < 2*output_function_MS_n) { s << "x" << id - output_function_MS_n + 1; - else + } + else { s << "WHAT?"; + } break; case 1: - if (id < output_function_MS_n) + if (id < output_function_MS_n) { s << "mu" << id + 1; - else if (id == output_function_MS_n) + } + else if (id == output_function_MS_n) { s << "WHAT?"; - else if (id <= output_function_MS_n + output_function_MS_m) + } + else if (id <= output_function_MS_n + output_function_MS_m) { s << "y" << id - output_function_MS_n; - else + } + else { s << "WHAT?"; + } break; case 2: case 4: - if (id < output_function_MS_n) + if (id < output_function_MS_n) { s << "mu" << id + 1; - else if (id == output_function_MS_n) + } + else if (id == output_function_MS_n) { s << "mu0"; + } else if (output_function_MS_which == 2 - && id <= output_function_MS_n + output_function_MS_m + 2) + && id <= output_function_MS_n + output_function_MS_m + 2) { s << "z" << id - output_function_MS_n; - else + } + else { s << "WHAT?"; + } break; case 3: - if (id < output_function_MS_n) + if (id < output_function_MS_n) { s << "mu" << id + 1; - else if (id == output_function_MS_n) + } + else if (id == output_function_MS_n) { s << "mu0"; - else if (id <= output_function_MS_n + output_function_MS_m) + } + else if (id <= output_function_MS_n + output_function_MS_m) { s << "y" << id - output_function_MS_n; - else if (id <= output_function_MS_n + 2*output_function_MS_m + 2) + } + else if (id <= output_function_MS_n + 2*output_function_MS_m + 2) { s << "z" << id - (output_function_MS_n + output_function_MS_m); - else + } + else { s << "WHAT?"; + } break; default: abort(); @@ -126,14 +142,18 @@ inline void output_function_PR(std::ostream& s, const Variable v) { dimension_type id = v.id(); - if (id < output_function_PR_s) + if (id < output_function_PR_s) { s << "u3_" << id + 1; - else if (id < output_function_PR_s + output_function_PR_r) + } + else if (id < output_function_PR_s + output_function_PR_r) { s << "u2_" << id - output_function_PR_s + 1; - else if (id < output_function_PR_s + 2*output_function_PR_r) + } + else if (id < output_function_PR_s + 2*output_function_PR_r) { s << "u1_" << id - (output_function_PR_s + output_function_PR_r) + 1; - else + } + else { s << "WHAT?"; + } } #endif @@ -212,8 +232,9 @@ ::assign_all_inequalities_approximation(pset_after, cs_after); // FIXME: provide an "append" for constraint systems. for (Constraint_System::const_iterator i = cs_after.begin(), - cs_after_end = cs_after.end(); i != cs_after_end; ++i) + cs_after_end = cs_after.end(); i != cs_after_end; ++i) { cs.insert(*i); + } } template diff -Nru ppl-1.1/src/termination_types.hh ppl-1.2/src/termination_types.hh --- ppl-1.1/src/termination_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/termination_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Threshold_Watcher.cc ppl-1.2/src/Threshold_Watcher.cc --- ppl-1.1/src/Threshold_Watcher.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Threshold_Watcher.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Threshold_Watcher and associated classes' implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Threshold_Watcher_defs.hh ppl-1.2/src/Threshold_Watcher_defs.hh --- ppl-1.1/src/Threshold_Watcher_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Threshold_Watcher_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Threshold_Watcher and associated classes' declaration and inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Threshold_Watcher_inlines.hh ppl-1.2/src/Threshold_Watcher_inlines.hh --- ppl-1.1/src/Threshold_Watcher_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Threshold_Watcher_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Threshold_Watcher and associated classes' implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,9 +24,8 @@ #ifndef PPL_Threshold_Watcher_inlines_hh #define PPL_Threshold_Watcher_inlines_hh 1 -#include - #include "Handler_defs.hh" +#include namespace Parma_Polyhedra_Library { @@ -42,22 +41,25 @@ flag)) { typename Traits::Threshold threshold; Traits::from_delta(threshold, delta); - if (!Traits::less_than(Traits::get(), threshold)) + if (!Traits::less_than(Traits::get(), threshold)) { throw std::invalid_argument("Threshold_Watcher constructor called with a" " threshold already reached"); + } pending_position = add_threshold(threshold, handler, expired); } template inline -Threshold_Watcher::Threshold_Watcher(const typename Traits::Delta& delta, void (*function)()) +Threshold_Watcher +::Threshold_Watcher(const typename Traits::Delta& delta, void (*function)()) : expired(false), handler(*new Implementation::Watchdog::Handler_Function(function)) { typename Traits::Threshold threshold; Traits::from_delta(threshold, delta); - if (!Traits::less_than(Traits::get(), threshold)) + if (!Traits::less_than(Traits::get(), threshold)) { throw std::invalid_argument("Threshold_Watcher constructor called with a" " threshold already reached"); + } pending_position = add_threshold(threshold, handler, expired); } diff -Nru ppl-1.1/src/Threshold_Watcher_templates.hh ppl-1.2/src/Threshold_Watcher_templates.hh --- ppl-1.1/src/Threshold_Watcher_templates.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Threshold_Watcher_templates.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Threshold_Watcher and associated classes'. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -40,15 +40,17 @@ Threshold_Watcher ::remove_threshold(typename TW_Pending_List::iterator position) { typename TW_Pending_List::iterator i = init.pending.erase(position); - if (init.pending.empty()) + if (init.pending.empty()) { Traits::check_function = 0; + } return i; } template Threshold_Watcher::~Threshold_Watcher() { - if (!expired) + if (!expired) { remove_threshold(pending_position); + } delete &handler; } @@ -62,8 +64,9 @@ i->handler().act(); i->expired_flag() = true; i = remove_threshold(i); - if (i == init.pending.end()) + if (i == init.pending.end()) { break; + } } } diff -Nru ppl-1.1/src/Threshold_Watcher_types.hh ppl-1.2/src/Threshold_Watcher_types.hh --- ppl-1.1/src/Threshold_Watcher_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Threshold_Watcher_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Time.cc ppl-1.2/src/Time.cc --- ppl-1.1/src/Time.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Time.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Time class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Time_defs.hh ppl-1.2/src/Time_defs.hh --- ppl-1.1/src/Time_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Time_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Time class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Time_inlines.hh ppl-1.2/src/Time_inlines.hh --- ppl-1.1/src/Time_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Time_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Time class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Time_types.hh ppl-1.2/src/Time_types.hh --- ppl-1.1/src/Time_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Time_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Topology_types.hh ppl-1.2/src/Topology_types.hh --- ppl-1.1/src/Topology_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Topology_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Variable.cc ppl-1.2/src/Variable.cc --- ppl-1.1/src/Variable.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variable.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Variable class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -41,8 +41,9 @@ static const char var_name_letters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const dimension_type num_letters = sizeof(var_name_letters) - 1; s << var_name_letters[varid % num_letters]; - if (const dimension_type i = varid / num_letters) + if (const dimension_type i = varid / num_letters) { s << i; + } } /*! \relates Parma_Polyhedra_Library::Variable */ diff -Nru ppl-1.1/src/Variable_defs.hh ppl-1.2/src/Variable_defs.hh --- ppl-1.1/src/Variable_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variable_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Variable class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Variable_Floating_Point_Expression_defs.hh ppl-1.2/src/Variable_Floating_Point_Expression_defs.hh --- ppl-1.1/src/Variable_Floating_Point_Expression_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variable_Floating_Point_Expression_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declarations for the Variable_Floating_Point_Expression class and its constituents. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Variable_Floating_Point_Expression_inlines.hh ppl-1.2/src/Variable_Floating_Point_Expression_inlines.hh --- ppl-1.1/src/Variable_Floating_Point_Expression_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variable_Floating_Point_Expression_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Variable_Floating_Point_Expression class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -72,10 +72,12 @@ FP_Linear_Form_Abstract_Store& lf_store) const { for (typename FP_Linear_Form_Abstract_Store::iterator i = lf_store.begin(); i != lf_store.end(); ) { - if ((i->second).coefficient(Variable(variable_index)) != 0) + if ((i->second).coefficient(Variable(variable_index)) != 0) { i = lf_store.erase(i); - else + } + else { ++i; + } } lf_store[variable_index] = lf; return; diff -Nru ppl-1.1/src/Variable_Floating_Point_Expression_types.hh ppl-1.2/src/Variable_Floating_Point_Expression_types.hh --- ppl-1.1/src/Variable_Floating_Point_Expression_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variable_Floating_Point_Expression_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Variable_inlines.hh ppl-1.2/src/Variable_inlines.hh --- ppl-1.1/src/Variable_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variable_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Variable class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Variables_Set.cc ppl-1.2/src/Variables_Set.cc --- ppl-1.1/src/Variables_Set.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variables_Set.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Variables_Set class implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -29,15 +29,19 @@ PPL::Variables_Set::Variables_Set(const Variable v, const Variable w) : Base() { - for (dimension_type d = v.id(), last = w.id(); d <= last; ++d) + for (dimension_type d = v.id(), last = w.id(); d <= last; ++d) { insert(d); + } } bool PPL::Variables_Set::OK() const { - for (const_iterator i = begin(), set_end = end(); i != set_end; ++i) - if (!Variable(*i).OK()) + for (const_iterator i = begin(), set_end = end(); + i != set_end; ++i) { + if (!Variable(*i).OK()) { return false; + } + } return true; } @@ -49,8 +53,9 @@ vs_end = vs.end(); i != vs_end; ) { s << ' ' << Variable(*i); ++i; - if (i != vs_end) + if (i != vs_end) { s << ','; + } } s << " }"; return s; @@ -61,8 +66,9 @@ const dimension_type variables_set_size = size(); s << "\nvariables( " << variables_set_size << " )\n"; for (Variables_Set::const_iterator i = begin(), - i_end = end(); i != i_end; ++i) + i_end = end(); i != i_end; ++i) { s << *i << " "; + } } PPL_OUTPUT_DEFINITIONS(Variables_Set) @@ -71,21 +77,25 @@ PPL::Variables_Set::ascii_load(std::istream& s) { clear(); std::string str; - if (!(s >> str) || str != "variables(") + if (!(s >> str) || str != "variables(") { return false; + } dimension_type size; - if (!(s >> size)) + if (!(s >> size)) { return false; + } - if (!(s >> str) || str != ")") + if (!(s >> str) || str != ")") { return false; + } for (dimension_type i = 0; i < size; ++i) { dimension_type variable_value; - if (!(s >> variable_value)) + if (!(s >> variable_value)) { return false; + } insert(variable_value); } return true; diff -Nru ppl-1.1/src/Variables_Set_defs.hh ppl-1.2/src/Variables_Set_defs.hh --- ppl-1.1/src/Variables_Set_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variables_Set_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Variables_Set class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Variables_Set_inlines.hh ppl-1.2/src/Variables_Set_inlines.hh --- ppl-1.1/src/Variables_Set_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variables_Set_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Variables_Set class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Variables_Set_types.hh ppl-1.2/src/Variables_Set_types.hh --- ppl-1.1/src/Variables_Set_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variables_Set_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Variable_types.hh ppl-1.2/src/Variable_types.hh --- ppl-1.1/src/Variable_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Variable_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/version.cc ppl-1.2/src/version.cc --- ppl-1.1/src/version.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/version.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Definition of functions providing version and licensing information. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -31,9 +31,9 @@ const char version_string[] = PPL_PACKAGE_VERSION; const char banner_string[] = -"This is "PPL_PACKAGE_NAME" (PPL) version "PPL_PACKAGE_VERSION".\n" +"This is " PPL_PACKAGE_NAME " (PPL) version " PPL_PACKAGE_VERSION ".\n" "Copyright (C) 2001-2010 Roberto Bagnara \n" -"Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com)\n" +"Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)\n" "\n" "The PPL is free software; see the source for copying conditions.\n" "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n" @@ -48,12 +48,12 @@ #define xstr(s) str(s) "Compiled by the Intel C++ compiler version "xstr(__INTEL_COMPILER)".\n" #elif defined(__GNUC__) -"Compiled by the GNU C++ compiler version "__VERSION__".\n" +"Compiled by the GNU C++ compiler version " __VERSION__ ".\n" #else "Compiled by an unknown compiler.\n" #endif "\n" -"Report bugs to "PPL_PACKAGE_BUGREPORT"." +"Report bugs to " PPL_PACKAGE_BUGREPORT "." " For the most up-to-date information\n" "see the Parma Polyhedra Library site: http://bugseng.com/products/ppl/ .\n" "\n" diff -Nru ppl-1.1/src/version.hh.in ppl-1.2/src/version.hh.in --- ppl-1.1/src/version.hh.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/version.hh.in 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Declaration of macros and functions providing version -*- C++ -*- and licensing information. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Watchdog.cc ppl-1.2/src/Watchdog.cc --- ppl-1.1/src/Watchdog.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Watchdog.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Watchdog and associated classes' implementation (non-inline functions). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -91,22 +91,25 @@ void my_getitimer(int which, struct itimerval* value) { - if (getitimer(which, value) != 0) + if (getitimer(which, value) != 0) { throw_syscall_error("getitimer"); + } } void my_setitimer(int which, const struct itimerval* value, struct itimerval* old_value) { - if (setitimer(which, value, old_value) != 0) + if (setitimer(which, value, old_value) != 0) { throw_syscall_error("setitimer"); + } } void my_sigaction(int signum, const struct sigaction* act, struct sigaction* old_action) { - if (sigaction(signum, act, old_action) != 0) + if (sigaction(signum, act, old_action) != 0) { throw_syscall_error("sigaction"); + } } } // namespace @@ -121,8 +124,9 @@ void PPL::Watchdog::set_timer(const Implementation::Watchdog::Time& time) { - if (time.seconds() == 0 && time.microseconds() == 0) + if (time.seconds() == 0 && time.microseconds() == 0) { throw std::runtime_error("PPL internal error"); + } last_time_requested = time; signal_once.it_value.tv_sec = time.seconds(); signal_once.it_value.tv_usec = time.microseconds(); @@ -138,8 +142,9 @@ void PPL::Watchdog::handle_timeout(int) { - if (in_critical_section) + if (in_critical_section) { reschedule(); + } else { time_so_far += last_time_requested; if (!pending.empty()) { @@ -149,13 +154,16 @@ i->expired_flag() = true; i = pending.erase(i); } while (i != pending.end() && i->deadline() <= time_so_far); - if (pending.empty()) + if (pending.empty()) { alarm_clock_running = false; - else + } + else { set_timer((*pending.begin()).deadline() - time_so_far); + } } - else + else { alarm_clock_running = false; + } } } diff -Nru ppl-1.1/src/Watchdog_defs.hh ppl-1.2/src/Watchdog_defs.hh --- ppl-1.1/src/Watchdog_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Watchdog_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Watchdog and associated classes' declaration and inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Watchdog_inlines.hh ppl-1.2/src/Watchdog_inlines.hh --- ppl-1.1/src/Watchdog_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Watchdog_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Watchdog and associated classes' implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -39,9 +39,10 @@ handler(*new Implementation::Watchdog::Handler_Flag(holder, flag)) { - if (csecs == 0) + if (csecs == 0) { throw std::invalid_argument("Watchdog constructor called with a" " non-positive number of centiseconds"); + } in_critical_section = true; pending_position = new_watchdog_event(csecs, handler, expired); in_critical_section = false; @@ -51,9 +52,10 @@ Watchdog::Watchdog(long csecs, void (* const function)()) : expired(false), handler(*new Implementation::Watchdog::Handler_Function(function)) { - if (csecs == 0) + if (csecs == 0) { throw std::invalid_argument("Watchdog constructor called with a" " non-positive number of centiseconds"); + } in_critical_section = true; pending_position = new_watchdog_event(csecs, handler, expired); in_critical_section = false; diff -Nru ppl-1.1/src/Watchdog_types.hh ppl-1.2/src/Watchdog_types.hh --- ppl-1.1/src/Watchdog_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Watchdog_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/Weight_Profiler.cc ppl-1.2/src/Weight_Profiler.cc --- ppl-1.1/src/Weight_Profiler.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Weight_Profiler.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Weight_Profiler class implementation. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -33,8 +33,9 @@ void Weight_Profiler::output_stats() { std::cout << file << ":" << line << ": Weight_Profiler "; - if (stat[VALID].samples == 0 && stat[DISCARDED].samples == 0) + if (stat[VALID].samples == 0 && stat[DISCARDED].samples == 0) { std::cout << "never reached."; + } else { if (stat[VALID].samples > 0) { double average @@ -67,8 +68,9 @@ begin(); adjustment = 0; static Weight_Profiler weight_profiler(__FILE__, __LINE__, 0, 0, 0); - for (int i = 0; i < 1000; ++i) + for (int i = 0; i < 1000; ++i) { weight_profiler.end(1); + } return weight_profiler.stat[VALID].min; } diff -Nru ppl-1.1/src/Weight_Profiler_defs.hh ppl-1.2/src/Weight_Profiler_defs.hh --- ppl-1.1/src/Weight_Profiler_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Weight_Profiler_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Weight_Profiler class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -84,12 +84,15 @@ ? DISCARDED : VALID; ++stat[i].samples; - if (stat[i].count == 0) + if (stat[i].count == 0) { stat[i].min = stat[i].max = elapsed1; - else if (stat[i].min > elapsed1) + } + else if (stat[i].min > elapsed1) { stat[i].min = elapsed1; - else if (stat[i].max < elapsed1) + } + else if (stat[i].max < elapsed1) { stat[i].max = elapsed1; + } stat[i].sum += elapsed; stat[i].squares_sum += elapsed * elapsed1; stat[i].count += factor; diff -Nru ppl-1.1/src/Widening_Function_defs.hh ppl-1.2/src/Widening_Function_defs.hh --- ppl-1.1/src/Widening_Function_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Widening_Function_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Widening_Function class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/Widening_Function_inlines.hh ppl-1.2/src/Widening_Function_inlines.hh --- ppl-1.1/src/Widening_Function_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Widening_Function_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Widening_Function class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -24,7 +24,7 @@ #ifndef PPL_Widening_Function_inlines_hh #define PPL_Widening_Function_inlines_hh 1 -#include "assert.hh" +#include "assertions.hh" namespace Parma_Polyhedra_Library { diff -Nru ppl-1.1/src/Widening_Function_types.hh ppl-1.2/src/Widening_Function_types.hh --- ppl-1.1/src/Widening_Function_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/Widening_Function_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/src/wrap_assign.hh ppl-1.2/src/wrap_assign.hh --- ppl-1.1/src/wrap_assign.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/wrap_assign.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Generic implementation of the wrap_assign() function. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,7 +28,7 @@ #include "Coefficient_defs.hh" #include "Variable_defs.hh" #include "Constraint_System_defs.hh" -#include "assert.hh" +#include "assertions.hh" namespace Parma_Polyhedra_Library { @@ -79,14 +79,17 @@ // Refine `p' with all the constraints in `cs' not depending // on variables in `vars'. - if (vars.empty()) + if (vars.empty()) { p.refine_with_constraints(cs); + } else { for (Constraint_System::const_iterator j = cs.begin(), - cs_end = cs.end(); j != cs_end; ++j) - if (j->expression().all_zeroes(vars)) + cs_end = cs.end(); j != cs_end; ++j) { + if (j->expression().all_zeroes(vars)) { // `*j' does not depend on variables in `vars'. p.refine_with_constraint(*j); + } + } } p.refine_with_constraint(min_value <= x); p.refine_with_constraint(x <= max_value); @@ -110,8 +113,9 @@ Coefficient& tmp) { if (first == end) { PSET p(src); - if (cs_p != 0) + if (cs_p != 0) { p.refine_with_constraints(*cs_p); + } for (Variables_Set::const_iterator i = vars.begin(), vars_end = vars.end(); i != vars_end; ++i) { const Variable x(*i); @@ -135,9 +139,10 @@ wrap_assign_col(dest, p, vars, first+1, end, w, min_value, max_value, cs_p, tmp); } - else + else { wrap_assign_col(dest, src, vars, first+1, end, w, min_value, max_value, cs_p, tmp); + } } } } @@ -187,8 +192,9 @@ // Wrapping no variable only requires refining with *cs_p, if any. if (vars.empty()) { - if (cs_p != 0) + if (cs_p != 0) { pointset.refine_with_constraints(*cs_p); + } return; } @@ -203,9 +209,9 @@ } // Wrapping an empty polyhedron is a no-op. - if (pointset.is_empty()) + if (pointset.is_empty()) { return; - + } // Set `min_value' and `max_value' to the minimum and maximum values // a variable of width `w' and signedness `s' can take. PPL_DIRTY_TEMP_COEFFICIENT(min_value); @@ -270,8 +276,9 @@ continue; } - if (!pointset.maximize(x, u_n, u_d, extremum)) + if (!pointset.maximize(x, u_n, u_d, extremum)) { goto set_full_range; + } div_assign_r(l_n, l_n, l_d, ROUND_DOWN); div_assign_r(u_n, u_n, u_d, ROUND_DOWN); @@ -283,35 +290,41 @@ const Coefficient& last_quadrant = u_n; // Special case: this variable does not need wrapping. - if (first_quadrant == 0 && last_quadrant == 0) + if (first_quadrant == 0 && last_quadrant == 0) { continue; + } // If overflow is impossible, try not to add useless constraints. if (o == OVERFLOW_IMPOSSIBLE) { - if (first_quadrant < 0) + if (first_quadrant < 0) { full_range_bounds.insert(min_value <= x); - if (last_quadrant > 0) + } + if (last_quadrant > 0) { full_range_bounds.insert(x <= max_value); + } continue; } - if (o == OVERFLOW_UNDEFINED || collective_wrap_too_complex) + if (o == OVERFLOW_UNDEFINED || collective_wrap_too_complex) { goto set_full_range; + } Coefficient& quadrants = u_d; quadrants = last_quadrant - first_quadrant + 1; PPL_UNINITIALIZED(unsigned, extension); Result res = assign_r(extension, quadrants, ROUND_IGNORE); - if (result_overflow(res) != 0 || extension > complexity_threshold) + if (result_overflow(res) != 0 || extension > complexity_threshold) { goto set_full_range; + } if (!wrap_individually && !collective_wrap_too_complex) { res = mul_assign_r(collective_wrap_complexity, collective_wrap_complexity, extension, ROUND_IGNORE); if (result_overflow(res) != 0 - || collective_wrap_complexity > complexity_threshold) + || collective_wrap_complexity > complexity_threshold) { collective_wrap_too_complex = true; + } if (collective_wrap_too_complex) { // Set all the dimensions in `translations' to full range. for (Wrap_Translations::const_iterator j = translations.begin(), @@ -368,8 +381,9 @@ } } - if (cs_p != 0) + if (cs_p != 0) { pointset.refine_with_constraints(*cs_p); + } pointset.refine_with_constraints(full_range_bounds); } diff -Nru ppl-1.1/src/wrap_string.cc ppl-1.2/src/wrap_string.cc --- ppl-1.1/src/wrap_string.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/wrap_string.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* String wrapping helper function. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -23,7 +23,7 @@ #include "ppl-config.h" #include "wrap_string.hh" -#include "assert.hh" +#include "assertions.hh" #include namespace Parma_Polyhedra_Library { @@ -51,39 +51,48 @@ split_pos = idx; break; } - if (src[idx] == ',' && idx < line_length) + if (src[idx] == ',' && idx < line_length) { last_comma = idx; - if (is_space(src[idx]) && (idx == 0 || !is_space(src[idx-1]))) + } + if (is_space(src[idx]) && (idx == 0 || !is_space(src[idx-1]))) { last_space = idx; + } } if (split_pos == npos) { - if (last_comma != npos) + if (last_comma != npos) { split_pos = last_comma + 1; - else if (last_space != npos) + } + else if (last_space != npos) { split_pos = last_space; + } else { for ( ; src[idx] != '\0'; ++idx) { if (src[idx] == ',') { ++idx; break; } - if (is_space(src[idx])) + if (is_space(src[idx])) { break; + } } split_pos = idx; } } PPL_ASSERT(split_pos != npos); - if (split_pos > 0 && line > 0 && indent_depth > 0) + if (split_pos > 0 && line > 0 && indent_depth > 0) { dst_string.append(indent_depth, ' '); + } dst_string.append(src, split_pos); src += split_pos; - if (is_space(*src)) + if (is_space(*src)) { ++src; - while (*src == ' ') + } + while (*src == ' ') { ++src; - if (*src == '\0') + } + if (*src == '\0') { break; + } dst_string.push_back('\n'); } return dst_string; diff -Nru ppl-1.1/src/wrap_string.hh ppl-1.2/src/wrap_string.hh --- ppl-1.1/src/wrap_string.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/wrap_string.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Declaration of string wrapping function. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/WRD_coefficient_types_defs.hh ppl-1.2/src/WRD_coefficient_types_defs.hh --- ppl-1.1/src/WRD_coefficient_types_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/WRD_coefficient_types_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Coefficient types of weakly-relational domains: declarations. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/src/WRD_coefficient_types_inlines.hh ppl-1.2/src/WRD_coefficient_types_inlines.hh --- ppl-1.1/src/WRD_coefficient_types_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/src/WRD_coefficient_types_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Coefficient types of weakly-relational domains: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -28,14 +28,16 @@ inline void WRD_Extended_Number_Policy::handle_result(Result r) { - if (result_class(r) == VC_NAN) + if (result_class(r) == VC_NAN) { throw_result_exception(r); + } } inline void Debug_WRD_Extended_Number_Policy::handle_result(Result r) { - if (result_class(r) == VC_NAN) + if (result_class(r) == VC_NAN) { throw_result_exception(r); + } } } // namespace Parma_Polyhedra_Library diff -Nru ppl-1.1/STANDARDS ppl-1.2/STANDARDS --- ppl-1.1/STANDARDS 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/STANDARDS 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) See below for the copying conditions. @@ -708,7 +708,7 @@ -------- Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/test-driver ppl-1.2/test-driver --- ppl-1.1/test-driver 2013-06-22 18:56:52.000000000 +0000 +++ ppl-1.2/test-driver 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2012-06-27.10; # UTC +scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2013 Free Software Foundation, Inc. # @@ -44,13 +44,12 @@ Usage: test-driver --test-name=NAME --log-file=PATH --trs-file=PATH [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT + [--enable-hard-errors={yes|no}] [--] + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] The '--test-name', '--log-file' and '--trs-file' options are mandatory. END } -# TODO: better error handling in option parsing (in particular, ensure -# TODO: $log_file, $trs_file and $test_name are defined). test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. @@ -69,10 +68,23 @@ --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; + *) break;; esac shift done +missing_opts= +test x"$test_name" = x && missing_opts="$missing_opts --test-name" +test x"$log_file" = x && missing_opts="$missing_opts --log-file" +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" +if test x"$missing_opts" != x; then + usage_error "the following mandatory options are missing:$missing_opts" +fi + +if test $# -eq 0; then + usage_error "missing argument" +fi + if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='' # Red. diff -Nru ppl-1.1/tests/BD_Shape/addconstraints1.cc ppl-1.2/tests/BD_Shape/addconstraints1.cc --- ppl-1.1/tests/BD_Shape/addconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/addconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::add_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/addspacedims1.cc ppl-1.2/tests/BD_Shape/addspacedims1.cc --- ppl-1.1/tests/BD_Shape/addspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/addspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test BD_Shape::add_space_dimensions_and_embed(): we add two variables to a BD_Shape. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/affinedimension1.cc ppl-1.2/tests/BD_Shape/affinedimension1.cc --- ppl-1.1/tests/BD_Shape/affinedimension1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/affinedimension1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::affine_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/affineimage1.cc ppl-1.2/tests/BD_Shape/affineimage1.cc --- ppl-1.1/tests/BD_Shape/affineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/affineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/affineimage2.cc ppl-1.2/tests/BD_Shape/affineimage2.cc --- ppl-1.1/tests/BD_Shape/affineimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/affineimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/affinepreimage1.cc ppl-1.2/tests/BD_Shape/affinepreimage1.cc --- ppl-1.1/tests/BD_Shape/affinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/affinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/ascii_dump_load1.cc ppl-1.2/tests/BD_Shape/ascii_dump_load1.cc --- ppl-1.1/tests/BD_Shape/ascii_dump_load1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/ascii_dump_load1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::ascii_dump() and BD_Shape::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/bgp99extrapolation1.cc ppl-1.2/tests/BD_Shape/bgp99extrapolation1.cc --- ppl-1.1/tests/BD_Shape/bgp99extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/bgp99extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::BGP99_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/bhmz05widening1.cc ppl-1.2/tests/BD_Shape/bhmz05widening1.cc --- ppl-1.1/tests/BD_Shape/bhmz05widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/bhmz05widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BHMZ05_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/bhz03widening1.cc ppl-1.2/tests/BD_Shape/bhz03widening1.cc --- ppl-1.1/tests/BD_Shape/bhz03widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/bhz03widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::BHZ03_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/bounded1.cc ppl-1.2/tests/BD_Shape/bounded1.cc --- ppl-1.1/tests/BD_Shape/bounded1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/bounded1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::is_bounded(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/boundedaffineimage1.cc ppl-1.2/tests/BD_Shape/boundedaffineimage1.cc --- ppl-1.1/tests/BD_Shape/boundedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/boundedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::bounded_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/boundedaffinepreimage1.cc ppl-1.2/tests/BD_Shape/boundedaffinepreimage1.cc --- ppl-1.1/tests/BD_Shape/boundedaffinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/boundedaffinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::bounded_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/bounds1.cc ppl-1.2/tests/BD_Shape/bounds1.cc --- ppl-1.1/tests/BD_Shape/bounds1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/bounds1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::bounds_from_below() and BD_Shape::bounds_from_above(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/cc76extrapolation1.cc ppl-1.2/tests/BD_Shape/cc76extrapolation1.cc --- ppl-1.1/tests/BD_Shape/cc76extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/cc76extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::CC76_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/cc76narrowing1.cc ppl-1.2/tests/BD_Shape/cc76narrowing1.cc --- ppl-1.1/tests/BD_Shape/cc76narrowing1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/cc76narrowing1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::CC76_narrowing_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/closure1.cc ppl-1.2/tests/BD_Shape/closure1.cc --- ppl-1.1/tests/BD_Shape/closure1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/closure1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test shortest path closure. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/concatenate1.cc ppl-1.2/tests/BD_Shape/concatenate1.cc --- ppl-1.1/tests/BD_Shape/concatenate1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/concatenate1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::concatenate_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/congruences1.cc ppl-1.2/tests/BD_Shape/congruences1.cc --- ppl-1.1/tests/BD_Shape/congruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/congruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/constrains1.cc ppl-1.2/tests/BD_Shape/constrains1.cc --- ppl-1.1/tests/BD_Shape/constrains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/constrains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::constrains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/constraints1.cc ppl-1.2/tests/BD_Shape/constraints1.cc --- ppl-1.1/tests/BD_Shape/constraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/constraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/contains1.cc ppl-1.2/tests/BD_Shape/contains1.cc --- ppl-1.1/tests/BD_Shape/contains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/contains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::contains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/containsintegerpoint1.cc ppl-1.2/tests/BD_Shape/containsintegerpoint1.cc --- ppl-1.1/tests/BD_Shape/containsintegerpoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/containsintegerpoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::contains_integer_point(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/difference1.cc ppl-1.2/tests/BD_Shape/difference1.cc --- ppl-1.1/tests/BD_Shape/difference1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/difference1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::difference_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/discrete1.cc ppl-1.2/tests/BD_Shape/discrete1.cc --- ppl-1.1/tests/BD_Shape/discrete1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/discrete1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::is_discrete(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/disjoint1.cc ppl-1.2/tests/BD_Shape/disjoint1.cc --- ppl-1.1/tests/BD_Shape/disjoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/disjoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::is_disjoint_from(const BD_Shape& y). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/dropsomenonintegerpoints1.cc ppl-1.2/tests/BD_Shape/dropsomenonintegerpoints1.cc --- ppl-1.1/tests/BD_Shape/dropsomenonintegerpoints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/dropsomenonintegerpoints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::drop_some_non_integer_points(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/empty1.cc ppl-1.2/tests/BD_Shape/empty1.cc --- ppl-1.1/tests/BD_Shape/empty1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/empty1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Different ways of creating an empty BD_Shape. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/equality1.cc ppl-1.2/tests/BD_Shape/equality1.cc --- ppl-1.1/tests/BD_Shape/equality1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/equality1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::operator==(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/expandspacedim1.cc ppl-1.2/tests/BD_Shape/expandspacedim1.cc --- ppl-1.1/tests/BD_Shape/expandspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/expandspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::expand_space_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/foldspacedims1.cc ppl-1.2/tests/BD_Shape/foldspacedims1.cc --- ppl-1.1/tests/BD_Shape/foldspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/foldspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::fold_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/frequency1.cc ppl-1.2/tests/BD_Shape/frequency1.cc --- ppl-1.1/tests/BD_Shape/frequency1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/frequency1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::frequency(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/frombdshape1.cc ppl-1.2/tests/BD_Shape/frombdshape1.cc --- ppl-1.1/tests/BD_Shape/frombdshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/frombdshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test BD_Shape copy construct, construction from other BD shapes and assignment. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/frombox1.cc ppl-1.2/tests/BD_Shape/frombox1.cc --- ppl-1.1/tests/BD_Shape/frombox1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/frombox1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BD_Shape(const Box&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/fromgensys1.cc ppl-1.2/tests/BD_Shape/fromgensys1.cc --- ppl-1.1/tests/BD_Shape/fromgensys1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/fromgensys1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BD_Shape(const Generator_System&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/fromgrid1.cc ppl-1.2/tests/BD_Shape/fromgrid1.cc --- ppl-1.1/tests/BD_Shape/fromgrid1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/fromgrid1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test C_Polyhedron::C_Polyhedron(const Grid&) and NNC_Polyhedron::NNC_Polyhedron(const Grid&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/fromoctagonalshape1.cc ppl-1.2/tests/BD_Shape/fromoctagonalshape1.cc --- ppl-1.1/tests/BD_Shape/fromoctagonalshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/fromoctagonalshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BD_Shape(const Octagonal_Shape&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/frompolyhedron1.cc ppl-1.2/tests/BD_Shape/frompolyhedron1.cc --- ppl-1.1/tests/BD_Shape/frompolyhedron1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/frompolyhedron1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BD_Shape(const C_Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/fromspacedim1.cc ppl-1.2/tests/BD_Shape/fromspacedim1.cc --- ppl-1.1/tests/BD_Shape/fromspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/fromspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BD_Shape(dimension_type, Degenerate_Element). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/generalizedaffineimage1.cc ppl-1.2/tests/BD_Shape/generalizedaffineimage1.cc --- ppl-1.1/tests/BD_Shape/generalizedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/generalizedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/generalizedaffineimage2.cc ppl-1.2/tests/BD_Shape/generalizedaffineimage2.cc --- ppl-1.1/tests/BD_Shape/generalizedaffineimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/generalizedaffineimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/generalizedaffinepreimage1.cc ppl-1.2/tests/BD_Shape/generalizedaffinepreimage1.cc --- ppl-1.1/tests/BD_Shape/generalizedaffinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/generalizedaffinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/generalizedaffinepreimage2.cc ppl-1.2/tests/BD_Shape/generalizedaffinepreimage2.cc --- ppl-1.1/tests/BD_Shape/generalizedaffinepreimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/generalizedaffinepreimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/generalizedaffinepreimage3.cc ppl-1.2/tests/BD_Shape/generalizedaffinepreimage3.cc --- ppl-1.1/tests/BD_Shape/generalizedaffinepreimage3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/generalizedaffinepreimage3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/geomcovers1.cc ppl-1.2/tests/BD_Shape/geomcovers1.cc --- ppl-1.1/tests/BD_Shape/geomcovers1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/geomcovers1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::geometrically_covers(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/h79widening1.cc ppl-1.2/tests/BD_Shape/h79widening1.cc --- ppl-1.1/tests/BD_Shape/h79widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/h79widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::H79_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/integerupperboundifexact1.cc ppl-1.2/tests/BD_Shape/integerupperboundifexact1.cc --- ppl-1.1/tests/BD_Shape/integerupperboundifexact1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/integerupperboundifexact1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::integer_upper_bound_assign_if_exact(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/intersection1.cc ppl-1.2/tests/BD_Shape/intersection1.cc --- ppl-1.1/tests/BD_Shape/intersection1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/intersection1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::intersection_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/limitedbhmz05extrapolation1.cc ppl-1.2/tests/BD_Shape/limitedbhmz05extrapolation1.cc --- ppl-1.1/tests/BD_Shape/limitedbhmz05extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/limitedbhmz05extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::limited_BHMZ05_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/limitedcc76extrapolation1.cc ppl-1.2/tests/BD_Shape/limitedcc76extrapolation1.cc --- ppl-1.1/tests/BD_Shape/limitedcc76extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/limitedcc76extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::limited_CC76_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/limitedh79extrapolation1.cc ppl-1.2/tests/BD_Shape/limitedh79extrapolation1.cc --- ppl-1.1/tests/BD_Shape/limitedh79extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/limitedh79extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::limited_H79_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/Makefile.am ppl-1.2/tests/BD_Shape/Makefile.am --- ppl-1.1/tests/BD_Shape/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/BD_Shape/Makefile.in ppl-1.2/tests/BD_Shape/Makefile.in --- ppl-1.1/tests/BD_Shape/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/Makefile.in 2016-02-11 12:31:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -142,6 +142,7 @@ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -161,7 +162,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/BD_Shape/mapspacedims1.cc ppl-1.2/tests/BD_Shape/mapspacedims1.cc --- ppl-1.1/tests/BD_Shape/mapspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/mapspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::map_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/max_min1.cc ppl-1.2/tests/BD_Shape/max_min1.cc --- ppl-1.1/tests/BD_Shape/max_min1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/max_min1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test BD_Shape::maximize(const Linear_Expression&, ...) and BD_Shape::minimize(const Linear_Expression&, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/max_min2.cc ppl-1.2/tests/BD_Shape/max_min2.cc --- ppl-1.1/tests/BD_Shape/max_min2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/max_min2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test BD_Shape::maximize(const Linear_Expression&, ...) and BD_Shape::minimize(const Linear_Expression&, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/maxspacedim1.cc ppl-1.2/tests/BD_Shape/maxspacedim1.cc --- ppl-1.1/tests/BD_Shape/maxspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/maxspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::max_space_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/membytes1.cc ppl-1.2/tests/BD_Shape/membytes1.cc --- ppl-1.1/tests/BD_Shape/membytes1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/membytes1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the total_memory_in_bytes() and external_memory_in_bytes() methods. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/minconstraints1.cc ppl-1.2/tests/BD_Shape/minconstraints1.cc --- ppl-1.1/tests/BD_Shape/minconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/minconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::minimized_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/relations1.cc ppl-1.2/tests/BD_Shape/relations1.cc --- ppl-1.1/tests/BD_Shape/relations1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/relations1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/relations2.cc ppl-1.2/tests/BD_Shape/relations2.cc --- ppl-1.1/tests/BD_Shape/relations2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/relations2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/relations3.cc ppl-1.2/tests/BD_Shape/relations3.cc --- ppl-1.1/tests/BD_Shape/relations3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/relations3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/relations4.cc ppl-1.2/tests/BD_Shape/relations4.cc --- ppl-1.1/tests/BD_Shape/relations4.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/relations4.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/removespacedims1.cc ppl-1.2/tests/BD_Shape/removespacedims1.cc --- ppl-1.1/tests/BD_Shape/removespacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/removespacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Remove some variables from the space. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/run_tests ppl-1.2/tests/BD_Shape/run_tests --- ppl-1.1/tests/BD_Shape/run_tests 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/run_tests 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ # Run the BD_Shape tests. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/BD_Shape/simplifyusingcontext1.cc ppl-1.2/tests/BD_Shape/simplifyusingcontext1.cc --- ppl-1.1/tests/BD_Shape/simplifyusingcontext1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/simplifyusingcontext1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::simplify_using_context_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/timeelapse1.cc ppl-1.2/tests/BD_Shape/timeelapse1.cc --- ppl-1.1/tests/BD_Shape/timeelapse1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/timeelapse1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test time_elapse_assign() for particular polyhedra. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/unconstrain1.cc ppl-1.2/tests/BD_Shape/unconstrain1.cc --- ppl-1.1/tests/BD_Shape/unconstrain1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/unconstrain1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::unconstrain(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/universe1.cc ppl-1.2/tests/BD_Shape/universe1.cc --- ppl-1.1/tests/BD_Shape/universe1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/universe1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::is_universe(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/upperbound1.cc ppl-1.2/tests/BD_Shape/upperbound1.cc --- ppl-1.1/tests/BD_Shape/upperbound1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/upperbound1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::upper_bound_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/upperboundifexact1.cc ppl-1.2/tests/BD_Shape/upperboundifexact1.cc --- ppl-1.1/tests/BD_Shape/upperboundifexact1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/upperboundifexact1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::upper_bound_assign_if_exact(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/wrap1.cc ppl-1.2/tests/BD_Shape/wrap1.cc --- ppl-1.1/tests/BD_Shape/wrap1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/wrap1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::wrap_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/BD_Shape/writebdshape1.cc ppl-1.2/tests/BD_Shape/writebdshape1.cc --- ppl-1.1/tests/BD_Shape/writebdshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/BD_Shape/writebdshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test operator<<(ostream&, const BD_Shape&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/addconstraints1.cc ppl-1.2/tests/Box/addconstraints1.cc --- ppl-1.1/tests/Box/addconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/addconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::add_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/addspacedims1.cc ppl-1.2/tests/Box/addspacedims1.cc --- ppl-1.1/tests/Box/addspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/addspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Box::add_space_dimensions_and_embed(): we add two variables to a Box. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/affinedimension1.cc ppl-1.2/tests/Box/affinedimension1.cc --- ppl-1.1/tests/Box/affinedimension1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/affinedimension1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::affine_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/affineimage1.cc ppl-1.2/tests/Box/affineimage1.cc --- ppl-1.1/tests/Box/affineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/affineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/affinepreimage1.cc ppl-1.2/tests/Box/affinepreimage1.cc --- ppl-1.1/tests/Box/affinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/affinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/ascii_dump_load1.cc ppl-1.2/tests/Box/ascii_dump_load1.cc --- ppl-1.1/tests/Box/ascii_dump_load1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/ascii_dump_load1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::ascii_dump() and Box::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/bgp99extrapolation1.cc ppl-1.2/tests/Box/bgp99extrapolation1.cc --- ppl-1.1/tests/Box/bgp99extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/bgp99extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::BGP99_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/bhz03widening1.cc ppl-1.2/tests/Box/bhz03widening1.cc --- ppl-1.1/tests/Box/bhz03widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/bhz03widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::BHZ03_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/bounded1.cc ppl-1.2/tests/Box/bounded1.cc --- ppl-1.1/tests/Box/bounded1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/bounded1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::is_bounded(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/boundedaffineimage1.cc ppl-1.2/tests/Box/boundedaffineimage1.cc --- ppl-1.1/tests/Box/boundedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/boundedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::bounded_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/boundedaffinepreimage1.cc ppl-1.2/tests/Box/boundedaffinepreimage1.cc --- ppl-1.1/tests/Box/boundedaffinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/boundedaffinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::bounded_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/cc76narrowing1.cc ppl-1.2/tests/Box/cc76narrowing1.cc --- ppl-1.1/tests/Box/cc76narrowing1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/cc76narrowing1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::CC76_narrowing_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/cc76widening.cc ppl-1.2/tests/Box/cc76widening.cc --- ppl-1.1/tests/Box/cc76widening.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/cc76widening.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::CC76_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/concatenate1.cc ppl-1.2/tests/Box/concatenate1.cc --- ppl-1.1/tests/Box/concatenate1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/concatenate1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::concatenate_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/congruences1.cc ppl-1.2/tests/Box/congruences1.cc --- ppl-1.1/tests/Box/congruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/congruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::Box(const Congruence_System&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/constrains1.cc ppl-1.2/tests/Box/constrains1.cc --- ppl-1.1/tests/Box/constrains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/constrains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::constrains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/constraints1.cc ppl-1.2/tests/Box/constraints1.cc --- ppl-1.1/tests/Box/constraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/constraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/contains1.cc ppl-1.2/tests/Box/contains1.cc --- ppl-1.1/tests/Box/contains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/contains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::contains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/containsintegerpoint1.cc ppl-1.2/tests/Box/containsintegerpoint1.cc --- ppl-1.1/tests/Box/containsintegerpoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/containsintegerpoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::contains_integer_point(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/difference1.cc ppl-1.2/tests/Box/difference1.cc --- ppl-1.1/tests/Box/difference1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/difference1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::difference_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/discrete1.cc ppl-1.2/tests/Box/discrete1.cc --- ppl-1.1/tests/Box/discrete1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/discrete1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::is_discrete(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/disjoint1.cc ppl-1.2/tests/Box/disjoint1.cc --- ppl-1.1/tests/Box/disjoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/disjoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::is_disjoint_from(const Box& y). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/empty1.cc ppl-1.2/tests/Box/empty1.cc --- ppl-1.1/tests/Box/empty1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/empty1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Different ways of creating an empty Box. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/equality1.cc ppl-1.2/tests/Box/equality1.cc --- ppl-1.1/tests/Box/equality1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/equality1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::operator==(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/expandspacedim1.cc ppl-1.2/tests/Box/expandspacedim1.cc --- ppl-1.1/tests/Box/expandspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/expandspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::expand_space_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/foldspacedims1.cc ppl-1.2/tests/Box/foldspacedims1.cc --- ppl-1.1/tests/Box/foldspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/foldspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::fold_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/frequency1.cc ppl-1.2/tests/Box/frequency1.cc --- ppl-1.1/tests/Box/frequency1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/frequency1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::frequency(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/frombdshape1.cc ppl-1.2/tests/Box/frombdshape1.cc --- ppl-1.1/tests/Box/frombdshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/frombdshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::Box(const BD_Shape&, Complexity_Class). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/frombox1.cc ppl-1.2/tests/Box/frombox1.cc --- ppl-1.1/tests/Box/frombox1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/frombox1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::Box(const Box&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/fromgensys1.cc ppl-1.2/tests/Box/fromgensys1.cc --- ppl-1.1/tests/Box/fromgensys1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/fromgensys1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::Box(const Generator_System&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/fromgrid1.cc ppl-1.2/tests/Box/fromgrid1.cc --- ppl-1.1/tests/Box/fromgrid1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/fromgrid1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::Box(const Grid&, Complexity_Class). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/frompartiallyreducedproduct1.cc ppl-1.2/tests/Box/frompartiallyreducedproduct1.cc --- ppl-1.1/tests/Box/frompartiallyreducedproduct1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/frompartiallyreducedproduct1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::Box(const Direct_Product&, Complexity_Class). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/frompolyhedron1.cc ppl-1.2/tests/Box/frompolyhedron1.cc --- ppl-1.1/tests/Box/frompolyhedron1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/frompolyhedron1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::Box(const Polyhedron&, Complexity_Class). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/frompolyhedron2.cc ppl-1.2/tests/Box/frompolyhedron2.cc --- ppl-1.1/tests/Box/frompolyhedron2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/frompolyhedron2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::Box(const NNC_Polyhedron&, Complexity_Class). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/fromspacedim1.cc ppl-1.2/tests/Box/fromspacedim1.cc --- ppl-1.1/tests/Box/fromspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/fromspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::Box(dimension_type, Degenerate_Element). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/generalizedaffineimage1.cc ppl-1.2/tests/Box/generalizedaffineimage1.cc --- ppl-1.1/tests/Box/generalizedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/generalizedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/generalizedaffineimage2.cc ppl-1.2/tests/Box/generalizedaffineimage2.cc --- ppl-1.1/tests/Box/generalizedaffineimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/generalizedaffineimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/generalizedaffinepreimage1.cc ppl-1.2/tests/Box/generalizedaffinepreimage1.cc --- ppl-1.1/tests/Box/generalizedaffinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/generalizedaffinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /*Test Box::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/geomcovers1.cc ppl-1.2/tests/Box/geomcovers1.cc --- ppl-1.1/tests/Box/geomcovers1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/geomcovers1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::geometrically_covers(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/intersection1.cc ppl-1.2/tests/Box/intersection1.cc --- ppl-1.1/tests/Box/intersection1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/intersection1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::intersection_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/interval1.cc ppl-1.2/tests/Box/interval1.cc --- ppl-1.1/tests/Box/interval1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/interval1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Box::add_space_dimensions_and_embed(): we add two variables to a Box. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/limitedcc76extrapolation1.cc ppl-1.2/tests/Box/limitedcc76extrapolation1.cc --- ppl-1.1/tests/Box/limitedcc76extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/limitedcc76extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::limited_CC76_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/Makefile.am ppl-1.2/tests/Box/Makefile.am --- ppl-1.1/tests/Box/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/Box/Makefile.in ppl-1.2/tests/Box/Makefile.in --- ppl-1.1/tests/Box/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/tests/Box/Makefile.in 2016-02-11 12:31:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -108,6 +108,7 @@ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -127,7 +128,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/Box/mapspacedims1.cc ppl-1.2/tests/Box/mapspacedims1.cc --- ppl-1.1/tests/Box/mapspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/mapspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::map_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/max_min1.cc ppl-1.2/tests/Box/max_min1.cc --- ppl-1.1/tests/Box/max_min1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/max_min1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Box::maximize(const Linear_Expression&, ...) and Box::minimize(const Linear_Expression&, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/maxspacedim1.cc ppl-1.2/tests/Box/maxspacedim1.cc --- ppl-1.1/tests/Box/maxspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/maxspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::max_space_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/membytes1.cc ppl-1.2/tests/Box/membytes1.cc --- ppl-1.1/tests/Box/membytes1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/membytes1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the total_memory_in_bytes() and external_memory_in_bytes() methods. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/minconstraints1.cc ppl-1.2/tests/Box/minconstraints1.cc --- ppl-1.1/tests/Box/minconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/minconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::minimized_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/propagateconstraints1.cc ppl-1.2/tests/Box/propagateconstraints1.cc --- ppl-1.1/tests/Box/propagateconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/propagateconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::propagate_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/propagateconstraints2.cc ppl-1.2/tests/Box/propagateconstraints2.cc --- ppl-1.1/tests/Box/propagateconstraints2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/propagateconstraints2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::propagate_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/refinewithcongruence1.cc ppl-1.2/tests/Box/refinewithcongruence1.cc --- ppl-1.1/tests/Box/refinewithcongruence1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/refinewithcongruence1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::refine_with_congruences(const Congruence_System&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/refinewithcongruences1.cc ppl-1.2/tests/Box/refinewithcongruences1.cc --- ppl-1.1/tests/Box/refinewithcongruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/refinewithcongruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::refine_with_congruences(const Congruence_System&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/refinewithconstraint1.cc ppl-1.2/tests/Box/refinewithconstraint1.cc --- ppl-1.1/tests/Box/refinewithconstraint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/refinewithconstraint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::refine_with_constraint(const Constraint&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/refinewithconstraint2.cc ppl-1.2/tests/Box/refinewithconstraint2.cc --- ppl-1.1/tests/Box/refinewithconstraint2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/refinewithconstraint2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::refine_with_constraint(const Constraint&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/refinewithconstraints1.cc ppl-1.2/tests/Box/refinewithconstraints1.cc --- ppl-1.1/tests/Box/refinewithconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/refinewithconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::refine_with_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/refinewithconstraints2.cc ppl-1.2/tests/Box/refinewithconstraints2.cc --- ppl-1.1/tests/Box/refinewithconstraints2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/refinewithconstraints2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Box::refine_with_constraints(const Constraint_System&) with instances that may require a watchdog timer. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/relations1.cc ppl-1.2/tests/Box/relations1.cc --- ppl-1.1/tests/Box/relations1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/relations1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/relations2.cc ppl-1.2/tests/Box/relations2.cc --- ppl-1.1/tests/Box/relations2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/relations2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/relations3.cc ppl-1.2/tests/Box/relations3.cc --- ppl-1.1/tests/Box/relations3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/relations3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/relations4.cc ppl-1.2/tests/Box/relations4.cc --- ppl-1.1/tests/Box/relations4.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/relations4.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/removespacedims1.cc ppl-1.2/tests/Box/removespacedims1.cc --- ppl-1.1/tests/Box/removespacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/removespacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Remove some variables from the space. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/run_tests ppl-1.2/tests/Box/run_tests --- ppl-1.1/tests/Box/run_tests 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/run_tests 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ # Run the Box tests. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/Box/simplifyusingcontext1.cc ppl-1.2/tests/Box/simplifyusingcontext1.cc --- ppl-1.1/tests/Box/simplifyusingcontext1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/simplifyusingcontext1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::simplify_using_context_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/timeelapse1.cc ppl-1.2/tests/Box/timeelapse1.cc --- ppl-1.1/tests/Box/timeelapse1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/timeelapse1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::time_elapse_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/topclosed1.cc ppl-1.2/tests/Box/topclosed1.cc --- ppl-1.1/tests/Box/topclosed1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/topclosed1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::is_topologically_closed(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/unconstrain1.cc ppl-1.2/tests/Box/unconstrain1.cc --- ppl-1.1/tests/Box/unconstrain1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/unconstrain1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::unconstrain(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/universe1.cc ppl-1.2/tests/Box/universe1.cc --- ppl-1.1/tests/Box/universe1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/universe1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::is_universe(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/upperbound1.cc ppl-1.2/tests/Box/upperbound1.cc --- ppl-1.1/tests/Box/upperbound1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/upperbound1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::upper_bound_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/upperboundifexact1.cc ppl-1.2/tests/Box/upperboundifexact1.cc --- ppl-1.1/tests/Box/upperboundifexact1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/upperboundifexact1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::upper_bound_assign_if_exact(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/wrap1.cc ppl-1.2/tests/Box/wrap1.cc --- ppl-1.1/tests/Box/wrap1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/wrap1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Box::wrap_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Box/writebox1.cc ppl-1.2/tests/Box/writebox1.cc --- ppl-1.1/tests/Box/writebox1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Box/writebox1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test operator<<(ostream&, const Box&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/bdshape1.cc ppl-1.2/tests/Concrete_Expression/bdshape1.cc --- ppl-1.1/tests/Concrete_Expression/bdshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/bdshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::affine_form_image on interval linear forms. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/bdshape2.cc ppl-1.2/tests/Concrete_Expression/bdshape2.cc --- ppl-1.1/tests/Concrete_Expression/bdshape2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/bdshape2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::refine_wiht_linear_form_inequaity on interval linear forms. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/C_Expr.cc ppl-1.2/tests/Concrete_Expression/C_Expr.cc --- ppl-1.1/tests/Concrete_Expression/C_Expr.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/C_Expr.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Definitions for the C_Expr class and its subclasses: non-inline, non-template functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/C_Expr_defs.hh ppl-1.2/tests/Concrete_Expression/C_Expr_defs.hh --- ppl-1.1/tests/Concrete_Expression/C_Expr_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/C_Expr_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Declarations for the C_Expr class and its subclasses. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/C_Expr_inlines.hh ppl-1.2/tests/Concrete_Expression/C_Expr_inlines.hh --- ppl-1.1/tests/Concrete_Expression/C_Expr_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/C_Expr_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Definitions for the C_Expr class and its subclasses: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/digitalfilters1.cc ppl-1.2/tests/Concrete_Expression/digitalfilters1.cc --- ppl-1.1/tests/Concrete_Expression/digitalfilters1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/digitalfilters1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Rate Limiter on differents abstract domains. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -545,7 +545,7 @@ tmp.lower() = 0; tmp.upper() = 16; oracle.int_store.affine_form_image(D, FP_Linear_Form(tmp)); - bd.affine_form_image(D, FP_Linear_Form(tmp)); + bd.affine_form_image(D, FP_Linear_Form(tmp)); oracle.int_store.intersection_assign(FP_Interval_Abstract_Store(bd)); // S = Y; @@ -754,7 +754,7 @@ tmp.lower() = 0; tmp.upper() = 16; oracle.int_store.affine_form_image(D, FP_Linear_Form(tmp)); - oc.affine_form_image(D, FP_Linear_Form(tmp)); + oc.affine_form_image(D, FP_Linear_Form(tmp)); oracle.int_store.intersection_assign(FP_Interval_Abstract_Store(oc)); // S = Y; @@ -963,7 +963,7 @@ tmp.lower() = 0; tmp.upper() = 16; oracle.int_store.affine_form_image(D, FP_Linear_Form(tmp)); - ph.affine_form_image(D, FP_Linear_Form(tmp)); + ph.affine_form_image(D, FP_Linear_Form(tmp)); oracle.int_store.intersection_assign(FP_Interval_Abstract_Store(ph)); // S = Y; diff -Nru ppl-1.1/tests/Concrete_Expression/linearform1.cc ppl-1.2/tests/Concrete_Expression/linearform1.cc --- ppl-1.1/tests/Concrete_Expression/linearform1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/linearform1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Testing Linear_Form on floating point intervals. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/linearize.cc ppl-1.2/tests/Concrete_Expression/linearize.cc --- ppl-1.1/tests/Concrete_Expression/linearize.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/linearize.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Testing linearization algorithm ad its related functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/Makefile.am ppl-1.2/tests/Concrete_Expression/Makefile.am --- ppl-1.1/tests/Concrete_Expression/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/Concrete_Expression/Makefile.in ppl-1.2/tests/Concrete_Expression/Makefile.in --- ppl-1.1/tests/Concrete_Expression/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/Makefile.in 2016-02-11 12:31:44.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -110,6 +110,7 @@ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -129,7 +130,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/Concrete_Expression/octagonalshape1.cc ppl-1.2/tests/Concrete_Expression/octagonalshape1.cc --- ppl-1.1/tests/Concrete_Expression/octagonalshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/octagonalshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::affine_form_image on interval linear forms. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/octagonalshape2.cc ppl-1.2/tests/Concrete_Expression/octagonalshape2.cc --- ppl-1.1/tests/Concrete_Expression/octagonalshape2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/octagonalshape2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Octagonal_Shape::refine_fp_interval_abstract_store and Octagonal_Shape::refine_with_linear_form_inequality. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/polyhedron1.cc ppl-1.2/tests/Concrete_Expression/polyhedron1.cc --- ppl-1.1/tests/Concrete_Expression/polyhedron1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/polyhedron1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::affine_form_image on interval linear forms. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/polyhedron2.cc ppl-1.2/tests/Concrete_Expression/polyhedron2.cc --- ppl-1.1/tests/Concrete_Expression/polyhedron2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/polyhedron2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ Polyhedron::refine_with_linear_form_inequality and Polyhedron::generalized_refine_with_linear_form_inequality. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Concrete_Expression/run_tests ppl-1.2/tests/Concrete_Expression/run_tests --- ppl-1.1/tests/Concrete_Expression/run_tests 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Concrete_Expression/run_tests 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ # Run the Floating_Point_Expression tests. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/CO_Tree/cotree1.cc ppl-1.2/tests/CO_Tree/cotree1.cc --- ppl-1.1/tests/CO_Tree/cotree1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/CO_Tree/cotree1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the CO_Tree class. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/CO_Tree/Makefile.am ppl-1.2/tests/CO_Tree/Makefile.am --- ppl-1.1/tests/CO_Tree/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/CO_Tree/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/CO_Tree/Makefile.in ppl-1.2/tests/CO_Tree/Makefile.in --- ppl-1.1/tests/CO_Tree/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/tests/CO_Tree/Makefile.in 2016-02-11 12:31:44.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -109,6 +109,7 @@ $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -128,7 +129,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/files.cc ppl-1.2/tests/files.cc --- ppl-1.1/tests/files.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/files.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Definition of simple helper functions to open and close files. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/files.hh ppl-1.2/tests/files.hh --- ppl-1.1/tests/files.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/files.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Declaration of simple helper functions to open and close files. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/addcongruence1.cc ppl-1.2/tests/Grid/addcongruence1.cc --- ppl-1.1/tests/Grid/addcongruence1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/addcongruence1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test methods which add a single congruence to a grid. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/addcongruences1.cc ppl-1.2/tests/Grid/addcongruences1.cc --- ppl-1.1/tests/Grid/addcongruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/addcongruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test methods which can add multiple congruences to a grid. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/addconstraint1.cc ppl-1.2/tests/Grid/addconstraint1.cc --- ppl-1.1/tests/Grid/addconstraint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/addconstraint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test adding single constraints to grids. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/addconstraints1.cc ppl-1.2/tests/Grid/addconstraints1.cc --- ppl-1.1/tests/Grid/addconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/addconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test adding constraints to a grid. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/addgenerator1.cc ppl-1.2/tests/Grid/addgenerator1.cc --- ppl-1.1/tests/Grid/addgenerator1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/addgenerator1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::add_grid_generator(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/addgenerators1.cc ppl-1.2/tests/Grid/addgenerators1.cc --- ppl-1.1/tests/Grid/addgenerators1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/addgenerators1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test method which can add multiple generators to a grid. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/addspacedims1.cc ppl-1.2/tests/Grid/addspacedims1.cc --- ppl-1.1/tests/Grid/addspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/addspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::add_space_dimensions_and_embed(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/affinedim1.cc ppl-1.2/tests/Grid/affinedim1.cc --- ppl-1.1/tests/Grid/affinedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/affinedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::affine_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/affineimage1.cc ppl-1.2/tests/Grid/affineimage1.cc --- ppl-1.1/tests/Grid/affineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/affineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/affineimage2.cc ppl-1.2/tests/Grid/affineimage2.cc --- ppl-1.1/tests/Grid/affineimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/affineimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/affinepreimage1.cc ppl-1.2/tests/Grid/affinepreimage1.cc --- ppl-1.1/tests/Grid/affinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/affinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/affinepreimage2.cc ppl-1.2/tests/Grid/affinepreimage2.cc --- ppl-1.1/tests/Grid/affinepreimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/affinepreimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/approximatepartition1.cc ppl-1.2/tests/Grid/approximatepartition1.cc --- ppl-1.1/tests/Grid/approximatepartition1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/approximatepartition1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test approximate_partition(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/asciidumpload1.cc ppl-1.2/tests/Grid/asciidumpload1.cc --- ppl-1.1/tests/Grid/asciidumpload1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/asciidumpload1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::ascii_dump() and Grid::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/asciidumpload2.cc ppl-1.2/tests/Grid/asciidumpload2.cc --- ppl-1.1/tests/Grid/asciidumpload2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/asciidumpload2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::ascii_dump() and Grid::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/asciidumpload3.cc ppl-1.2/tests/Grid/asciidumpload3.cc --- ppl-1.1/tests/Grid/asciidumpload3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/asciidumpload3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Congruence::ascii_dump() and Congruence::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/asciidumpload4.cc ppl-1.2/tests/Grid/asciidumpload4.cc --- ppl-1.1/tests/Grid/asciidumpload4.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/asciidumpload4.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Congruence_System ascii_dump() and ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/asciidumpload5.cc ppl-1.2/tests/Grid/asciidumpload5.cc --- ppl-1.1/tests/Grid/asciidumpload5.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/asciidumpload5.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid_Generator ascii_dump() and ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/asciidumpload6.cc ppl-1.2/tests/Grid/asciidumpload6.cc --- ppl-1.1/tests/Grid/asciidumpload6.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/asciidumpload6.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Generator_System ascii_dump() and ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/bhz03widening1.cc ppl-1.2/tests/Grid/bhz03widening1.cc --- ppl-1.1/tests/Grid/bhz03widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/bhz03widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::BHZ03_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/bounded1.cc ppl-1.2/tests/Grid/bounded1.cc --- ppl-1.1/tests/Grid/bounded1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/bounded1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::is_bounded(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/boundedaffineimage1.cc ppl-1.2/tests/Grid/boundedaffineimage1.cc --- ppl-1.1/tests/Grid/boundedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/boundedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::bounded_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/boundedaffinepreimage1.cc ppl-1.2/tests/Grid/boundedaffinepreimage1.cc --- ppl-1.1/tests/Grid/boundedaffinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/boundedaffinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::bounded_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/bounds1.cc ppl-1.2/tests/Grid/bounds1.cc --- ppl-1.1/tests/Grid/bounds1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/bounds1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::bounds_from_above() and Grid::bounds_from_below(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/certificate1.cc ppl-1.2/tests/Grid/certificate1.cc --- ppl-1.1/tests/Grid/certificate1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/certificate1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test class Grid_Certificate. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/concatenate1.cc ppl-1.2/tests/Grid/concatenate1.cc --- ppl-1.1/tests/Grid/concatenate1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/concatenate1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::concatenate_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/congruence1.cc ppl-1.2/tests/Grid/congruence1.cc --- ppl-1.1/tests/Grid/congruence1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/congruence1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test class Congruence. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/congruences1.cc ppl-1.2/tests/Grid/congruences1.cc --- ppl-1.1/tests/Grid/congruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/congruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/congruences2.cc ppl-1.2/tests/Grid/congruences2.cc --- ppl-1.1/tests/Grid/congruences2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/congruences2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Congruence_System::satisfies_all_congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/constraints1.cc ppl-1.2/tests/Grid/constraints1.cc --- ppl-1.1/tests/Grid/constraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/constraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/contains1.cc ppl-1.2/tests/Grid/contains1.cc --- ppl-1.1/tests/Grid/contains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/contains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::contains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/containsintegerpoint1.cc ppl-1.2/tests/Grid/containsintegerpoint1.cc --- ppl-1.1/tests/Grid/containsintegerpoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/containsintegerpoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::contains_integer_point(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/discrete1.cc ppl-1.2/tests/Grid/discrete1.cc --- ppl-1.1/tests/Grid/discrete1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/discrete1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::is_pointed(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/disjoint1.cc ppl-1.2/tests/Grid/disjoint1.cc --- ppl-1.1/tests/Grid/disjoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/disjoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::is_disjoint_from(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/dropnonintegerpoints1.cc ppl-1.2/tests/Grid/dropnonintegerpoints1.cc --- ppl-1.1/tests/Grid/dropnonintegerpoints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/dropnonintegerpoints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::drop_some_non_integer_points(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/equals1.cc ppl-1.2/tests/Grid/equals1.cc --- ppl-1.1/tests/Grid/equals1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/equals1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test operator==(const Grid&, const Grid&) and operator!=(const Grid&, const Grid&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/expandspacedim1.cc ppl-1.2/tests/Grid/expandspacedim1.cc --- ppl-1.1/tests/Grid/expandspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/expandspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::expand_space_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/foldspacedims1.cc ppl-1.2/tests/Grid/foldspacedims1.cc --- ppl-1.1/tests/Grid/foldspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/foldspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::fold_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/frequency1.cc ppl-1.2/tests/Grid/frequency1.cc --- ppl-1.1/tests/Grid/frequency1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/frequency1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::frequency(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/frombdshape1.cc ppl-1.2/tests/Grid/frombdshape1.cc --- ppl-1.1/tests/Grid/frombdshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/frombdshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BD_Shape(const C_Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/frombox1.cc ppl-1.2/tests/Grid/frombox1.cc --- ppl-1.1/tests/Grid/frombox1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/frombox1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::Grid(const Box&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/fromgrid1.cc ppl-1.2/tests/Grid/fromgrid1.cc --- ppl-1.1/tests/Grid/fromgrid1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/fromgrid1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test copy construction and assignment for grids. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/fromoctagonalshape1.cc ppl-1.2/tests/Grid/fromoctagonalshape1.cc --- ppl-1.1/tests/Grid/fromoctagonalshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/fromoctagonalshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BD_Shape(const C_Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/frompolyhedron1.cc ppl-1.2/tests/Grid/frompolyhedron1.cc --- ppl-1.1/tests/Grid/frompolyhedron1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/frompolyhedron1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test construction of grids from polyhedron. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/generalizedaffineimage1.cc ppl-1.2/tests/Grid/generalizedaffineimage1.cc --- ppl-1.1/tests/Grid/generalizedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/generalizedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::generalized_affine_image(var, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/generalizedaffineimage2.cc ppl-1.2/tests/Grid/generalizedaffineimage2.cc --- ppl-1.1/tests/Grid/generalizedaffineimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/generalizedaffineimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::generalized_affine_image(lhs, rhs, modulus). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/generalizedaffineimage3.cc ppl-1.2/tests/Grid/generalizedaffineimage3.cc --- ppl-1.1/tests/Grid/generalizedaffineimage3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/generalizedaffineimage3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::generalized_affine_image(var, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/generalizedaffinepreimage1.cc ppl-1.2/tests/Grid/generalizedaffinepreimage1.cc --- ppl-1.1/tests/Grid/generalizedaffinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/generalizedaffinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::generalized_affine_preimage(var, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/generalizedaffinepreimage2.cc ppl-1.2/tests/Grid/generalizedaffinepreimage2.cc --- ppl-1.1/tests/Grid/generalizedaffinepreimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/generalizedaffinepreimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::generalized_affine_preimage(lhs, rhs, modulus). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/generalizedaffinepreimage3.cc ppl-1.2/tests/Grid/generalizedaffinepreimage3.cc --- ppl-1.1/tests/Grid/generalizedaffinepreimage3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/generalizedaffinepreimage3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::generalized_affine_preimage(var, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/generator1.cc ppl-1.2/tests/Grid/generator1.cc --- ppl-1.1/tests/Grid/generator1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/generator1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test class Grid_Generator. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/generators1.cc ppl-1.2/tests/Grid/generators1.cc --- ppl-1.1/tests/Grid/generators1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/generators1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::generators(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/generators2.cc ppl-1.2/tests/Grid/generators2.cc --- ppl-1.1/tests/Grid/generators2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/generators2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test class Grid_Generator_System. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/grid1.cc ppl-1.2/tests/Grid/grid1.cc --- ppl-1.1/tests/Grid/grid1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/grid1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test reduction and conversion of grids created from generators. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/grid2.cc ppl-1.2/tests/Grid/grid2.cc --- ppl-1.1/tests/Grid/grid2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/grid2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test reduction and conversion of grids created from congruences. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/grid3.cc ppl-1.2/tests/Grid/grid3.cc --- ppl-1.1/tests/Grid/grid3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/grid3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test construction of grids from constraints. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/griddifference1.cc ppl-1.2/tests/Grid/griddifference1.cc --- ppl-1.1/tests/Grid/griddifference1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/griddifference1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::difference_assign() (a.k.a. Grid::difference_assign()). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/intersection1.cc ppl-1.2/tests/Grid/intersection1.cc --- ppl-1.1/tests/Grid/intersection1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/intersection1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::intersection_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/isempty1.cc ppl-1.2/tests/Grid/isempty1.cc --- ppl-1.1/tests/Grid/isempty1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/isempty1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::is_empty(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/isuniverse1.cc ppl-1.2/tests/Grid/isuniverse1.cc --- ppl-1.1/tests/Grid/isuniverse1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/isuniverse1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::is_universe(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/limitedextrapolation1.cc ppl-1.2/tests/Grid/limitedextrapolation1.cc --- ppl-1.1/tests/Grid/limitedextrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/limitedextrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::limited_congruence_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/limitedextrapolation2.cc ppl-1.2/tests/Grid/limitedextrapolation2.cc --- ppl-1.1/tests/Grid/limitedextrapolation2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/limitedextrapolation2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::limited_generator_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/limitedextrapolation3.cc ppl-1.2/tests/Grid/limitedextrapolation3.cc --- ppl-1.1/tests/Grid/limitedextrapolation3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/limitedextrapolation3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::limited_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/Makefile.am ppl-1.2/tests/Grid/Makefile.am --- ppl-1.1/tests/Grid/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/Grid/Makefile.in ppl-1.2/tests/Grid/Makefile.in --- ppl-1.1/tests/Grid/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/tests/Grid/Makefile.in 2016-02-11 12:31:44.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -155,6 +155,7 @@ $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -174,7 +175,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/Grid/mapspacedims1.cc ppl-1.2/tests/Grid/mapspacedims1.cc --- ppl-1.1/tests/Grid/mapspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/mapspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::map_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/maxmin1.cc ppl-1.2/tests/Grid/maxmin1.cc --- ppl-1.1/tests/Grid/maxmin1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/maxmin1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Grid::maximize(const Linear_Expression&, ...) and Grid::minimize(const Linear_Expression&, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/membytes1.cc ppl-1.2/tests/Grid/membytes1.cc --- ppl-1.1/tests/Grid/membytes1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/membytes1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Grid::total_memory_in_bytes() and Grid::external_memory_in_bytes(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/mincongruences1.cc ppl-1.2/tests/Grid/mincongruences1.cc --- ppl-1.1/tests/Grid/mincongruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/mincongruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::minimized_congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/mingenerators1.cc ppl-1.2/tests/Grid/mingenerators1.cc --- ppl-1.1/tests/Grid/mingenerators1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/mingenerators1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::minimized_grid_generators(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/outputoperator1.cc ppl-1.2/tests/Grid/outputoperator1.cc --- ppl-1.1/tests/Grid/outputoperator1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/outputoperator1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test IO_Operators::operator<<(s, gr). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/outputoperator2.cc ppl-1.2/tests/Grid/outputoperator2.cc --- ppl-1.1/tests/Grid/outputoperator2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/outputoperator2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid_Generator IO operators. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/outputoperator3.cc ppl-1.2/tests/Grid/outputoperator3.cc --- ppl-1.1/tests/Grid/outputoperator3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/outputoperator3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid_Generator_System IO operators. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/partition1.cc ppl-1.2/tests/Grid/partition1.cc --- ppl-1.1/tests/Grid/partition1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/partition1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/powersetdifference1.cc ppl-1.2/tests/Grid/powersetdifference1.cc --- ppl-1.1/tests/Grid/powersetdifference1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/powersetdifference1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/powersetgeometricallycovers1.cc ppl-1.2/tests/Grid/powersetgeometricallycovers1.cc --- ppl-1.1/tests/Grid/powersetgeometricallycovers1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/powersetgeometricallycovers1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/powersetgeometricallyequals1.cc ppl-1.2/tests/Grid/powersetgeometricallyequals1.cc --- ppl-1.1/tests/Grid/powersetgeometricallyequals1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/powersetgeometricallyequals1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/refinewithcongruences1.cc ppl-1.2/tests/Grid/refinewithcongruences1.cc --- ppl-1.1/tests/Grid/refinewithcongruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/refinewithcongruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test refine_with_congruence() and refine_with_congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/refinewithconstraints1.cc ppl-1.2/tests/Grid/refinewithconstraints1.cc --- ppl-1.1/tests/Grid/refinewithconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/refinewithconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test refine_with_constraint() and refine_with_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/relations1.cc ppl-1.2/tests/Grid/relations1.cc --- ppl-1.1/tests/Grid/relations1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/relations1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::relation_with(g). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/relations2.cc ppl-1.2/tests/Grid/relations2.cc --- ppl-1.1/tests/Grid/relations2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/relations2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::relation_with(cg). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/relations3.cc ppl-1.2/tests/Grid/relations3.cc --- ppl-1.1/tests/Grid/relations3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/relations3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::relation_with(const Constraint&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/removespacedims1.cc ppl-1.2/tests/Grid/removespacedims1.cc --- ppl-1.1/tests/Grid/removespacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/removespacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::remove_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/removespacedims2.cc ppl-1.2/tests/Grid/removespacedims2.cc --- ppl-1.1/tests/Grid/removespacedims2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/removespacedims2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::remove_higher_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/simplifyusingcontext1.cc ppl-1.2/tests/Grid/simplifyusingcontext1.cc --- ppl-1.1/tests/Grid/simplifyusingcontext1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/simplifyusingcontext1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::simplify_using_context_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/timeelapse1.cc ppl-1.2/tests/Grid/timeelapse1.cc --- ppl-1.1/tests/Grid/timeelapse1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/timeelapse1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::time_elapse_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/topclosed1.cc ppl-1.2/tests/Grid/topclosed1.cc --- ppl-1.1/tests/Grid/topclosed1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/topclosed1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::is_topologically_closed(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/topclosure1.cc ppl-1.2/tests/Grid/topclosure1.cc --- ppl-1.1/tests/Grid/topclosure1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/topclosure1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::topological_closure_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/unconstrain1.cc ppl-1.2/tests/Grid/unconstrain1.cc --- ppl-1.1/tests/Grid/unconstrain1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/unconstrain1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::unconstrain(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/upperbound1.cc ppl-1.2/tests/Grid/upperbound1.cc --- ppl-1.1/tests/Grid/upperbound1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/upperbound1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::upper_bound_assign() Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/upperbound2.cc ppl-1.2/tests/Grid/upperbound2.cc --- ppl-1.1/tests/Grid/upperbound2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/upperbound2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::upper_bound_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/widening1.cc ppl-1.2/tests/Grid/widening1.cc --- ppl-1.1/tests/Grid/widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::congruence_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/widening2.cc ppl-1.2/tests/Grid/widening2.cc --- ppl-1.1/tests/Grid/widening2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/widening2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::generator_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/widening3.cc ppl-1.2/tests/Grid/widening3.cc --- ppl-1.1/tests/Grid/widening3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/widening3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/wrap1.cc ppl-1.2/tests/Grid/wrap1.cc --- ppl-1.1/tests/Grid/wrap1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/wrap1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Grid::wrap_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Grid/writecongruencesystem.cc ppl-1.2/tests/Grid/writecongruencesystem.cc --- ppl-1.1/tests/Grid/writecongruencesystem.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Grid/writecongruencesystem.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test operator<<(std::ostream&, const Congruence_System&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Makefile.am ppl-1.2/tests/Makefile.am --- ppl-1.1/tests/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/Makefile.in ppl-1.2/tests/Makefile.in --- ppl-1.1/tests/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/tests/Makefile.in 2016-02-11 12:31:44.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -107,6 +107,7 @@ $(noinst_HEADERS) README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -126,7 +127,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/MIP_Problem/ascii_dump_load1.cc ppl-1.2/tests/MIP_Problem/ascii_dump_load1.cc --- ppl-1.1/tests/MIP_Problem/ascii_dump_load1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/MIP_Problem/ascii_dump_load1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test MIP_Problem::ascii_dump() and MIP_Problem::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/MIP_Problem/exceptions1.cc ppl-1.2/tests/MIP_Problem/exceptions1.cc --- ppl-1.1/tests/MIP_Problem/exceptions1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/MIP_Problem/exceptions1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test that the right exceptions are thrown in case of incorrect uses. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/MIP_Problem/Makefile.am ppl-1.2/tests/MIP_Problem/Makefile.am --- ppl-1.1/tests/MIP_Problem/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/MIP_Problem/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/MIP_Problem/Makefile.in ppl-1.2/tests/MIP_Problem/Makefile.in --- ppl-1.1/tests/MIP_Problem/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/tests/MIP_Problem/Makefile.in 2016-02-11 12:31:44.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -111,6 +111,7 @@ $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -130,7 +131,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/MIP_Problem/mipproblem1.cc ppl-1.2/tests/MIP_Problem/mipproblem1.cc --- ppl-1.1/tests/MIP_Problem/mipproblem1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/MIP_Problem/mipproblem1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the MIP_Problem class. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/MIP_Problem/mipproblem2.cc ppl-1.2/tests/MIP_Problem/mipproblem2.cc --- ppl-1.1/tests/MIP_Problem/mipproblem2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/MIP_Problem/mipproblem2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the MIP_Problem class with instances that require a watchdog timer. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/MIP_Problem/mipproblem3.cc ppl-1.2/tests/MIP_Problem/mipproblem3.cc --- ppl-1.1/tests/MIP_Problem/mipproblem3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/MIP_Problem/mipproblem3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the MIP_Problem class. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/MIP_Problem/mipproblem4.cc ppl-1.2/tests/MIP_Problem/mipproblem4.cc --- ppl-1.1/tests/MIP_Problem/mipproblem4.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/MIP_Problem/mipproblem4.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the MIP_Problem class. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/addspacedims1.cc ppl-1.2/tests/Octagonal_Shape/addspacedims1.cc --- ppl-1.1/tests/Octagonal_Shape/addspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/addspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Octagonal_Shape::add_space_dimensions_and_embed() and Octagonal_Shape::add_space_dimensions_and_project(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/affinedimension1.cc ppl-1.2/tests/Octagonal_Shape/affinedimension1.cc --- ppl-1.1/tests/Octagonal_Shape/affinedimension1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/affinedimension1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::affine_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/affineimage1.cc ppl-1.2/tests/Octagonal_Shape/affineimage1.cc --- ppl-1.1/tests/Octagonal_Shape/affineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/affineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/affineimage2.cc ppl-1.2/tests/Octagonal_Shape/affineimage2.cc --- ppl-1.1/tests/Octagonal_Shape/affineimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/affineimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/affinepreimage1.cc ppl-1.2/tests/Octagonal_Shape/affinepreimage1.cc --- ppl-1.1/tests/Octagonal_Shape/affinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/affinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/affinepreimage2.cc ppl-1.2/tests/Octagonal_Shape/affinepreimage2.cc --- ppl-1.1/tests/Octagonal_Shape/affinepreimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/affinepreimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/ascii_dump_load1.cc ppl-1.2/tests/Octagonal_Shape/ascii_dump_load1.cc --- ppl-1.1/tests/Octagonal_Shape/ascii_dump_load1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/ascii_dump_load1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::ascii_dump() and Octagonal_Shape::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/bhmz05widening1.cc ppl-1.2/tests/Octagonal_Shape/bhmz05widening1.cc --- ppl-1.1/tests/Octagonal_Shape/bhmz05widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/bhmz05widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::BHMZ05_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/bhz03widening1.cc ppl-1.2/tests/Octagonal_Shape/bhz03widening1.cc --- ppl-1.1/tests/Octagonal_Shape/bhz03widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/bhz03widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::BHZ03_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/bounded1.cc ppl-1.2/tests/Octagonal_Shape/bounded1.cc --- ppl-1.1/tests/Octagonal_Shape/bounded1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/bounded1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::is_bounded(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/boundedaffineimage1.cc ppl-1.2/tests/Octagonal_Shape/boundedaffineimage1.cc --- ppl-1.1/tests/Octagonal_Shape/boundedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/boundedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::bounded_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/boundedaffinepreimage1.cc ppl-1.2/tests/Octagonal_Shape/boundedaffinepreimage1.cc --- ppl-1.1/tests/Octagonal_Shape/boundedaffinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/boundedaffinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::bounded_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/bounds1.cc ppl-1.2/tests/Octagonal_Shape/bounds1.cc --- ppl-1.1/tests/Octagonal_Shape/bounds1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/bounds1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test OctagonalShape::bounds_from_below() and Octagonal_Shape::bounds_from_above(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/cc76extrapolation1.cc ppl-1.2/tests/Octagonal_Shape/cc76extrapolation1.cc --- ppl-1.1/tests/Octagonal_Shape/cc76extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/cc76extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::CC76_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/cc76narrowing1.cc ppl-1.2/tests/Octagonal_Shape/cc76narrowing1.cc --- ppl-1.1/tests/Octagonal_Shape/cc76narrowing1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/cc76narrowing1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::CC76_narrowing_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/chinainit.cc ppl-1.2/tests/Octagonal_Shape/chinainit.cc --- ppl-1.1/tests/Octagonal_Shape/chinainit.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/chinainit.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Simulate the initialization phase of the China analyzer. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/concatenate1.cc ppl-1.2/tests/Octagonal_Shape/concatenate1.cc --- ppl-1.1/tests/Octagonal_Shape/concatenate1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/concatenate1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::concatenate_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/congruences1.cc ppl-1.2/tests/Octagonal_Shape/congruences1.cc --- ppl-1.1/tests/Octagonal_Shape/congruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/congruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ congruences of an octagon that is defined by a system of congruences that contains only a trivially false congruence. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/constrains1.cc ppl-1.2/tests/Octagonal_Shape/constrains1.cc --- ppl-1.1/tests/Octagonal_Shape/constrains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/constrains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::constrains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/constraints1.cc ppl-1.2/tests/Octagonal_Shape/constraints1.cc --- ppl-1.1/tests/Octagonal_Shape/constraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/constraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ constraints of an octagon that is defined by a system of constraints that contains only a trivially false constraint. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/contains1.cc ppl-1.2/tests/Octagonal_Shape/contains1.cc --- ppl-1.1/tests/Octagonal_Shape/contains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/contains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::contains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/containsintegerpoint1.cc ppl-1.2/tests/Octagonal_Shape/containsintegerpoint1.cc --- ppl-1.1/tests/Octagonal_Shape/containsintegerpoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/containsintegerpoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::contains_integer_point(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/difference1.cc ppl-1.2/tests/Octagonal_Shape/difference1.cc --- ppl-1.1/tests/Octagonal_Shape/difference1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/difference1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ contained in `oct2', the result of `oct1.difference_assign(oct2)' is an empty octagon. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/discrete1.cc ppl-1.2/tests/Octagonal_Shape/discrete1.cc --- ppl-1.1/tests/Octagonal_Shape/discrete1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/discrete1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::is_discrete(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/disjoint1.cc ppl-1.2/tests/Octagonal_Shape/disjoint1.cc --- ppl-1.1/tests/Octagonal_Shape/disjoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/disjoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::is_disjoint_from(const Octagonal_Shape& y). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/dropsomenonintegerpoints1.cc ppl-1.2/tests/Octagonal_Shape/dropsomenonintegerpoints1.cc --- ppl-1.1/tests/Octagonal_Shape/dropsomenonintegerpoints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/dropsomenonintegerpoints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::drop_some_non_integer_points(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/empty1.cc ppl-1.2/tests/Octagonal_Shape/empty1.cc --- ppl-1.1/tests/Octagonal_Shape/empty1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/empty1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::is_empty() . Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/expandspacedim1.cc ppl-1.2/tests/Octagonal_Shape/expandspacedim1.cc --- ppl-1.1/tests/Octagonal_Shape/expandspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/expandspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::expand_space_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/foldspacedims1.cc ppl-1.2/tests/Octagonal_Shape/foldspacedims1.cc --- ppl-1.1/tests/Octagonal_Shape/foldspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/foldspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::fold_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/frequency1.cc ppl-1.2/tests/Octagonal_Shape/frequency1.cc --- ppl-1.1/tests/Octagonal_Shape/frequency1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/frequency1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::frequency(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/frombdshape1.cc ppl-1.2/tests/Octagonal_Shape/frombdshape1.cc --- ppl-1.1/tests/Octagonal_Shape/frombdshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/frombdshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BD_Shape(const C_Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/frombox1.cc ppl-1.2/tests/Octagonal_Shape/frombox1.cc --- ppl-1.1/tests/Octagonal_Shape/frombox1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/frombox1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::Octagonal_Shape(const Box&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/fromgensys1.cc ppl-1.2/tests/Octagonal_Shape/fromgensys1.cc --- ppl-1.1/tests/Octagonal_Shape/fromgensys1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/fromgensys1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::Octagonal_Shape(const Generator_System&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/fromgrid1.cc ppl-1.2/tests/Octagonal_Shape/fromgrid1.cc --- ppl-1.1/tests/Octagonal_Shape/fromgrid1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/fromgrid1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test C_Polyhedron::C_Polyhedron(const Grid&) and NNC_Polyhedron::NNC_Polyhedron(const Grid&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/fromoctagonalshape1.cc ppl-1.2/tests/Octagonal_Shape/fromoctagonalshape1.cc --- ppl-1.1/tests/Octagonal_Shape/fromoctagonalshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/fromoctagonalshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Octagonal_Shape copy construct, construction from other Octagonal shapes and assignment. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/frompolyhedron1.cc ppl-1.2/tests/Octagonal_Shape/frompolyhedron1.cc --- ppl-1.1/tests/Octagonal_Shape/frompolyhedron1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/frompolyhedron1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::Octagonal_Shape(const C_Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/fromspacedim1.cc ppl-1.2/tests/Octagonal_Shape/fromspacedim1.cc --- ppl-1.1/tests/Octagonal_Shape/fromspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/fromspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::Octagonal_Shape(dimension_type, Degenerate_Element). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/generalizedaffineimage1.cc ppl-1.2/tests/Octagonal_Shape/generalizedaffineimage1.cc --- ppl-1.1/tests/Octagonal_Shape/generalizedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/generalizedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/generalizedaffineimage2.cc ppl-1.2/tests/Octagonal_Shape/generalizedaffineimage2.cc --- ppl-1.1/tests/Octagonal_Shape/generalizedaffineimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/generalizedaffineimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/generalizedaffineimage3.cc ppl-1.2/tests/Octagonal_Shape/generalizedaffineimage3.cc --- ppl-1.1/tests/Octagonal_Shape/generalizedaffineimage3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/generalizedaffineimage3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/generalizedaffineimage4.cc ppl-1.2/tests/Octagonal_Shape/generalizedaffineimage4.cc --- ppl-1.1/tests/Octagonal_Shape/generalizedaffineimage4.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/generalizedaffineimage4.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/generalizedaffineimage5.cc ppl-1.2/tests/Octagonal_Shape/generalizedaffineimage5.cc --- ppl-1.1/tests/Octagonal_Shape/generalizedaffineimage5.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/generalizedaffineimage5.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/generalizedaffinepreimage1.cc ppl-1.2/tests/Octagonal_Shape/generalizedaffinepreimage1.cc --- ppl-1.1/tests/Octagonal_Shape/generalizedaffinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/generalizedaffinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/generalizedaffinepreimage2.cc ppl-1.2/tests/Octagonal_Shape/generalizedaffinepreimage2.cc --- ppl-1.1/tests/Octagonal_Shape/generalizedaffinepreimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/generalizedaffinepreimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/generalizedaffinepreimage3.cc ppl-1.2/tests/Octagonal_Shape/generalizedaffinepreimage3.cc --- ppl-1.1/tests/Octagonal_Shape/generalizedaffinepreimage3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/generalizedaffinepreimage3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/generalizedaffinepreimage4.cc ppl-1.2/tests/Octagonal_Shape/generalizedaffinepreimage4.cc --- ppl-1.1/tests/Octagonal_Shape/generalizedaffinepreimage4.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/generalizedaffinepreimage4.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/integerupperboundifexact1.cc ppl-1.2/tests/Octagonal_Shape/integerupperboundifexact1.cc --- ppl-1.1/tests/Octagonal_Shape/integerupperboundifexact1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/integerupperboundifexact1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::integer_upper_bound_assign_if_exact(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/intersection1.cc ppl-1.2/tests/Octagonal_Shape/intersection1.cc --- ppl-1.1/tests/Octagonal_Shape/intersection1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/intersection1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::intersection_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/limitedbhmz05extrapolation1.cc ppl-1.2/tests/Octagonal_Shape/limitedbhmz05extrapolation1.cc --- ppl-1.1/tests/Octagonal_Shape/limitedbhmz05extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/limitedbhmz05extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::limited_BHMZ05_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/limitedcc76extrapolation1.cc ppl-1.2/tests/Octagonal_Shape/limitedcc76extrapolation1.cc --- ppl-1.1/tests/Octagonal_Shape/limitedcc76extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/limitedcc76extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::limited_CC76_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/Makefile.am ppl-1.2/tests/Octagonal_Shape/Makefile.am --- ppl-1.1/tests/Octagonal_Shape/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/Octagonal_Shape/Makefile.in ppl-1.2/tests/Octagonal_Shape/Makefile.in --- ppl-1.1/tests/Octagonal_Shape/Makefile.in 2013-10-28 12:44:54.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/Makefile.in 2016-02-11 12:31:44.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -144,6 +144,7 @@ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -163,7 +164,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/Octagonal_Shape/mapspacedims1.cc ppl-1.2/tests/Octagonal_Shape/mapspacedims1.cc --- ppl-1.1/tests/Octagonal_Shape/mapspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/mapspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::map_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/max_min1.cc ppl-1.2/tests/Octagonal_Shape/max_min1.cc --- ppl-1.1/tests/Octagonal_Shape/max_min1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/max_min1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Octagonal_Shape::maximize(const Linear_Expression&, ...) and Octagonal_Shape::minimize(const Linear_Expression&, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/max_min2.cc ppl-1.2/tests/Octagonal_Shape/max_min2.cc --- ppl-1.1/tests/Octagonal_Shape/max_min2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/max_min2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Octagonal_Shape::maximize(const Linear_Expression&, ...) and Octagonal_Shape::minimize(const Linear_Expression&, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/maxspacedim1.cc ppl-1.2/tests/Octagonal_Shape/maxspacedim1.cc --- ppl-1.1/tests/Octagonal_Shape/maxspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/maxspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::max_space_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/membytes1.cc ppl-1.2/tests/Octagonal_Shape/membytes1.cc --- ppl-1.1/tests/Octagonal_Shape/membytes1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/membytes1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the total_memory_in_bytes() and external_memory_in_bytes() methods. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/minconstraints1.cc ppl-1.2/tests/Octagonal_Shape/minconstraints1.cc --- ppl-1.1/tests/Octagonal_Shape/minconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/minconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::minimized_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/relatwithcons1.cc ppl-1.2/tests/Octagonal_Shape/relatwithcons1.cc --- ppl-1.1/tests/Octagonal_Shape/relatwithcons1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/relatwithcons1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::relation_with(c). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/relatwithcons2.cc ppl-1.2/tests/Octagonal_Shape/relatwithcons2.cc --- ppl-1.1/tests/Octagonal_Shape/relatwithcons2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/relatwithcons2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::relation_with(c). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/relatwithcons3.cc ppl-1.2/tests/Octagonal_Shape/relatwithcons3.cc --- ppl-1.1/tests/Octagonal_Shape/relatwithcons3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/relatwithcons3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/relatwithgen1.cc ppl-1.2/tests/Octagonal_Shape/relatwithgen1.cc --- ppl-1.1/tests/Octagonal_Shape/relatwithgen1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/relatwithgen1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Octagonal_Shape::relation_with(g): we verify that a generator is not subsumed by an empty octagon. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/removespacedims1.cc ppl-1.2/tests/Octagonal_Shape/removespacedims1.cc --- ppl-1.1/tests/Octagonal_Shape/removespacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/removespacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Remove the higher variables from the space. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/run_tests ppl-1.2/tests/Octagonal_Shape/run_tests --- ppl-1.1/tests/Octagonal_Shape/run_tests 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/run_tests 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ # Run the Octagonal_Shape tests. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/Octagonal_Shape/simplifyusingcontext1.cc ppl-1.2/tests/Octagonal_Shape/simplifyusingcontext1.cc --- ppl-1.1/tests/Octagonal_Shape/simplifyusingcontext1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/simplifyusingcontext1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::simplify_using_context_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/timeelapse1.cc ppl-1.2/tests/Octagonal_Shape/timeelapse1.cc --- ppl-1.1/tests/Octagonal_Shape/timeelapse1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/timeelapse1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test time_elapse_assign() for particular polyhedra. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/unconstrain1.cc ppl-1.2/tests/Octagonal_Shape/unconstrain1.cc --- ppl-1.1/tests/Octagonal_Shape/unconstrain1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/unconstrain1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::unconstrain(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/universe1.cc ppl-1.2/tests/Octagonal_Shape/universe1.cc --- ppl-1.1/tests/Octagonal_Shape/universe1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/universe1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::is_universe(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/upperbound1.cc ppl-1.2/tests/Octagonal_Shape/upperbound1.cc --- ppl-1.1/tests/Octagonal_Shape/upperbound1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/upperbound1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::poly_hull_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/upperboundifexact1.cc ppl-1.2/tests/Octagonal_Shape/upperboundifexact1.cc --- ppl-1.1/tests/Octagonal_Shape/upperboundifexact1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/upperboundifexact1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::upper_bound_assign_if_exact(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/wrap1.cc ppl-1.2/tests/Octagonal_Shape/wrap1.cc --- ppl-1.1/tests/Octagonal_Shape/wrap1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/wrap1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Octagonal_Shape::wrap_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Octagonal_Shape/writeoctagon1.cc ppl-1.2/tests/Octagonal_Shape/writeoctagon1.cc --- ppl-1.1/tests/Octagonal_Shape/writeoctagon1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Octagonal_Shape/writeoctagon1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test operator<<(ostream&, const Octagonal_Shape&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/addcongruences1.cc ppl-1.2/tests/Partially_Reduced_Product/addcongruences1.cc --- ppl-1.1/tests/Partially_Reduced_Product/addcongruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/addcongruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Smash_Product. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/affineimage1.cc ppl-1.2/tests/Partially_Reduced_Product/affineimage1.cc --- ppl-1.1/tests/Partially_Reduced_Product/affineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/affineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product::() Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/asciidumpload1.cc ppl-1.2/tests/Partially_Reduced_Product/asciidumpload1.cc --- ppl-1.1/tests/Partially_Reduced_Product/asciidumpload1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/asciidumpload1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Direct_Product ascii_dump() and ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/bounded1.cc ppl-1.2/tests/Partially_Reduced_Product/bounded1.cc --- ppl-1.1/tests/Partially_Reduced_Product/bounded1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/bounded1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product<>::is_bounded(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/boundedaffineimage1.cc ppl-1.2/tests/Partially_Reduced_Product/boundedaffineimage1.cc --- ppl-1.1/tests/Partially_Reduced_Product/boundedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/boundedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Product::bounds_from_above() and Product::bounds_from_below() Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/bounds1.cc ppl-1.2/tests/Partially_Reduced_Product/bounds1.cc --- ppl-1.1/tests/Partially_Reduced_Product/bounds1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/bounds1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Product::bounds_from_above() and Product::bounds_from_below() Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/concatenate1.cc ppl-1.2/tests/Partially_Reduced_Product/concatenate1.cc --- ppl-1.1/tests/Partially_Reduced_Product/concatenate1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/concatenate1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product::concatenate_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/congruences1.cc ppl-1.2/tests/Partially_Reduced_Product/congruences1.cc --- ppl-1.1/tests/Partially_Reduced_Product/congruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/congruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product::congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/congruencesproduct1.cc ppl-1.2/tests/Partially_Reduced_Product/congruencesproduct1.cc --- ppl-1.1/tests/Partially_Reduced_Product/congruencesproduct1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/congruencesproduct1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Partially_Reduced_Product<>:: Congruences_Reduction() Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/constraints1.cc ppl-1.2/tests/Partially_Reduced_Product/constraints1.cc --- ppl-1.1/tests/Partially_Reduced_Product/constraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/constraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/constraintsproduct1.cc ppl-1.2/tests/Partially_Reduced_Product/constraintsproduct1.cc --- ppl-1.1/tests/Partially_Reduced_Product/constraintsproduct1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/constraintsproduct1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Partially_Reduced_Product<>:: Shrink_Using_Congruences_Reduction() Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/contains1.cc ppl-1.2/tests/Partially_Reduced_Product/contains1.cc --- ppl-1.1/tests/Partially_Reduced_Product/contains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/contains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Product::contains() and Product::strictly_contains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/difference1.cc ppl-1.2/tests/Partially_Reduced_Product/difference1.cc --- ppl-1.1/tests/Partially_Reduced_Product/difference1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/difference1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product::difference_assign() and. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/dimension1.cc ppl-1.2/tests/Partially_Reduced_Product/dimension1.cc --- ppl-1.1/tests/Partially_Reduced_Product/dimension1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/dimension1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Product::space_dimension() and Product::affine_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/directproduct1.cc ppl-1.2/tests/Partially_Reduced_Product/directproduct1.cc --- ppl-1.1/tests/Partially_Reduced_Product/directproduct1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/directproduct1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Direct_Product. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/discrete1.cc ppl-1.2/tests/Partially_Reduced_Product/discrete1.cc --- ppl-1.1/tests/Partially_Reduced_Product/discrete1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/discrete1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product<>::is_discrete(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/disjoint1.cc ppl-1.2/tests/Partially_Reduced_Product/disjoint1.cc --- ppl-1.1/tests/Partially_Reduced_Product/disjoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/disjoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product<>::is_disjoint(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/dropsomenonintegerpoints1.cc ppl-1.2/tests/Partially_Reduced_Product/dropsomenonintegerpoints1.cc --- ppl-1.1/tests/Partially_Reduced_Product/dropsomenonintegerpoints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/dropsomenonintegerpoints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product::drop_some_non_integer_points(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/equals1.cc ppl-1.2/tests/Partially_Reduced_Product/equals1.cc --- ppl-1.1/tests/Partially_Reduced_Product/equals1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/equals1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test operator==() and operator!=(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/frombdshape1.cc ppl-1.2/tests/Partially_Reduced_Product/frombdshape1.cc --- ppl-1.1/tests/Partially_Reduced_Product/frombdshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/frombdshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test construction of product from BD_Shape. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/frombox1.cc ppl-1.2/tests/Partially_Reduced_Product/frombox1.cc --- ppl-1.1/tests/Partially_Reduced_Product/frombox1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/frombox1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test construction of product from a Box. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/fromgrid1.cc ppl-1.2/tests/Partially_Reduced_Product/fromgrid1.cc --- ppl-1.1/tests/Partially_Reduced_Product/fromgrid1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/fromgrid1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test construction of product from a grid. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/fromoctagonalshape1.cc ppl-1.2/tests/Partially_Reduced_Product/fromoctagonalshape1.cc --- ppl-1.1/tests/Partially_Reduced_Product/fromoctagonalshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/fromoctagonalshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test construction of product from octagonal shape. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/frompolyhedron1.cc ppl-1.2/tests/Partially_Reduced_Product/frompolyhedron1.cc --- ppl-1.1/tests/Partially_Reduced_Product/frompolyhedron1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/frompolyhedron1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test construction of product from a polyhedron. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/fromproduct1.cc ppl-1.2/tests/Partially_Reduced_Product/fromproduct1.cc --- ppl-1.1/tests/Partially_Reduced_Product/fromproduct1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/fromproduct1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test construction of product from another product. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/generalizedaffineimage1.cc ppl-1.2/tests/Partially_Reduced_Product/generalizedaffineimage1.cc --- ppl-1.1/tests/Partially_Reduced_Product/generalizedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/generalizedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Product::generalized_affine_image() and Product::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/intersection1.cc ppl-1.2/tests/Partially_Reduced_Product/intersection1.cc --- ppl-1.1/tests/Partially_Reduced_Product/intersection1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/intersection1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product::intersection_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/isempty1.cc ppl-1.2/tests/Partially_Reduced_Product/isempty1.cc --- ppl-1.1/tests/Partially_Reduced_Product/isempty1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/isempty1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product<>::is_empty(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/isuniverse1.cc ppl-1.2/tests/Partially_Reduced_Product/isuniverse1.cc --- ppl-1.1/tests/Partially_Reduced_Product/isuniverse1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/isuniverse1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product<>::is_universe1(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/Makefile.am ppl-1.2/tests/Partially_Reduced_Product/Makefile.am --- ppl-1.1/tests/Partially_Reduced_Product/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/Partially_Reduced_Product/Makefile.in ppl-1.2/tests/Partially_Reduced_Product/Makefile.in --- ppl-1.1/tests/Partially_Reduced_Product/Makefile.in 2013-10-28 12:44:55.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/Makefile.in 2016-02-11 12:31:44.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -110,6 +110,7 @@ $(noinst_HEADERS) $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -129,7 +130,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/Partially_Reduced_Product/maxmin1.cc ppl-1.2/tests/Partially_Reduced_Product/maxmin1.cc --- ppl-1.1/tests/Partially_Reduced_Product/maxmin1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/maxmin1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Product::maximize() and Product::minimize() Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/partially_reduced_product_test.hh ppl-1.2/tests/Partially_Reduced_Product/partially_reduced_product_test.hh --- ppl-1.1/tests/Partially_Reduced_Product/partially_reduced_product_test.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/partially_reduced_product_test.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Header file for partially_reduced_product test programs. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/refinewithcongruences1.cc ppl-1.2/tests/Partially_Reduced_Product/refinewithcongruences1.cc --- ppl-1.1/tests/Partially_Reduced_Product/refinewithcongruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/refinewithcongruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test refine_with_congruence() and refine_with_congruences().. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/refinewithconstraints1.cc ppl-1.2/tests/Partially_Reduced_Product/refinewithconstraints1.cc --- ppl-1.1/tests/Partially_Reduced_Product/refinewithconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/refinewithconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test refine_with_constraint() and refine_with_constraints().. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/relations1.cc ppl-1.2/tests/Partially_Reduced_Product/relations1.cc --- ppl-1.1/tests/Partially_Reduced_Product/relations1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/relations1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/shapepreservingproduct1.cc ppl-1.2/tests/Partially_Reduced_Product/shapepreservingproduct1.cc --- ppl-1.1/tests/Partially_Reduced_Product/shapepreservingproduct1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/shapepreservingproduct1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Partially_Reduced_Product<>:: Shape_Preserving_Reduction() Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/smashproduct1.cc ppl-1.2/tests/Partially_Reduced_Product/smashproduct1.cc --- ppl-1.1/tests/Partially_Reduced_Product/smashproduct1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/smashproduct1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Smash_Product. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/spacedims1.cc ppl-1.2/tests/Partially_Reduced_Product/spacedims1.cc --- ppl-1.1/tests/Partially_Reduced_Product/spacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/spacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -7,7 +7,7 @@ Product::expand_space_dimension() and Product::map_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/timeelapse1.cc ppl-1.2/tests/Partially_Reduced_Product/timeelapse1.cc --- ppl-1.1/tests/Partially_Reduced_Product/timeelapse1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/timeelapse1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product::time_elapse_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/topclosed1.cc ppl-1.2/tests/Partially_Reduced_Product/topclosed1.cc --- ppl-1.1/tests/Partially_Reduced_Product/topclosed1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/topclosed1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product<>::is_topologically_closed(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/topclosure1.cc ppl-1.2/tests/Partially_Reduced_Product/topclosure1.cc --- ppl-1.1/tests/Partially_Reduced_Product/topclosure1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/topclosure1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Product::topological_closure_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Partially_Reduced_Product/upperbound1.cc ppl-1.2/tests/Partially_Reduced_Product/upperbound1.cc --- ppl-1.1/tests/Partially_Reduced_Product/upperbound1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Partially_Reduced_Product/upperbound1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Product::upper_bound_assign() Product::upper_bound_assign_if_exact(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/PIP_Problem/ascii_dump_load1.cc ppl-1.2/tests/PIP_Problem/ascii_dump_load1.cc --- ppl-1.1/tests/PIP_Problem/ascii_dump_load1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/PIP_Problem/ascii_dump_load1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test PIP_Problem::ascii_dump() and PIP_Problem::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/PIP_Problem/exceptions1.cc ppl-1.2/tests/PIP_Problem/exceptions1.cc --- ppl-1.1/tests/PIP_Problem/exceptions1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/PIP_Problem/exceptions1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test that the right exceptions are thrown in case of incorrect uses. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/PIP_Problem/Makefile.am ppl-1.2/tests/PIP_Problem/Makefile.am --- ppl-1.1/tests/PIP_Problem/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/PIP_Problem/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/PIP_Problem/Makefile.in ppl-1.2/tests/PIP_Problem/Makefile.in --- ppl-1.1/tests/PIP_Problem/Makefile.in 2013-10-28 12:44:55.000000000 +0000 +++ ppl-1.2/tests/PIP_Problem/Makefile.in 2016-02-11 12:31:44.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -111,6 +111,7 @@ $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -130,7 +131,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/PIP_Problem/pipproblem1.cc ppl-1.2/tests/PIP_Problem/pipproblem1.cc --- ppl-1.1/tests/PIP_Problem/pipproblem1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/PIP_Problem/pipproblem1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the PIP_Problem class. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/PIP_Problem/pipproblem2.cc ppl-1.2/tests/PIP_Problem/pipproblem2.cc --- ppl-1.1/tests/PIP_Problem/pipproblem2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/PIP_Problem/pipproblem2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the PIP_Problem class Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/PIP_Problem/pipproblem3.cc ppl-1.2/tests/PIP_Problem/pipproblem3.cc --- ppl-1.1/tests/PIP_Problem/pipproblem3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/PIP_Problem/pipproblem3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the PIP_Problem class. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/PIP_Problem/weightwatch1.cc ppl-1.2/tests/PIP_Problem/weightwatch1.cc --- ppl-1.1/tests/PIP_Problem/weightwatch1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/PIP_Problem/weightwatch1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test PIP_Problem (and MIP_Problem) with respect to deterministic timeouts. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addcongruence1.cc ppl-1.2/tests/Polyhedron/addcongruence1.cc --- ppl-1.1/tests/Polyhedron/addcongruence1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addcongruence1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::add_congruence(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addcongruences1.cc ppl-1.2/tests/Polyhedron/addcongruences1.cc --- ppl-1.1/tests/Polyhedron/addcongruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addcongruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::add_congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addconstraint1.cc ppl-1.2/tests/Polyhedron/addconstraint1.cc --- ppl-1.1/tests/Polyhedron/addconstraint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addconstraint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::add_constraint(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addconstraints1.cc ppl-1.2/tests/Polyhedron/addconstraints1.cc --- ppl-1.1/tests/Polyhedron/addconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::add_constrains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addconstraints2.cc ppl-1.2/tests/Polyhedron/addconstraints2.cc --- ppl-1.1/tests/Polyhedron/addconstraints2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addconstraints2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::add_constrains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addgenerator1.cc ppl-1.2/tests/Polyhedron/addgenerator1.cc --- ppl-1.1/tests/Polyhedron/addgenerator1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addgenerator1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::add_generator(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addgenerator2.cc ppl-1.2/tests/Polyhedron/addgenerator2.cc --- ppl-1.1/tests/Polyhedron/addgenerator2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addgenerator2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::add_generator(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addgenerators1.cc ppl-1.2/tests/Polyhedron/addgenerators1.cc --- ppl-1.1/tests/Polyhedron/addgenerators1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addgenerators1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::add_generators(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addgenerators2.cc ppl-1.2/tests/Polyhedron/addgenerators2.cc --- ppl-1.1/tests/Polyhedron/addgenerators2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addgenerators2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::add_generators(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addspacedims1.cc ppl-1.2/tests/Polyhedron/addspacedims1.cc --- ppl-1.1/tests/Polyhedron/addspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Polyhedron::add_space_dimensions_and_project() and Polyhedron::add_space_dimensions_and_embed(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/addspacedims2.cc ppl-1.2/tests/Polyhedron/addspacedims2.cc --- ppl-1.1/tests/Polyhedron/addspacedims2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/addspacedims2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Polyhedron::add_space_dimensions_and_project() and Polyhedron::add_space_dimensions_and_embed(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/affineimage1.cc ppl-1.2/tests/Polyhedron/affineimage1.cc --- ppl-1.1/tests/Polyhedron/affineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/affineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/affineimage2.cc ppl-1.2/tests/Polyhedron/affineimage2.cc --- ppl-1.1/tests/Polyhedron/affineimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/affineimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/affinepreimage1.cc ppl-1.2/tests/Polyhedron/affinepreimage1.cc --- ppl-1.1/tests/Polyhedron/affinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/affinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/affinetrans.cc ppl-1.2/tests/Polyhedron/affinetrans.cc --- ppl-1.1/tests/Polyhedron/affinetrans.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/affinetrans.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Use of the functions affine_image and affine_preimage. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/append1.cc ppl-1.2/tests/Polyhedron/append1.cc --- ppl-1.1/tests/Polyhedron/append1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/append1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* An example of iteration to a post-fixpoint. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/append2.cc ppl-1.2/tests/Polyhedron/append2.cc --- ppl-1.1/tests/Polyhedron/append2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/append2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* An example of iteration to a post-fixpoint. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/ascii_dump_load1.cc ppl-1.2/tests/Polyhedron/ascii_dump_load1.cc --- ppl-1.1/tests/Polyhedron/ascii_dump_load1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/ascii_dump_load1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::ascii_dump() and Polyhedron::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/ascii_dump_load2.cc ppl-1.2/tests/Polyhedron/ascii_dump_load2.cc --- ppl-1.1/tests/Polyhedron/ascii_dump_load2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/ascii_dump_load2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::ascii_dump() and Polyhedron::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/ascii_dump_load3.cc ppl-1.2/tests/Polyhedron/ascii_dump_load3.cc --- ppl-1.1/tests/Polyhedron/ascii_dump_load3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/ascii_dump_load3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::ascii_dump() and Polyhedron::ascii_load(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/bgp99extrapolation1.cc ppl-1.2/tests/Polyhedron/bgp99extrapolation1.cc --- ppl-1.1/tests/Polyhedron/bgp99extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/bgp99extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::BGP99_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/bgp99extrapolation2.cc ppl-1.2/tests/Polyhedron/bgp99extrapolation2.cc --- ppl-1.1/tests/Polyhedron/bgp99extrapolation2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/bgp99extrapolation2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::BGP99_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/bhrz03widening1.cc ppl-1.2/tests/Polyhedron/bhrz03widening1.cc --- ppl-1.1/tests/Polyhedron/bhrz03widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/bhrz03widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::BHRZ03_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/bhrz03widening2.cc ppl-1.2/tests/Polyhedron/bhrz03widening2.cc --- ppl-1.1/tests/Polyhedron/bhrz03widening2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/bhrz03widening2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::BHRZ03_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/bhrz03widening3.cc ppl-1.2/tests/Polyhedron/bhrz03widening3.cc --- ppl-1.1/tests/Polyhedron/bhrz03widening3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/bhrz03widening3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::BHRZ03_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/bhz03widening1.cc ppl-1.2/tests/Polyhedron/bhz03widening1.cc --- ppl-1.1/tests/Polyhedron/bhz03widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/bhz03widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::BHZ03_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/bounded1.cc ppl-1.2/tests/Polyhedron/bounded1.cc --- ppl-1.1/tests/Polyhedron/bounded1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/bounded1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::is_bounded(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/boundedaffineimage1.cc ppl-1.2/tests/Polyhedron/boundedaffineimage1.cc --- ppl-1.1/tests/Polyhedron/boundedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/boundedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::bounded_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/boundedaffinepreimage1.cc ppl-1.2/tests/Polyhedron/boundedaffinepreimage1.cc --- ppl-1.1/tests/Polyhedron/boundedaffinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/boundedaffinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::bounded_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/boundedbhrz03extrapolation1.cc ppl-1.2/tests/Polyhedron/boundedbhrz03extrapolation1.cc --- ppl-1.1/tests/Polyhedron/boundedbhrz03extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/boundedbhrz03extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::bounded_BHRZ03_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/boundedh79extrapolation1.cc ppl-1.2/tests/Polyhedron/boundedh79extrapolation1.cc --- ppl-1.1/tests/Polyhedron/boundedh79extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/boundedh79extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::bounded_H79_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/bounds1.cc ppl-1.2/tests/Polyhedron/bounds1.cc --- ppl-1.1/tests/Polyhedron/bounds1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/bounds1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::bounds_from_below() and Polyhedron::bounds_from_above(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/cnncconversion1.cc ppl-1.2/tests/Polyhedron/cnncconversion1.cc --- ppl-1.1/tests/Polyhedron/cnncconversion1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/cnncconversion1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test conversions between C_Polyhedron and NNC_Polyhedron. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/concatenate1.cc ppl-1.2/tests/Polyhedron/concatenate1.cc --- ppl-1.1/tests/Polyhedron/concatenate1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/concatenate1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::concatenate_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/congruences1.cc ppl-1.2/tests/Polyhedron/congruences1.cc --- ppl-1.1/tests/Polyhedron/congruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/congruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test C_Polyhedron(Congruence_System&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/constrains1.cc ppl-1.2/tests/Polyhedron/constrains1.cc --- ppl-1.1/tests/Polyhedron/constrains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/constrains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::constrains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/constraints1.cc ppl-1.2/tests/Polyhedron/constraints1.cc --- ppl-1.1/tests/Polyhedron/constraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/constraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/contains1.cc ppl-1.2/tests/Polyhedron/contains1.cc --- ppl-1.1/tests/Polyhedron/contains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/contains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::contains(const Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/contains2.cc ppl-1.2/tests/Polyhedron/contains2.cc --- ppl-1.1/tests/Polyhedron/contains2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/contains2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test NNC_Polyhedron::contains(const Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/containsintegerpoint1.cc ppl-1.2/tests/Polyhedron/containsintegerpoint1.cc --- ppl-1.1/tests/Polyhedron/containsintegerpoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/containsintegerpoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test C_Polyhedron::contains_integer_point(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/disjoint1.cc ppl-1.2/tests/Polyhedron/disjoint1.cc --- ppl-1.1/tests/Polyhedron/disjoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/disjoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::is_disjoint_from(const Polyhedron& y). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/disjoint2.cc ppl-1.2/tests/Polyhedron/disjoint2.cc --- ppl-1.1/tests/Polyhedron/disjoint2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/disjoint2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::is_disjoint_from(const Polyhedron& y). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/dropsomenonintegerpoints1.cc ppl-1.2/tests/Polyhedron/dropsomenonintegerpoints1.cc --- ppl-1.1/tests/Polyhedron/dropsomenonintegerpoints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/dropsomenonintegerpoints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::drop_some_non_integer_points(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/dropsomenonintegerpoints2.cc ppl-1.2/tests/Polyhedron/dropsomenonintegerpoints2.cc --- ppl-1.1/tests/Polyhedron/dropsomenonintegerpoints2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/dropsomenonintegerpoints2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::drop_some_non_integer_points(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/dualhypercubes.cc ppl-1.2/tests/Polyhedron/dualhypercubes.cc --- ppl-1.1/tests/Polyhedron/dualhypercubes.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/dualhypercubes.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Exploit smf when computing the intersection of NNC dual hypercubes. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/empty1.cc ppl-1.2/tests/Polyhedron/empty1.cc --- ppl-1.1/tests/Polyhedron/empty1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/empty1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Different ways of creating an empty polyhedron. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/equals1.cc ppl-1.2/tests/Polyhedron/equals1.cc --- ppl-1.1/tests/Polyhedron/equals1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/equals1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test operator==(const Polyhedron&, const Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/exceptions1.cc ppl-1.2/tests/Polyhedron/exceptions1.cc --- ppl-1.1/tests/Polyhedron/exceptions1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/exceptions1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test that the right exceptions are thrown in case of incorrect uses. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/exceptions2.cc ppl-1.2/tests/Polyhedron/exceptions2.cc --- ppl-1.1/tests/Polyhedron/exceptions2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/exceptions2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test that the right exceptions are thrown in case of incorrect uses. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/exceptions3.cc ppl-1.2/tests/Polyhedron/exceptions3.cc --- ppl-1.1/tests/Polyhedron/exceptions3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/exceptions3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test that the right exceptions are thrown in case of incorrect uses. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/expandspacedim1.cc ppl-1.2/tests/Polyhedron/expandspacedim1.cc --- ppl-1.1/tests/Polyhedron/expandspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/expandspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::expand_space_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/expandspacedim2.cc ppl-1.2/tests/Polyhedron/expandspacedim2.cc --- ppl-1.1/tests/Polyhedron/expandspacedim2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/expandspacedim2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::expand_space_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/foldspacedims1.cc ppl-1.2/tests/Polyhedron/foldspacedims1.cc --- ppl-1.1/tests/Polyhedron/foldspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/foldspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::fold_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/foldspacedims2.cc ppl-1.2/tests/Polyhedron/foldspacedims2.cc --- ppl-1.1/tests/Polyhedron/foldspacedims2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/foldspacedims2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::fold_space_dimensions() for non-closed polyhedra. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/frequency1.cc ppl-1.2/tests/Polyhedron/frequency1.cc --- ppl-1.1/tests/Polyhedron/frequency1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/frequency1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::frequency(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/frombdshape1.cc ppl-1.2/tests/Polyhedron/frombdshape1.cc --- ppl-1.1/tests/Polyhedron/frombdshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/frombdshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BD_Shape(const C_Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/frombox1.cc ppl-1.2/tests/Polyhedron/frombox1.cc --- ppl-1.1/tests/Polyhedron/frombox1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/frombox1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test C_Polyhedron::C_Polyhedron(const Box&) and NNC_Polyhedron::NNC_Polyhedron(const Box&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/frombox2.cc ppl-1.2/tests/Polyhedron/frombox2.cc --- ppl-1.1/tests/Polyhedron/frombox2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/frombox2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test NNC_Polyhedron::NNC_Polyhedron(const Box&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/fromgrid1.cc ppl-1.2/tests/Polyhedron/fromgrid1.cc --- ppl-1.1/tests/Polyhedron/fromgrid1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/fromgrid1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test C_Polyhedron::C_Polyhedron(const Grid&) and NNC_Polyhedron::NNC_Polyhedron(const Grid&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/fromoctagonalshape1.cc ppl-1.2/tests/Polyhedron/fromoctagonalshape1.cc --- ppl-1.1/tests/Polyhedron/fromoctagonalshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/fromoctagonalshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test BD_Shape::BD_Shape(const C_Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/generalizedaffineimage1.cc ppl-1.2/tests/Polyhedron/generalizedaffineimage1.cc --- ppl-1.1/tests/Polyhedron/generalizedaffineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/generalizedaffineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/generalizedaffineimage2.cc ppl-1.2/tests/Polyhedron/generalizedaffineimage2.cc --- ppl-1.1/tests/Polyhedron/generalizedaffineimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/generalizedaffineimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::generalized_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/generalizedaffinepreimage1.cc ppl-1.2/tests/Polyhedron/generalizedaffinepreimage1.cc --- ppl-1.1/tests/Polyhedron/generalizedaffinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/generalizedaffinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/generalizedaffinepreimage2.cc ppl-1.2/tests/Polyhedron/generalizedaffinepreimage2.cc --- ppl-1.1/tests/Polyhedron/generalizedaffinepreimage2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/generalizedaffinepreimage2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::generalized_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/generators1.cc ppl-1.2/tests/Polyhedron/generators1.cc --- ppl-1.1/tests/Polyhedron/generators1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/generators1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the construction of a polyhedron using generators. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/geomcovers1.cc ppl-1.2/tests/Polyhedron/geomcovers1.cc --- ppl-1.1/tests/Polyhedron/geomcovers1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/geomcovers1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::geometrically_covers(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/h79widening1.cc ppl-1.2/tests/Polyhedron/h79widening1.cc --- ppl-1.1/tests/Polyhedron/h79widening1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/h79widening1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::H79_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/h79widening2.cc ppl-1.2/tests/Polyhedron/h79widening2.cc --- ppl-1.1/tests/Polyhedron/h79widening2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/h79widening2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::H79_widening_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/hybrid.cc ppl-1.2/tests/Polyhedron/hybrid.cc --- ppl-1.1/tests/Polyhedron/hybrid.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/hybrid.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test three examples for linear hybrid systems. These are based on the examples in HalbwachsPR94 and HalbwachsPR97 papers. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/hypercubes.cc ppl-1.2/tests/Polyhedron/hypercubes.cc --- ppl-1.1/tests/Polyhedron/hypercubes.cc 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/hypercubes.cc 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,35 @@ +#include "ppl_test.hh" +#include "timings.hh" + +namespace { + +bool +test01() { + const dimension_type first_dim = 10; + const dimension_type last_dim = 16; + + for (dimension_type dim = first_dim; dim <= last_dim; ++dim) { + Constraint_System cs; + for (dimension_type i = 0; i < dim; ++i) { + cs.insert(Variable(i) >= 0); + cs.insert(Variable(i) <= 1); + } + nout << "Converting hypercube of dim " << dim << " | "; + C_Polyhedron ph(cs); + start_clock(); + (void) ph.generators(); + print_clock(nout); + const Constraint_System& min_cs = ph.minimized_constraints(); + nout << " " << std::distance(min_cs.begin(), min_cs.end()); + const Generator_System& min_gs = ph.minimized_generators(); + nout << " " << std::distance(min_gs.begin(), min_gs.end()); + nout << endl; + } + return true; +} + +} // namespace + +BEGIN_MAIN + DO_TEST(test01); +END_MAIN diff -Nru ppl-1.1/tests/Polyhedron/intersection1.cc ppl-1.2/tests/Polyhedron/intersection1.cc --- ppl-1.1/tests/Polyhedron/intersection1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/intersection1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Testing Polyhedron::intersection_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/limitedbhrz03extrapolation1.cc ppl-1.2/tests/Polyhedron/limitedbhrz03extrapolation1.cc --- ppl-1.1/tests/Polyhedron/limitedbhrz03extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/limitedbhrz03extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::limited_BHRZ03_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/limitedh79extrapolation1.cc ppl-1.2/tests/Polyhedron/limitedh79extrapolation1.cc --- ppl-1.1/tests/Polyhedron/limitedh79extrapolation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/limitedh79extrapolation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::limited_H79_extrapolation_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/linearexpression1.cc ppl-1.2/tests/Polyhedron/linearexpression1.cc --- ppl-1.1/tests/Polyhedron/linearexpression1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/linearexpression1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Testing Linear_Expression. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/linearpartition1.cc ppl-1.2/tests/Polyhedron/linearpartition1.cc --- ppl-1.1/tests/Polyhedron/linearpartition1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/linearpartition1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test linear_partition(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/linearsystem1.cc ppl-1.2/tests/Polyhedron/linearsystem1.cc --- ppl-1.1/tests/Polyhedron/linearsystem1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/linearsystem1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test some functionality of class Linear_System. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -67,7 +67,7 @@ // such a coefficient. // To avoid the problem, we simply increment the coefficient. ++c; - + if (col == 0) e += c; else diff -Nru ppl-1.1/tests/Polyhedron/Makefile.am ppl-1.2/tests/Polyhedron/Makefile.am --- ppl-1.1/tests/Polyhedron/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -99,6 +99,7 @@ geomcovers1 \ h79widening1 h79widening2 \ hybrid \ +hypercubes \ intersection1 \ limitedbhrz03extrapolation1 \ limitedh79extrapolation1 \ @@ -129,7 +130,7 @@ refinewithconstraints1 \ relations1 relations2 relations3 \ removespacedims1 removespacedims2 \ -simplifyusingcontext1 \ +simplifyusingcontext1 simplifyusingcontext2 \ smm1 \ sparserow1 \ termination1 termination2 \ @@ -337,10 +338,14 @@ hybrid_SOURCES = hybrid.cc +hypercubes_SOURCES = hypercubes.cc + intersection1_SOURCES = intersection1.cc simplifyusingcontext1_SOURCES = simplifyusingcontext1.cc +simplifyusingcontext2_SOURCES = simplifyusingcontext2.cc + limitedbhrz03extrapolation1_SOURCES = limitedbhrz03extrapolation1.cc limitedh79extrapolation1_SOURCES = limitedh79extrapolation1.cc diff -Nru ppl-1.1/tests/Polyhedron/Makefile.in ppl-1.2/tests/Polyhedron/Makefile.in --- ppl-1.1/tests/Polyhedron/Makefile.in 2013-10-28 12:44:55.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/Makefile.in 2016-02-11 12:31:45.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -109,6 +109,7 @@ $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -128,7 +129,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ @@ -172,8 +174,8 @@ generalizedaffinepreimage1$(EXEEXT) \ generalizedaffinepreimage2$(EXEEXT) generators1$(EXEEXT) \ geomcovers1$(EXEEXT) h79widening1$(EXEEXT) \ - h79widening2$(EXEEXT) hybrid$(EXEEXT) intersection1$(EXEEXT) \ - limitedbhrz03extrapolation1$(EXEEXT) \ + h79widening2$(EXEEXT) hybrid$(EXEEXT) hypercubes$(EXEEXT) \ + intersection1$(EXEEXT) limitedbhrz03extrapolation1$(EXEEXT) \ limitedh79extrapolation1$(EXEEXT) linearexpression1$(EXEEXT) \ linearpartition1$(EXEEXT) linearsystem1$(EXEEXT) \ mapspacedims1$(EXEEXT) matrix1$(EXEEXT) max_min1$(EXEEXT) \ @@ -191,8 +193,8 @@ refinewithconstraints1$(EXEEXT) relations1$(EXEEXT) \ relations2$(EXEEXT) relations3$(EXEEXT) \ removespacedims1$(EXEEXT) removespacedims2$(EXEEXT) \ - simplifyusingcontext1$(EXEEXT) smm1$(EXEEXT) \ - sparserow1$(EXEEXT) termination1$(EXEEXT) \ + simplifyusingcontext1$(EXEEXT) simplifyusingcontext2$(EXEEXT) \ + smm1$(EXEEXT) sparserow1$(EXEEXT) termination1$(EXEEXT) \ termination2$(EXEEXT) timeelapse1$(EXEEXT) \ timeelapse2$(EXEEXT) topclosed1$(EXEEXT) topclosure1$(EXEEXT) \ unconstrain1$(EXEEXT) universe1$(EXEEXT) universe2$(EXEEXT) \ @@ -691,6 +693,12 @@ hybrid_DEPENDENCIES = $(top_builddir)/utils/libppl_utils.a \ $(top_builddir)/tests/libppl_tests.a \ $(top_builddir)/src/libppl.la +am_hypercubes_OBJECTS = hypercubes.$(OBJEXT) +hypercubes_OBJECTS = $(am_hypercubes_OBJECTS) +hypercubes_LDADD = $(LDADD) +hypercubes_DEPENDENCIES = $(top_builddir)/utils/libppl_utils.a \ + $(top_builddir)/tests/libppl_tests.a \ + $(top_builddir)/src/libppl.la am_intersection1_OBJECTS = intersection1.$(OBJEXT) intersection1_OBJECTS = $(am_intersection1_OBJECTS) intersection1_LDADD = $(LDADD) @@ -1730,6 +1738,13 @@ $(top_builddir)/utils/libppl_utils.a \ $(top_builddir)/tests/libppl_tests.a \ $(top_builddir)/src/libppl.la +am_simplifyusingcontext2_OBJECTS = simplifyusingcontext2.$(OBJEXT) +simplifyusingcontext2_OBJECTS = $(am_simplifyusingcontext2_OBJECTS) +simplifyusingcontext2_LDADD = $(LDADD) +simplifyusingcontext2_DEPENDENCIES = \ + $(top_builddir)/utils/libppl_utils.a \ + $(top_builddir)/tests/libppl_tests.a \ + $(top_builddir)/src/libppl.la am_smm1_OBJECTS = smm1.$(OBJEXT) smm1_OBJECTS = $(am_smm1_OBJECTS) smm1_LDADD = $(LDADD) @@ -1933,7 +1948,7 @@ $(generalizedaffinepreimage2_SOURCES) $(generators1_SOURCES) \ $(geomcovers1_SOURCES) $(h79widening1_SOURCES) \ $(h79widening2_SOURCES) $(hybrid_SOURCES) \ - $(intersection1_SOURCES) \ + $(hypercubes_SOURCES) $(intersection1_SOURCES) \ $(limitedbhrz03extrapolation1_SOURCES) \ $(limitedh79extrapolation1_SOURCES) \ $(linearexpression1_SOURCES) $(linearpartition1_SOURCES) \ @@ -1996,7 +2011,8 @@ $(refinewithconstraints1_SOURCES) $(relations1_SOURCES) \ $(relations2_SOURCES) $(relations3_SOURCES) \ $(removespacedims1_SOURCES) $(removespacedims2_SOURCES) \ - $(simplifyusingcontext1_SOURCES) $(smm1_SOURCES) \ + $(simplifyusingcontext1_SOURCES) \ + $(simplifyusingcontext2_SOURCES) $(smm1_SOURCES) \ $(sparserow1_SOURCES) $(termination1_SOURCES) \ $(termination2_SOURCES) $(timeelapse1_SOURCES) \ $(timeelapse2_SOURCES) $(topclosed1_SOURCES) \ @@ -2044,7 +2060,7 @@ $(generalizedaffinepreimage2_SOURCES) $(generators1_SOURCES) \ $(geomcovers1_SOURCES) $(h79widening1_SOURCES) \ $(h79widening2_SOURCES) $(hybrid_SOURCES) \ - $(intersection1_SOURCES) \ + $(hypercubes_SOURCES) $(intersection1_SOURCES) \ $(limitedbhrz03extrapolation1_SOURCES) \ $(limitedh79extrapolation1_SOURCES) \ $(linearexpression1_SOURCES) $(linearpartition1_SOURCES) \ @@ -2107,7 +2123,8 @@ $(refinewithconstraints1_SOURCES) $(relations1_SOURCES) \ $(relations2_SOURCES) $(relations3_SOURCES) \ $(removespacedims1_SOURCES) $(removespacedims2_SOURCES) \ - $(simplifyusingcontext1_SOURCES) $(smm1_SOURCES) \ + $(simplifyusingcontext1_SOURCES) \ + $(simplifyusingcontext2_SOURCES) $(smm1_SOURCES) \ $(sparserow1_SOURCES) $(termination1_SOURCES) \ $(termination2_SOURCES) $(timeelapse1_SOURCES) \ $(timeelapse2_SOURCES) $(topclosed1_SOURCES) \ @@ -2609,6 +2626,7 @@ geomcovers1 \ h79widening1 h79widening2 \ hybrid \ +hypercubes \ intersection1 \ limitedbhrz03extrapolation1 \ limitedh79extrapolation1 \ @@ -2639,7 +2657,7 @@ refinewithconstraints1 \ relations1 relations2 relations3 \ removespacedims1 removespacedims2 \ -simplifyusingcontext1 \ +simplifyusingcontext1 simplifyusingcontext2 \ smm1 \ sparserow1 \ termination1 termination2 \ @@ -2800,8 +2818,10 @@ h79widening1_SOURCES = h79widening1.cc h79widening2_SOURCES = h79widening2.cc hybrid_SOURCES = hybrid.cc +hypercubes_SOURCES = hypercubes.cc intersection1_SOURCES = intersection1.cc simplifyusingcontext1_SOURCES = simplifyusingcontext1.cc +simplifyusingcontext2_SOURCES = simplifyusingcontext2.cc limitedbhrz03extrapolation1_SOURCES = limitedbhrz03extrapolation1.cc limitedh79extrapolation1_SOURCES = limitedh79extrapolation1.cc linearpartition1_SOURCES = linearpartition1.cc @@ -3351,6 +3371,10 @@ @rm -f hybrid$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(hybrid_OBJECTS) $(hybrid_LDADD) $(LIBS) +hypercubes$(EXEEXT): $(hypercubes_OBJECTS) $(hypercubes_DEPENDENCIES) $(EXTRA_hypercubes_DEPENDENCIES) + @rm -f hypercubes$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(hypercubes_OBJECTS) $(hypercubes_LDADD) $(LIBS) + intersection1$(EXEEXT): $(intersection1_OBJECTS) $(intersection1_DEPENDENCIES) $(EXTRA_intersection1_DEPENDENCIES) @rm -f intersection1$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(intersection1_OBJECTS) $(intersection1_LDADD) $(LIBS) @@ -3803,6 +3827,10 @@ @rm -f simplifyusingcontext1$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(simplifyusingcontext1_OBJECTS) $(simplifyusingcontext1_LDADD) $(LIBS) +simplifyusingcontext2$(EXEEXT): $(simplifyusingcontext2_OBJECTS) $(simplifyusingcontext2_DEPENDENCIES) $(EXTRA_simplifyusingcontext2_DEPENDENCIES) + @rm -f simplifyusingcontext2$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(simplifyusingcontext2_OBJECTS) $(simplifyusingcontext2_LDADD) $(LIBS) + smm1$(EXEEXT): $(smm1_OBJECTS) $(smm1_DEPENDENCIES) $(EXTRA_smm1_DEPENDENCIES) @rm -f smm1$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(smm1_OBJECTS) $(smm1_LDADD) $(LIBS) @@ -3966,6 +3994,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h79widening1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h79widening2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hybrid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hypercubes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intersection1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/limitedbhrz03extrapolation1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/limitedh79extrapolation1.Po@am__quote@ @@ -4078,6 +4107,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/removespacedims1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/removespacedims2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simplifyusingcontext1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simplifyusingcontext2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smm1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparserow1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/termination1.Po@am__quote@ @@ -5812,6 +5842,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +hypercubes.log: hypercubes$(EXEEXT) + @p='hypercubes$(EXEEXT)'; \ + b='hypercubes'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) intersection1.log: intersection1$(EXEEXT) @p='intersection1$(EXEEXT)'; \ b='intersection1'; \ @@ -6091,6 +6128,13 @@ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +simplifyusingcontext2.log: simplifyusingcontext2$(EXEEXT) + @p='simplifyusingcontext2$(EXEEXT)'; \ + b='simplifyusingcontext2'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) smm1.log: smm1$(EXEEXT) @p='smm1$(EXEEXT)'; \ diff -Nru ppl-1.1/tests/Polyhedron/mapspacedims1.cc ppl-1.2/tests/Polyhedron/mapspacedims1.cc --- ppl-1.1/tests/Polyhedron/mapspacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/mapspacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::map_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/matrix1.cc ppl-1.2/tests/Polyhedron/matrix1.cc --- ppl-1.1/tests/Polyhedron/matrix1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/matrix1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test some functionality of class Matrix. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/max_min1.cc ppl-1.2/tests/Polyhedron/max_min1.cc --- ppl-1.1/tests/Polyhedron/max_min1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/max_min1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Polyhedron::maximize(const Linear_Expression&, ...) and Polyhedron::minimize(const Linear_Expression&, ...). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/maxspacedim1.cc ppl-1.2/tests/Polyhedron/maxspacedim1.cc --- ppl-1.1/tests/Polyhedron/maxspacedim1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/maxspacedim1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the *::max_space_dimension() methods. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/mc91.cc ppl-1.2/tests/Polyhedron/mc91.cc --- ppl-1.1/tests/Polyhedron/mc91.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/mc91.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the Pointset_Powerset construction with McCarthy's 91 function. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/membytes1.cc ppl-1.2/tests/Polyhedron/membytes1.cc --- ppl-1.1/tests/Polyhedron/membytes1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/membytes1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the total_memory_in_bytes() and external_memory_in_bytes() methods. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/memory1.cc ppl-1.2/tests/Polyhedron/memory1.cc --- ppl-1.1/tests/Polyhedron/memory1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/memory1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the allocation error recovery facility of the library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -21,9 +21,6 @@ For the most up-to-date information see the Parma Polyhedra Library site: http://bugseng.com/products/ppl/ . */ -// Note: we cannot know, at this stage whether -// PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK evaluates to true. -#define PPL_NO_AUTOMATIC_INITIALIZATION #include "ppl_test.hh" #include #include @@ -162,23 +159,13 @@ #define INIT_MEMORY 3*1024*1024 -#if PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK extern "C" void ppl_set_GMP_memory_allocation_functions(void) { mp_set_memory_functions(cxx_malloc, cxx_realloc, cxx_free); } -#endif // PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK int main() TRY { -#if !PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK - mp_set_memory_functions(cxx_malloc, cxx_realloc, cxx_free); -#endif // !PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK - - // Note: we have included under the definition of - // PPL_NO_AUTOMATIC_INITIALIZATION. - Parma_Polyhedra_Library::initialize(); - set_handlers(); // Find a dimension that cannot be computed with INIT_MEMORY bytes. @@ -209,10 +196,6 @@ nout << "Estimated memory for dimension " << dimension << ": " << (lower_bound+upper_bound)/2 << " bytes" << endl; - // Note: we have included under the definition of - // PPL_NO_AUTOMATIC_INITIALIZATION. - Parma_Polyhedra_Library::finalize(); - return 0; } CATCH diff -Nru ppl-1.1/tests/Polyhedron/memory2.cc ppl-1.2/tests/Polyhedron/memory2.cc --- ppl-1.1/tests/Polyhedron/memory2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/memory2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the allocation error recovery facility of the library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/minconstraints1.cc ppl-1.2/tests/Polyhedron/minconstraints1.cc --- ppl-1.1/tests/Polyhedron/minconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/minconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::minimized_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/minconstraints2.cc ppl-1.2/tests/Polyhedron/minconstraints2.cc --- ppl-1.1/tests/Polyhedron/minconstraints2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/minconstraints2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::minimized_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/mingenerators1.cc ppl-1.2/tests/Polyhedron/mingenerators1.cc --- ppl-1.1/tests/Polyhedron/mingenerators1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/mingenerators1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::minimized_generators(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/mingenerators2.cc ppl-1.2/tests/Polyhedron/mingenerators2.cc --- ppl-1.1/tests/Polyhedron/mingenerators2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/mingenerators2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::minimized_generators(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/nncminimize1.cc ppl-1.2/tests/Polyhedron/nncminimize1.cc --- ppl-1.1/tests/Polyhedron/nncminimize1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/nncminimize1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test minimization of NNC polyhedra. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/nncminimize2.cc ppl-1.2/tests/Polyhedron/nncminimize2.cc --- ppl-1.1/tests/Polyhedron/nncminimize2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/nncminimize2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test NNC_Polyhedron::ph.minimized_generators(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/nncpostimeelapse1.cc ppl-1.2/tests/Polyhedron/nncpostimeelapse1.cc --- ppl-1.1/tests/Polyhedron/nncpostimeelapse1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/nncpostimeelapse1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::positive_time_elapse_assign(). Copyright (C) 2013 Marco Faella - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/numberinput1.cc ppl-1.2/tests/Polyhedron/numberinput1.cc --- ppl-1.1/tests/Polyhedron/numberinput1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/numberinput1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test number input. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/onepoint.cc ppl-1.2/tests/Polyhedron/onepoint.cc --- ppl-1.1/tests/Polyhedron/onepoint.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/onepoint.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Creation of a one-point polyhedron. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/permute.cc ppl-1.2/tests/Polyhedron/permute.cc --- ppl-1.1/tests/Polyhedron/permute.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/permute.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* An example of iteration to a post-fixpoint. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/polydifference1.cc ppl-1.2/tests/Polyhedron/polydifference1.cc --- ppl-1.1/tests/Polyhedron/polydifference1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/polydifference1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::difference_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/polydifference2.cc ppl-1.2/tests/Polyhedron/polydifference2.cc --- ppl-1.1/tests/Polyhedron/polydifference2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/polydifference2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::difference_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/polyhull1.cc ppl-1.2/tests/Polyhedron/polyhull1.cc --- ppl-1.1/tests/Polyhedron/polyhull1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/polyhull1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::upper_bound_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/polyhull2.cc ppl-1.2/tests/Polyhedron/polyhull2.cc --- ppl-1.1/tests/Polyhedron/polyhull2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/polyhull2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::upper_bound_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/polyhullifexact1.cc ppl-1.2/tests/Polyhedron/polyhullifexact1.cc --- ppl-1.1/tests/Polyhedron/polyhullifexact1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/polyhullifexact1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::upper_bound_assign_if_exact(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/polyhullifexact2.cc ppl-1.2/tests/Polyhedron/polyhullifexact2.cc --- ppl-1.1/tests/Polyhedron/polyhullifexact2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/polyhullifexact2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test NNC_Polyhedron::upper_bound_assign_if_exact(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/randphull1.cc ppl-1.2/tests/Polyhedron/randphull1.cc --- ppl-1.1/tests/Polyhedron/randphull1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/randphull1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Compute poly-hulls of random polytopes. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/refinewithcongruence1.cc ppl-1.2/tests/Polyhedron/refinewithcongruence1.cc --- ppl-1.1/tests/Polyhedron/refinewithcongruence1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/refinewithcongruence1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::refine_with_congruence(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/refinewithcongruences1.cc ppl-1.2/tests/Polyhedron/refinewithcongruences1.cc --- ppl-1.1/tests/Polyhedron/refinewithcongruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/refinewithcongruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::refine_with_congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/refinewithconstraint1.cc ppl-1.2/tests/Polyhedron/refinewithconstraint1.cc --- ppl-1.1/tests/Polyhedron/refinewithconstraint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/refinewithconstraint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::refine_with_constraint(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/refinewithconstraints1.cc ppl-1.2/tests/Polyhedron/refinewithconstraints1.cc --- ppl-1.1/tests/Polyhedron/refinewithconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/refinewithconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::refine_with_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/relations1.cc ppl-1.2/tests/Polyhedron/relations1.cc --- ppl-1.1/tests/Polyhedron/relations1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/relations1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::relation_with(g) and Polyhedron::relation_with(c). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/relations2.cc ppl-1.2/tests/Polyhedron/relations2.cc --- ppl-1.1/tests/Polyhedron/relations2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/relations2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::relation_with(c) and Polyhedron::relation_with(g). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/relations3.cc ppl-1.2/tests/Polyhedron/relations3.cc --- ppl-1.1/tests/Polyhedron/relations3.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/relations3.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::relation_with(c) and Polyhedron::relation_with(g). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/removespacedims1.cc ppl-1.2/tests/Polyhedron/removespacedims1.cc --- ppl-1.1/tests/Polyhedron/removespacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/removespacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Removing space dimensions from a polyhedron. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/removespacedims2.cc ppl-1.2/tests/Polyhedron/removespacedims2.cc --- ppl-1.1/tests/Polyhedron/removespacedims2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/removespacedims2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Removing space dimensions form an NNC polyhedron. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/simplifyusingcontext1.cc ppl-1.2/tests/Polyhedron/simplifyusingcontext1.cc --- ppl-1.1/tests/Polyhedron/simplifyusingcontext1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/simplifyusingcontext1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::simplify_using_context_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/simplifyusingcontext2.cc ppl-1.2/tests/Polyhedron/simplifyusingcontext2.cc --- ppl-1.1/tests/Polyhedron/simplifyusingcontext2.cc 1970-01-01 00:00:00.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/simplifyusingcontext2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -0,0 +1,59 @@ +/* Test Polyhedron::simplify_using_context_assign() with NNC polyhedra. + Copyright (C) 2001-2010 Roberto Bagnara + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) + +This file is part of the Parma Polyhedra Library (PPL). + +The PPL is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The PPL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. + +For the most up-to-date information see the Parma Polyhedra Library +site: http://bugseng.com/products/ppl/ . */ + +#include "ppl_test.hh" + +namespace { + +bool +test01() { + Variable A(0); + + NNC_Polyhedron ph1(1); + ph1.add_constraint(0 < A); + + NNC_Polyhedron ph2(1); + ph2.add_constraint(A <= 0); + + NNC_Polyhedron computed_result = ph1; + computed_result.simplify_using_context_assign(ph2); + + NNC_Polyhedron known_result(1); + known_result.add_constraint(0 < A); + + bool ok = (computed_result == known_result); + + print_constraints(ph1, "*** ph1 ***"); + print_constraints(ph2, "*** ph2 ***"); + print_constraints(computed_result, + "*** ph1.simplify_using_context_assign(ph2) ***"); + print_constraints(known_result, "*** known_result ***"); + + return ok; +} + +} // namespace + +BEGIN_MAIN + DO_TEST(test01); +END_MAIN diff -Nru ppl-1.1/tests/Polyhedron/smm1.cc ppl-1.2/tests/Polyhedron/smm1.cc --- ppl-1.1/tests/Polyhedron/smm1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/smm1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* SEND + MORE = MONEY. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/sparserow1.cc ppl-1.2/tests/Polyhedron/sparserow1.cc --- ppl-1.1/tests/Polyhedron/sparserow1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/sparserow1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the Sparse_Matrix class. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -598,6 +598,13 @@ return true; } +bool +test10() { + Sparse_Row sparse(2); + Dense_Row dense(sparse, 8, 8); + return true; +} + } // namespace BEGIN_MAIN @@ -610,6 +617,7 @@ DO_TEST(test07); DO_TEST(test08); DO_TEST(test09); + DO_TEST(test10); END_MAIN #else // !PPL_USE_SPARSE_MATRIX diff -Nru ppl-1.1/tests/Polyhedron/termination1.cc ppl-1.2/tests/Polyhedron/termination1.cc --- ppl-1.1/tests/Polyhedron/termination1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/termination1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the termination analysis facilities of the PPL. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/termination2.cc ppl-1.2/tests/Polyhedron/termination2.cc --- ppl-1.1/tests/Polyhedron/termination2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/termination2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the termination analysis facilities of the PPL. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/timeelapse1.cc ppl-1.2/tests/Polyhedron/timeelapse1.cc --- ppl-1.1/tests/Polyhedron/timeelapse1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/timeelapse1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::time_elapse_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/timeelapse2.cc ppl-1.2/tests/Polyhedron/timeelapse2.cc --- ppl-1.1/tests/Polyhedron/timeelapse2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/timeelapse2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test time_elapse_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/topclosed1.cc ppl-1.2/tests/Polyhedron/topclosed1.cc --- ppl-1.1/tests/Polyhedron/topclosed1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/topclosed1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::is_topologically_closed(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/topclosure1.cc ppl-1.2/tests/Polyhedron/topclosure1.cc --- ppl-1.1/tests/Polyhedron/topclosure1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/topclosure1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::topological_closure_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/unconstrain1.cc ppl-1.2/tests/Polyhedron/unconstrain1.cc --- ppl-1.1/tests/Polyhedron/unconstrain1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/unconstrain1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::unconstrain(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/universe1.cc ppl-1.2/tests/Polyhedron/universe1.cc --- ppl-1.1/tests/Polyhedron/universe1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/universe1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::is_universe(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/universe2.cc ppl-1.2/tests/Polyhedron/universe2.cc --- ppl-1.1/tests/Polyhedron/universe2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/universe2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the function is_universe() for a NNC_polyhedron. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/variablesset1.cc ppl-1.2/tests/Polyhedron/variablesset1.cc --- ppl-1.1/tests/Polyhedron/variablesset1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/variablesset1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the Variables_Set class. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/watchdog1.cc ppl-1.2/tests/Polyhedron/watchdog1.cc --- ppl-1.1/tests/Polyhedron/watchdog1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/watchdog1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the timeout facility of the library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/weightwatch1.cc ppl-1.2/tests/Polyhedron/weightwatch1.cc --- ppl-1.1/tests/Polyhedron/weightwatch1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/weightwatch1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test the weightwatch (i.e., deterministic timeout) facility of the library. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/wrap1.cc ppl-1.2/tests/Polyhedron/wrap1.cc --- ppl-1.1/tests/Polyhedron/wrap1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/wrap1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::wrap_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/wrap2.cc ppl-1.2/tests/Polyhedron/wrap2.cc --- ppl-1.1/tests/Polyhedron/wrap2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/wrap2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Polyhedron::wrap_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/writeconsys1.cc ppl-1.2/tests/Polyhedron/writeconsys1.cc --- ppl-1.1/tests/Polyhedron/writeconsys1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/writeconsys1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test operator<<(std::ostream&, const Constraint_System&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/writegensys1.cc ppl-1.2/tests/Polyhedron/writegensys1.cc --- ppl-1.1/tests/Polyhedron/writegensys1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/writegensys1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test operator<<(std::ostream&, const Generator_System&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/writepolyhedron1.cc ppl-1.2/tests/Polyhedron/writepolyhedron1.cc --- ppl-1.1/tests/Polyhedron/writepolyhedron1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/writepolyhedron1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test operator<<(std::ostream&, const Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/writepolyhedron2.cc ppl-1.2/tests/Polyhedron/writepolyhedron2.cc --- ppl-1.1/tests/Polyhedron/writepolyhedron2.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/writepolyhedron2.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test operator<<(std::ostream&, const Polyhedron&). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/writerelation1.cc ppl-1.2/tests/Polyhedron/writerelation1.cc --- ppl-1.1/tests/Polyhedron/writerelation1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/writerelation1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test operator<<(std::ostream& s, const Poly_Con_Relation& r) and operator<<(std::ostream& s, const Poly_Gen_Relation& r). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Polyhedron/writevariable1.cc ppl-1.2/tests/Polyhedron/writevariable1.cc --- ppl-1.1/tests/Polyhedron/writevariable1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Polyhedron/writevariable1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test operator<<(std::ostream& s, Variable v) and the related machinery. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/addcongruences1.cc ppl-1.2/tests/Powerset/addcongruences1.cc --- ppl-1.1/tests/Powerset/addcongruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/addcongruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::add_congruence(). Pointset_Powerset::add_congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/addconstraints1.cc ppl-1.2/tests/Powerset/addconstraints1.cc --- ppl-1.1/tests/Powerset/addconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/addconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::add_constraint(). Pointset_Powerset::add_constraints(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/affinedimension1.cc ppl-1.2/tests/Powerset/affinedimension1.cc --- ppl-1.1/tests/Powerset/affinedimension1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/affinedimension1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::affine_dimension(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/affineimage1.cc ppl-1.2/tests/Powerset/affineimage1.cc --- ppl-1.1/tests/Powerset/affineimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/affineimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ Pointset_Powerset::generalized_affine_image(), Pointset_Powerset::bounded_affine_image(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/affinepreimage1.cc ppl-1.2/tests/Powerset/affinepreimage1.cc --- ppl-1.1/tests/Powerset/affinepreimage1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/affinepreimage1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ Pointset_Powerset::generalized_affine_preimage(), Pointset_Powerset::bounded_affine_preimage(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/bounded1.cc ppl-1.2/tests/Powerset/bounded1.cc --- ppl-1.1/tests/Powerset/bounded1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/bounded1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::is_bounded(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/bounds1.cc ppl-1.2/tests/Powerset/bounds1.cc --- ppl-1.1/tests/Powerset/bounds1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/bounds1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::bounds_from_above(), Pointset_Powerset::bounds_from_below(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/closed1.cc ppl-1.2/tests/Powerset/closed1.cc --- ppl-1.1/tests/Powerset/closed1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/closed1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::is_topologically_closed(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/closure1.cc ppl-1.2/tests/Powerset/closure1.cc --- ppl-1.1/tests/Powerset/closure1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/closure1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::topological_closure_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/collapse1.cc ppl-1.2/tests/Powerset/collapse1.cc --- ppl-1.1/tests/Powerset/collapse1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/collapse1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::collapse(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/concatenate1.cc ppl-1.2/tests/Powerset/concatenate1.cc --- ppl-1.1/tests/Powerset/concatenate1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/concatenate1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::concatenate(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/contains1.cc ppl-1.2/tests/Powerset/contains1.cc --- ppl-1.1/tests/Powerset/contains1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/contains1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::contains(), Pointset_Powerset::strictly_contains(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/containsintegerpoint1.cc ppl-1.2/tests/Powerset/containsintegerpoint1.cc --- ppl-1.1/tests/Powerset/containsintegerpoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/containsintegerpoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::contains_integer_point(), Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/difference1.cc ppl-1.2/tests/Powerset/difference1.cc --- ppl-1.1/tests/Powerset/difference1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/difference1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::difference_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/discrete1.cc ppl-1.2/tests/Powerset/discrete1.cc --- ppl-1.1/tests/Powerset/discrete1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/discrete1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::is_discrete(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/disjoint1.cc ppl-1.2/tests/Powerset/disjoint1.cc --- ppl-1.1/tests/Powerset/disjoint1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/disjoint1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::is_disjoint_from(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/disjunct1.cc ppl-1.2/tests/Powerset/disjunct1.cc --- ppl-1.1/tests/Powerset/disjunct1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/disjunct1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::add_disjunct(). Pointset_Powerset::drop_disjunct(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/empty1.cc ppl-1.2/tests/Powerset/empty1.cc --- ppl-1.1/tests/Powerset/empty1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/empty1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::is_empty(), Pointset_Powerset::empty(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/entails1.cc ppl-1.2/tests/Powerset/entails1.cc --- ppl-1.1/tests/Powerset/entails1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/entails1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::definitely_entails(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/equals1.cc ppl-1.2/tests/Powerset/equals1.cc --- ppl-1.1/tests/Powerset/equals1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/equals1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::equals(), Pointset_Powerset::geometrically_equals(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/frombdshape1.cc ppl-1.2/tests/Powerset/frombdshape1.cc --- ppl-1.1/tests/Powerset/frombdshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/frombdshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::Pointset_Powerset(BD_Shape), Pointset_Powerset::Pointset_Powerset(Pointset_Powerset(BD_Shape)). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/frombox1.cc ppl-1.2/tests/Powerset/frombox1.cc --- ppl-1.1/tests/Powerset/frombox1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/frombox1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::Pointset_Powerset(Box), Pointset_Powerset::Pointset_Powerset(Pointset_Powerset(Box)). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/fromcongruences1.cc ppl-1.2/tests/Powerset/fromcongruences1.cc --- ppl-1.1/tests/Powerset/fromcongruences1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/fromcongruences1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset:: Pointset_Powerset(Congruence_System). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/fromconstraints1.cc ppl-1.2/tests/Powerset/fromconstraints1.cc --- ppl-1.1/tests/Powerset/fromconstraints1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/fromconstraints1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::Pointset_Powerset(Constraint_System). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/fromgrid1.cc ppl-1.2/tests/Powerset/fromgrid1.cc --- ppl-1.1/tests/Powerset/fromgrid1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/fromgrid1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::Pointset_Powerset(Grid), Pointset_Powerset::Pointset_Powerset(Pointset_Powerset(Grid)). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/fromoctagonalshape1.cc ppl-1.2/tests/Powerset/fromoctagonalshape1.cc --- ppl-1.1/tests/Powerset/fromoctagonalshape1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/fromoctagonalshape1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::Pointset_Powerset(BD_Shape), Pointset_Powerset::Pointset_Powerset(Pointset_Powerset(BD_Shape)). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/frompolyhedron1.cc ppl-1.2/tests/Powerset/frompolyhedron1.cc --- ppl-1.1/tests/Powerset/frompolyhedron1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/frompolyhedron1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::Pointset_Powerset(C_Polyhedron), Pointset_Powerset::Pointset_Powerset(NNC_Polyhedron). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/fromspacedimension1.cc ppl-1.2/tests/Powerset/fromspacedimension1.cc --- ppl-1.1/tests/Powerset/fromspacedimension1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/fromspacedimension1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset:: Pointset_Powerset(dimension_type, Degenerate_Element). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/intersection1.cc ppl-1.2/tests/Powerset/intersection1.cc --- ppl-1.1/tests/Powerset/intersection1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/intersection1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::intersection_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/Makefile.am ppl-1.2/tests/Powerset/Makefile.am --- ppl-1.1/tests/Powerset/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/tests/Powerset/Makefile.in ppl-1.2/tests/Powerset/Makefile.in --- ppl-1.1/tests/Powerset/Makefile.in 2013-10-28 12:44:55.000000000 +0000 +++ ppl-1.2/tests/Powerset/Makefile.in 2016-02-11 12:31:45.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -125,6 +125,7 @@ $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -144,7 +145,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/tests/Powerset/maxmin1.cc ppl-1.2/tests/Powerset/maxmin1.cc --- ppl-1.1/tests/Powerset/maxmin1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/maxmin1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::maximize(). Pointset_Powerset::minimize(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/meet1.cc ppl-1.2/tests/Powerset/meet1.cc --- ppl-1.1/tests/Powerset/meet1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/meet1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::meet_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/membytes1.cc ppl-1.2/tests/Powerset/membytes1.cc --- ppl-1.1/tests/Powerset/membytes1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/membytes1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::total_memory_in_bytes(). Pointset_Powerset::external_memory_in_bytes(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/powerset1.cc ppl-1.2/tests/Powerset/powerset1.cc --- ppl-1.1/tests/Powerset/powerset1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/powerset1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Powerset. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/reduce1.cc ppl-1.2/tests/Powerset/reduce1.cc --- ppl-1.1/tests/Powerset/reduce1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/reduce1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::omega_reduce(). Pointset_Powerset::pairwise_reduce(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/refinewith1.cc ppl-1.2/tests/Powerset/refinewith1.cc --- ppl-1.1/tests/Powerset/refinewith1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/refinewith1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -3,7 +3,7 @@ Pointset_Powerset::refine_with_congruence(). Pointset_Powerset::refine_with_congruences(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/relationwith1.cc ppl-1.2/tests/Powerset/relationwith1.cc --- ppl-1.1/tests/Powerset/relationwith1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/relationwith1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::relation_with(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -54,15 +54,15 @@ C_Polyhedron ph2(1); ph2.add_constraint(x == 2); - Pointset_Powerset ps(1, EMPTY); + Pointset_Powerset ps(1, EMPTY); ps.add_disjunct(ph1); ps.add_disjunct(ph2); Congruence cg((x %= 1) / 0); Poly_Con_Relation rel = ps.relation_with(cg); - Poly_Con_Relation known_rel = Poly_Con_Relation::saturates(); + Poly_Con_Relation known_rel = Poly_Con_Relation::strictly_intersects(); bool ok = (rel == known_rel); @@ -147,15 +147,15 @@ C_Polyhedron ph2(1); ph2.add_constraint(x == 2); - Pointset_Powerset ps(1, EMPTY); + Pointset_Powerset ps(1, EMPTY); ps.add_disjunct(ph1); ps.add_disjunct(ph2); Constraint c(x == 1); Poly_Con_Relation rel = ps.relation_with(c); - Poly_Con_Relation known_rel = Poly_Con_Relation::saturates(); + Poly_Con_Relation known_rel = Poly_Con_Relation::strictly_intersects(); bool ok = (rel == known_rel); @@ -262,6 +262,30 @@ return ok && ps.OK(); } +bool +test11() { + Variable x(0); + + C_Polyhedron ph1(1); + ph1.add_constraint(x <= 0); + + C_Polyhedron ph2(1); + ph2.add_constraint(x >= 2); + + Pointset_Powerset ps(1, EMPTY); + ps.add_disjunct(ph1); + ps.add_disjunct(ph2); + + Constraint c(x >= 2); + Poly_Con_Relation rel = ps.relation_with(c); + + Poly_Con_Relation known_rel = Poly_Con_Relation::strictly_intersects(); + + bool ok = (rel == known_rel); + + return ok && ps.OK(); +} + } // namespace BEGIN_MAIN @@ -275,4 +299,5 @@ DO_TEST(test08); DO_TEST(test09); DO_TEST(test10); + DO_TEST(test11); END_MAIN diff -Nru ppl-1.1/tests/Powerset/simplifyusingcontext1.cc ppl-1.2/tests/Powerset/simplifyusingcontext1.cc --- ppl-1.1/tests/Powerset/simplifyusingcontext1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/simplifyusingcontext1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::simplify_using_context_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/size1.cc ppl-1.2/tests/Powerset/size1.cc --- ppl-1.1/tests/Powerset/size1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/size1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::size(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/spacedims1.cc ppl-1.2/tests/Powerset/spacedims1.cc --- ppl-1.1/tests/Powerset/spacedims1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/spacedims1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -4,7 +4,7 @@ Pointset_Powerset::expand_space_dimensions(), Pointset_Powerset::fold_space_dimensions(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/universe1.cc ppl-1.2/tests/Powerset/universe1.cc --- ppl-1.1/tests/Powerset/universe1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/universe1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Test Pointset_Powerset::is_universe(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Powerset/upperbound1.cc ppl-1.2/tests/Powerset/upperbound1.cc --- ppl-1.1/tests/Powerset/upperbound1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Powerset/upperbound1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,7 +1,7 @@ /* Test Pointset_Powerset::upper_bound_assign(), Pointset_Powerset::least_upper_bound_assign(). Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/ppl_test.cc ppl-1.2/tests/ppl_test.cc --- ppl-1.1/tests/ppl_test.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/ppl_test.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Implementation of utility functions used in test programs. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/ppl_test.hh ppl-1.2/tests/ppl_test.hh --- ppl-1.1/tests/ppl_test.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/ppl_test.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Header file for test programs. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Random_Number_Generator_defs.hh ppl-1.2/tests/Random_Number_Generator_defs.hh --- ppl-1.1/tests/Random_Number_Generator_defs.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Random_Number_Generator_defs.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Random_Number_Generator class declaration. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Random_Number_Generator_inlines.hh ppl-1.2/tests/Random_Number_Generator_inlines.hh --- ppl-1.1/tests/Random_Number_Generator_inlines.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Random_Number_Generator_inlines.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Random_Number_Generator class implementation: inline functions. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Random_Number_Generator_types.hh ppl-1.2/tests/Random_Number_Generator_types.hh --- ppl-1.1/tests/Random_Number_Generator_types.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Random_Number_Generator_types.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -Nru ppl-1.1/tests/README ppl-1.2/tests/README --- ppl-1.1/tests/README 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/README 2016-02-11 12:31:26.000000000 +0000 @@ -1,5 +1,5 @@ Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) See below for the copying conditions. How To Use the Test Programs (If You Really Want To Use Them) @@ -86,7 +86,7 @@ -------- Copyright (C) 2001-2010 Roberto Bagnara -Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This document describes the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/tests/Watchdog/Makefile.am ppl-1.2/tests/Watchdog/Makefile.am --- ppl-1.1/tests/Watchdog/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Watchdog/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -46,7 +46,8 @@ LDADD = \ $(top_builddir)/tests/libppl_tests.a \ -$(top_builddir)/src/libppl.la +$(top_builddir)/src/libppl.la \ +@extra_libraries@ EXTRA_DIST = diff -Nru ppl-1.1/tests/Watchdog/Makefile.in ppl-1.2/tests/Watchdog/Makefile.in --- ppl-1.1/tests/Watchdog/Makefile.in 2013-10-28 12:44:55.000000000 +0000 +++ ppl-1.2/tests/Watchdog/Makefile.in 2016-02-11 12:31:45.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -109,6 +109,7 @@ $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -128,7 +129,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ @@ -623,7 +625,8 @@ LDADD = \ $(top_builddir)/tests/libppl_tests.a \ -$(top_builddir)/src/libppl.la +$(top_builddir)/src/libppl.la \ +@extra_libraries@ EXTRA_DIST = diff -Nru ppl-1.1/tests/Watchdog/watchdog1.cc ppl-1.2/tests/Watchdog/watchdog1.cc --- ppl-1.1/tests/Watchdog/watchdog1.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/tests/Watchdog/watchdog1.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Some simple tests for the basic functionality of PPL::Watchdog. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). diff -Nru ppl-1.1/utils/build_header.in ppl-1.2/utils/build_header.in --- ppl-1.1/utils/build_header.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/utils/build_header.in 2016-02-11 12:31:26.000000000 +0000 @@ -7,7 +7,7 @@ # Builds a self-contained C++ header file by performing recursive inclusion. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/utils/cm_cleaner.sh ppl-1.2/utils/cm_cleaner.sh --- ppl-1.1/utils/cm_cleaner.sh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/utils/cm_cleaner.sh 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ # Erases all files listed in the cutting markers found on stdin. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/utils/cm_splitter.sh ppl-1.2/utils/cm_splitter.sh --- ppl-1.1/utils/cm_splitter.sh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/utils/cm_splitter.sh 2016-02-11 12:31:26.000000000 +0000 @@ -2,7 +2,7 @@ # Splits stdin according to cutting markers. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/utils/Makefile.am ppl-1.2/utils/Makefile.am --- ppl-1.1/utils/Makefile.am 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/utils/Makefile.am 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/utils/Makefile.in ppl-1.2/utils/Makefile.in --- ppl-1.1/utils/Makefile.in 2013-10-28 12:44:55.000000000 +0000 +++ ppl-1.2/utils/Makefile.in 2016-02-11 12:31:45.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -16,7 +16,7 @@ # Automake source file for the Parma Polyhedra Library. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # @@ -108,6 +108,7 @@ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_ciao.m4 \ + $(top_srcdir)/m4/ac_check_cxx11.m4 \ $(top_srcdir)/m4/ac_check_fpu_control.m4 \ $(top_srcdir)/m4/ac_check_gmp.m4 \ $(top_srcdir)/m4/ac_check_sicstus_prolog.m4 \ @@ -127,7 +128,8 @@ $(top_srcdir)/m4/ac_prog_java.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javah.m4 \ - $(top_srcdir)/m4/ac_text_md5sum.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ac_text_md5sum.m4 \ + $(top_srcdir)/m4/ac_use_libtool.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/ocaml.m4 \ diff -Nru ppl-1.1/utils/text2cxxarray.in ppl-1.2/utils/text2cxxarray.in --- ppl-1.1/utils/text2cxxarray.in 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/utils/text2cxxarray.in 2016-02-11 12:31:26.000000000 +0000 @@ -7,7 +7,7 @@ # Convert an ASCII text into the declaration of a C++ array. # Copyright (C) 2001-2010 Roberto Bagnara -# Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) +# Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) # # This file is part of the Parma Polyhedra Library (PPL). # diff -Nru ppl-1.1/utils/timings.cc ppl-1.2/utils/timings.cc --- ppl-1.1/utils/timings.cc 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/utils/timings.cc 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Definitions of simple functions for printing timings. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL). @@ -41,8 +41,6 @@ # include #endif -using namespace std; - #ifdef PPL_HAVE_TIMEVAL // To save the time when start_clock is called. static struct timeval saved_ru_utime; @@ -53,20 +51,21 @@ #if PPL_HAVE_DECL_GETRUSAGE && defined(PPL_HAVE_TIMEVAL) struct rusage usage; if (getrusage(RUSAGE_SELF, &usage) != 0) { - cerr << "getrusage failed: " << strerror(errno) << endl; + std::cerr << "getrusage failed: " << strerror(errno) << std::endl; exit(1); } - else + else { saved_ru_utime = usage.ru_utime; + } #endif } void -print_clock(ostream& s) { +print_clock(std::ostream& s) { #if PPL_HAVE_DECL_GETRUSAGE && defined(PPL_HAVE_TIMEVAL) struct rusage usage; if (getrusage(RUSAGE_SELF, &usage) != 0) { - cerr << "getrusage failed: " << strerror(errno) << endl; + std::cerr << "getrusage failed: " << strerror(errno) << std::endl; exit(1); } else { @@ -79,10 +78,12 @@ secs = current_secs - saved_secs; if (current_usecs < saved_usecs) { csecs = (((1000000 + current_usecs) - saved_usecs) + 5000) / 10000; - if (csecs < 100) + if (csecs < 100) { --secs; - else + } + else { csecs = 0; + } } else { csecs = ((current_usecs - saved_usecs) + 5000) / 10000; @@ -93,7 +94,7 @@ } assert(csecs >= 0 && csecs < 100 && secs >= 0); const char fill_char = s.fill(); - s << secs << "." << setfill('0') << setw(2) << csecs; + s << secs << "." << std::setfill('0') << std::setw(2) << csecs; s.fill(fill_char); } #else diff -Nru ppl-1.1/utils/timings.hh ppl-1.2/utils/timings.hh --- ppl-1.1/utils/timings.hh 2013-10-28 12:38:33.000000000 +0000 +++ ppl-1.2/utils/timings.hh 2016-02-11 12:31:26.000000000 +0000 @@ -1,6 +1,6 @@ /* Declaration of simple functions for printing timings. Copyright (C) 2001-2010 Roberto Bagnara - Copyright (C) 2010-2013 BUGSENG srl (http://bugseng.com) + Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com) This file is part of the Parma Polyhedra Library (PPL).