[PPL-devel] [GIT] ppl/ppl(master): Added "quasi ranking functions" generation procedures to OCaml interface.

Enea Zaffanella zaffanella at cs.unipr.it
Thu Apr 1 09:49:20 CEST 2010


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Thu Apr  1 09:47:46 2010 +0200

Added "quasi ranking functions" generation procedures to OCaml interface.

---

 .../OCaml/ppl_interface_generator_ocaml_cc_code.m4 |   53 ++++++++++++++++++++
 .../OCaml/ppl_interface_generator_ocaml_ml_code.m4 |   16 ++++++
 .../ppl_interface_generator_ocaml_mli_code.m4      |   14 +++++
 ...terface_generator_ocaml_procedure_generators.m4 |    2 +
 4 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/interfaces/OCaml/ppl_interface_generator_ocaml_cc_code.m4 b/interfaces/OCaml/ppl_interface_generator_ocaml_cc_code.m4
index bb7984e..ad58ad4 100644
--- a/interfaces/OCaml/ppl_interface_generator_ocaml_cc_code.m4
+++ b/interfaces/OCaml/ppl_interface_generator_ocaml_cc_code.m4
@@ -1391,6 +1391,59 @@ CATCH_ALL
 
 ')
 
+m4_define(`ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _code',
+`dnl
+extern "C"
+CAMLprim value
+  ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS@
+  (value pset)
+  try {
+    CAMLparam1(pset);
+    CAMLlocal1(caml_return_value);
+  const @TOPOLOGY@@CPP_CLASS@& ppset
+     = *(reinterpret_cast<@TOPOLOGY@@CPP_CLASS@*>(p_ at CLASS@_val(pset)));
+  C_Polyhedron* ph_decreasing = new C_Polyhedron();
+  C_Polyhedron* ph_bounded = new C_Polyhedron();
+  all_affine_quasi_ranking_functions_MS(ppset, *ph_decreasing, *ph_bounded);
+  caml_return_value = caml_alloc(2, 0);
+  Store_field(caml_return_value, 0,
+              unregistered_value_p_Polyhedron(*ph_decreasing));
+  Store_field(caml_return_value, 1,
+              unregistered_value_p_Polyhedron(*ph_bounded));
+  CAMLreturn(caml_return_value);
+}
+CATCH_ALL
+
+')
+
+m4_define(`ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _2_code',
+`dnl
+extern "C"
+CAMLprim value
+  ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _2
+  (value pset_before, value pset_after)
+  try {
+    CAMLparam2(pset_before, pset_after);
+    CAMLlocal1(caml_return_value);
+  const @TOPOLOGY@@CPP_CLASS@& ppset_before
+     = *(reinterpret_cast<@TOPOLOGY@@CPP_CLASS@*>(p_ at CLASS@_val(pset_before)));
+  const @TOPOLOGY@@CPP_CLASS@& ppset_after
+     = *(reinterpret_cast<@TOPOLOGY@@CPP_CLASS@*>(p_ at CLASS@_val(pset_after)));
+  C_Polyhedron* ph_decreasing = new C_Polyhedron();
+  C_Polyhedron* ph_bounded = new C_Polyhedron();
+  all_affine_quasi_ranking_functions_MS_2(ppset_before, ppset_after,
+                                          *ph_decreasing, *ph_bounded);
+  caml_return_value = caml_alloc(2, 0);
+  Store_field(caml_return_value, 0,
+              unregistered_value_p_Polyhedron(*ph_decreasing));
+  Store_field(caml_return_value, 1,
+              unregistered_value_p_Polyhedron(*ph_bounded));
+  CAMLreturn(caml_return_value);
+}
+CATCH_ALL
+
+')
+
 m4_define(`ppl_ at CLASS@_wrap_assign_code',
 `dnl
 extern "C"
diff --git a/interfaces/OCaml/ppl_interface_generator_ocaml_ml_code.m4 b/interfaces/OCaml/ppl_interface_generator_ocaml_ml_code.m4
index 4268a25..160121b 100644
--- a/interfaces/OCaml/ppl_interface_generator_ocaml_ml_code.m4
+++ b/interfaces/OCaml/ppl_interface_generator_ocaml_ml_code.m4
@@ -619,6 +619,22 @@ external ppl_all_affine_ranking_functions_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS at _2:
 
 ')
 
+m4_define(`ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _code',
+`dnl
+external ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS@:
+  @!CLASS@ -> polyhedron * polyhedron
+  = "ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS@"
+
+')
+
+m4_define(`ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _2_code',
+`dnl
+external ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _2:
+  @!CLASS@ -> @!CLASS@ -> polyhedron * polyhedron
+  = "ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _2"
+
+')
+
 m4_define(`ppl_ at CLASS@_wrap_assign_code',
 `dnl
 external ppl_ at CLASS@_wrap_assign: @!CLASS@
diff --git a/interfaces/OCaml/ppl_interface_generator_ocaml_mli_code.m4 b/interfaces/OCaml/ppl_interface_generator_ocaml_mli_code.m4
index 86efeaa..df7eb0e 100644
--- a/interfaces/OCaml/ppl_interface_generator_ocaml_mli_code.m4
+++ b/interfaces/OCaml/ppl_interface_generator_ocaml_mli_code.m4
@@ -538,6 +538,20 @@ val ppl_all_affine_ranking_functions_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS at _2:
 
 ')
 
+m4_define(`ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _code',
+`dnl
+val ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS@:
+  @!CLASS@ -> polyhedron * polyhedron
+
+')
+
+m4_define(`ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _2_code',
+`dnl
+val ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _2:
+  @!CLASS@ -> @!CLASS@ -> polyhedron * polyhedron
+
+')
+
 val ppl_ at CLASS@_wrap_assign: @!CLASS@
                              -> bounded_integer_type_width
                              -> bounded_integer_type_representation
diff --git a/interfaces/OCaml/ppl_interface_generator_ocaml_procedure_generators.m4 b/interfaces/OCaml/ppl_interface_generator_ocaml_procedure_generators.m4
index 8b8ff38..19832d2 100644
--- a/interfaces/OCaml/ppl_interface_generator_ocaml_procedure_generators.m4
+++ b/interfaces/OCaml/ppl_interface_generator_ocaml_procedure_generators.m4
@@ -46,9 +46,11 @@ m4_define(`m4_procedure_list',
 ppl_termination_test_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS@ +simple,
 ppl_one_affine_ranking_function_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS@ +simple,
 ppl_all_affine_ranking_functions_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS@ +simple,
+ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS@ +simple,
 ppl_termination_test_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS at _2 +simple,
 ppl_one_affine_ranking_function_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS at _2 +simple,
 ppl_all_affine_ranking_functions_ at TERMINATION_ID@_ at TOPOLOGY@@CLASS at _2 +simple,
+ppl_all_affine_quasi_ranking_functions_MS_ at TOPOLOGY@@CLASS at _2 +simple,
 )
 ')
 




More information about the PPL-devel mailing list