
Module: ppl/ppl Branch: pip Commit: 18458e693b80381ff7e09654424c32694b40c557 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=18458e693b803...
Author: Abramo Bagnara abramo.bagnara@gmail.com Date: Sun Jun 14 20:26:12 2009 +0200
Added draft PIP_Tree implementation.
---
src/PIP_Tree.cc | 67 +++++++++++++++++++++++++++++++++++++++++++++++ src/PIP_Tree.defs.hh | 63 ++++++++++++++++++++++++++++++++++++++++++++ src/PIP_Tree.inlines.hh | 34 ++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 0 deletions(-)
diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc new file mode 100644 index 0000000..cf6d9ae --- /dev/null +++ b/src/PIP_Tree.cc @@ -0,0 +1,67 @@ +/* PIP_Tree related class implementation: non-inline functions. + Copyright (C) 2001-2009 Roberto Bagnara bagnara@cs.unipr.it + +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://www.cs.unipr.it/ppl/ . */ + +#include <ppl-config.h> +#include <PIP_Tree.defs.hh> + +namespace Parma_Polyhedra_Library { + +PIP_Decision_Node::~PIP_Decision_Node() { + delete if_false; + delete if_true; +} + +const PIP_Solution_Node* +PIP_Tree_Node::as_solution() const { + return 0; +} +PIP_Solution_Node* +PIP_Tree_Node::as_solution() { + return 0; +} +const PIP_Decision_Node* +PIP_Tree_Node::as_decision() const { + return 0; +} +PIP_Decision_Node* +PIP_Tree_Node::as_decision() { + return 0; +} +const PIP_Solution_Node* +PIP_Solution_Node::as_solution() const { + return this; +} +PIP_Solution_Node* +PIP_Solution_Node::as_solution() { + return this; +} +const PIP_Decision_Node* +PIP_Decision_Node::as_decision() const { + return this; +} +PIP_Decision_Node* +PIP_Decision_Node::as_decision() { + return this; +} + +} // namespace Parma_Polyhedra_Library + diff --git a/src/PIP_Tree.defs.hh b/src/PIP_Tree.defs.hh new file mode 100644 index 0000000..f9b1cc6 --- /dev/null +++ b/src/PIP_Tree.defs.hh @@ -0,0 +1,63 @@ +/* PIP_Tree class declaration. + Copyright (C) 2001-2009 Roberto Bagnara bagnara@cs.unipr.it + +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://www.cs.unipr.it/ppl/ . */ + +#ifndef PPL_PIP_Tree_defs_hh +#define PPL_PIP_Tree_defs_hh 1 + +namespace Parma_Polyhedra_Library { + +class PIP_Solution_Node; +class PIP_Decision_Node; + +class PIP_Tree_Node { +public: + virtual const PIP_Solution_Node* as_solution() const; + virtual PIP_Solution_Node* as_solution(); + virtual const PIP_Decision_Node* as_decision() const; + virtual PIP_Decision_Node* as_decision(); + virtual ~PIP_Tree_Node(); +}; + +class PIP_Solution_Node : public PIP_Tree_Node { +public: + const PIP_Solution_Node* as_solution() const; + PIP_Solution_Node* as_solution(); + // get_bindings(); +}; + +class PIP_Decision_Node : public PIP_Tree_Node { + PIP_Tree_Node* if_false; + PIP_Tree_Node* if_true; +public: + ~PIP_Decision_Node(); + const PIP_Decision_Node* as_decision() const; + PIP_Decision_Node* as_decision(); + const PIP_Tree_Node* if_node(bool v) const; + PIP_Tree_Node* if_node(bool v); + // Constraint_System* get_constraints(); +}; + +typedef PIP_Tree_Node* PIP_Tree; + +} // namespace Parma_Polyhedra_Library + +#endif // !defined(PPL_PIP_Tree_defs_hh) diff --git a/src/PIP_Tree.inlines.hh b/src/PIP_Tree.inlines.hh new file mode 100644 index 0000000..8089917 --- /dev/null +++ b/src/PIP_Tree.inlines.hh @@ -0,0 +1,34 @@ +/* PIP_Tree related class implementation: inline functions. + Copyright (C) 2001-2009 Roberto Bagnara bagnara@cs.unipr.it + +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://www.cs.unipr.it/ppl/ . */ + +#ifndef PPL_PIP_Tree_inlines_hh +#define PPL_PIP_Tree_inlines_hh 1 + +namespace Parma_Polyhedra_Library { + +inline +PIP_Tree_Node::~PIP_Tree_Node() { +} + +} // namespace Parma_Polyhedra_Library + +#endif // !defined(PPL_PIP_Tree_inlines_hh)