[PPL-devel] [GIT] ppl/ppl(termination): Updated the first item for TODO and removed code for

Patricia Hill p.m.hill at leeds.ac.uk
Fri Mar 19 20:57:16 CET 2010


Module: ppl/ppl
Branch: termination
Commit: a55e13a59c2877379aa61686371696e30dbabcd1
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=a55e13a59c2877379aa61686371696e30dbabcd1

Author: Patricia Hill <p.m.hill at leeds.ac.uk>
Date:   Fri Mar 19 13:37:34 2010 +0000

Updated the first item for TODO and removed code for
linear expression is_zero() and all_homogeneous_terms_are_zero()
from the Prolog interface.

---

 TODO                                               |    2 +-
 ...l_interface_generator_java_classes_java_code.m4 |    9 +++++++
 ...nterface_generator_java_procedure_generators.m4 |    8 +++++-
 interfaces/Prolog/ppl_prolog_common.cc             |   24 --------------------
 interfaces/Prolog/ppl_prolog_common.defs.hh        |    6 -----
 5 files changed, 17 insertions(+), 32 deletions(-)

diff --git a/TODO b/TODO
index 1b37708..db3904f 100644
--- a/TODO
+++ b/TODO
@@ -4,7 +4,7 @@ Enhancements for PPL 0.11
 
 - Interface Linear_Expression::is_zero()
   and Linear_Expression::all_homogeneous_terms_are_zero()
-  for all the non-C++ interfaces.
+  for the Java and Ocaml interfaces.
 - Handle std::logic_error (now thrown in case watchdogs are not
   available) in all the interfaces.
 - Make all the *affine*image() methods uniform as far as the
diff --git a/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java_code.m4 b/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java_code.m4
index d3131a1..4b97dc1 100644
--- a/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java_code.m4
+++ b/interfaces/Java/parma_polyhedra_library/ppl_interface_generator_java_classes_java_code.m4
@@ -651,3 +651,12 @@ ___BEGIN_OF_FILE___ @CLASS at .java << ___END_OF_FILE___
                             @CLASS@ q,
                             By_Reference<Boolean> finite);
 ')
+
+m4_define(`ppl_termination_test_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS at _code',
+`dnl
+___END_OF_FILE___
+___BEGIN_OF_FILE___ @CLASS at .java << ___END_OF_FILE___
+    public native boolean
+    termination_test_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS@(@TOPOLOGY@@CLASS@ arg);
+
+')
diff --git a/interfaces/Java/ppl_interface_generator_java_procedure_generators.m4 b/interfaces/Java/ppl_interface_generator_java_procedure_generators.m4
index 5033b8f..2bd99f5 100644
--- a/interfaces/Java/ppl_interface_generator_java_procedure_generators.m4
+++ b/interfaces/Java/ppl_interface_generator_java_procedure_generators.m4
@@ -43,5 +43,11 @@ m4_define(`m4_procedure_list',
 ppl_free_ at CLASS@/1 +all,
 ppl_ at CLASS@_hashcode/2 +all -box,
 ppl_ at CLASS@_string/1 +all,
-ppl_ at CLASS@_wrap_assign/8 +simple)dnl
+ppl_ at CLASS@_wrap_assign/8 +simple,
+ppl_termination_test_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS@/1 +simple,
+ppl_one_affine_ranking_function_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS@/2 +simple,
+ppl_all_affine_ranking_functions_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS@/2 +simple,
+ppl_termination_test_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS at _2/2 +simple,
+ppl_one_affine_ranking_function_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS at _2/3 +simple,
+ppl_all_affine_ranking_functions_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS at _2/3 +simple,)dnl
 ')
diff --git a/interfaces/Prolog/ppl_prolog_common.cc b/interfaces/Prolog/ppl_prolog_common.cc
index 19c666f..5a186e8 100644
--- a/interfaces/Prolog/ppl_prolog_common.cc
+++ b/interfaces/Prolog/ppl_prolog_common.cc
@@ -1704,30 +1704,6 @@ ppl_Coefficient_max(Prolog_term_ref t_max) {
 }
 
 extern "C" Prolog_foreign_return_type
-ppl_Linear_Expression_is_zero(Prolog_term_ref t_le_expr) {
-  static const char* where = "ppl_Linear_Expression_is_zero/1";
-  try {
-    Linear_Expression le_expr = build_linear_expression(t_le_expr, where);
-    if (le_expr.is_zero())
-      return PROLOG_SUCCESS;
-  }
-  CATCH_ALL;
-}
-
-extern "C" Prolog_foreign_return_type
-ppl_Linear_Expression_all_homogeneous_terms_are_zero(Prolog_term_ref t_le_expr)
-{
-  static const char* where
-    = "ppl_Linear_Expression_all_homogeneous_terms_are_zero/1";
-  try {
-    Linear_Expression le_expr = build_linear_expression(t_le_expr, where);
-    if (le_expr.all_homogeneous_terms_are_zero())
-      return PROLOG_SUCCESS;
-  }
-  CATCH_ALL;
-}
-
-extern "C" Prolog_foreign_return_type
 ppl_new_MIP_Problem_from_space_dimension
 (Prolog_term_ref t_nd, Prolog_term_ref t_mip) {
   static const char* where = "ppl_MIP_Problem_from_space_dimension/2";
diff --git a/interfaces/Prolog/ppl_prolog_common.defs.hh b/interfaces/Prolog/ppl_prolog_common.defs.hh
index 3511064..33af32d 100644
--- a/interfaces/Prolog/ppl_prolog_common.defs.hh
+++ b/interfaces/Prolog/ppl_prolog_common.defs.hh
@@ -719,12 +719,6 @@ extern "C" Prolog_foreign_return_type
 ppl_Coefficient_max(Prolog_term_ref t_max);
 
 extern "C" Prolog_foreign_return_type
-ppl_Linear_Expression_is_zero(Prolog_term_ref t_bool);
-
-extern "C" Prolog_foreign_return_type
-ppl_Linear_Expression_all_homogeneous_terms_are_zero(Prolog_term_ref t_bool);
-
-extern "C" Prolog_foreign_return_type
 ppl_new_MIP_Problem_from_space_dimension
 (Prolog_term_ref t_nd, Prolog_term_ref t_mip);
 




More information about the PPL-devel mailing list