You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.6 KiB

  1. #include "Block.h"
  2. #include "StatementPrinterVisitor.h"
  3. #include <typeinfo>
  4. namespace storm {
  5. namespace pgcl {
  6. PgclBlock::PgclBlock(vector const &statements, std::shared_ptr<storm::expressions::ExpressionManager> expressions, bool hasLoop, bool hasNondet, bool hasObserve)
  7. : sequenceOfStatements(statements),
  8. expressions(expressions),
  9. loop(hasLoop),
  10. nondet(hasNondet),
  11. observe(hasObserve)
  12. {
  13. }
  14. iterator PgclBlock::begin() {
  15. return this->sequenceOfStatements.begin();
  16. }
  17. const_iterator PgclBlock::begin() const {
  18. return this->sequenceOfStatements.begin();
  19. }
  20. iterator PgclBlock::end() {
  21. return this->sequenceOfStatements.end();
  22. }
  23. const_iterator PgclBlock::end() const {
  24. return this->sequenceOfStatements.end();
  25. }
  26. bool PgclBlock::empty() {
  27. return this->sequenceOfStatements.empty();
  28. }
  29. element PgclBlock::front() {
  30. return this->sequenceOfStatements.front();
  31. }
  32. element PgclBlock::back() {
  33. return this->sequenceOfStatements.back();
  34. }
  35. unsigned long PgclBlock::size() {
  36. return this->sequenceOfStatements.size();
  37. }
  38. element PgclBlock::at(size_type n) {
  39. return this->sequenceOfStatements.at(n);
  40. }
  41. iterator PgclBlock::insert(iterator position, const element& statement) {
  42. return this->sequenceOfStatements.insert(position, statement);
  43. }
  44. void PgclBlock::clear() {
  45. this->sequenceOfStatements.clear();
  46. }
  47. std::shared_ptr<storm::expressions::ExpressionManager> const& PgclBlock::getExpressionManager() const {
  48. return this->expressions;
  49. }
  50. std::vector<storm::expressions::Variable> PgclBlock::getParameters() {
  51. return this->parameters;
  52. }
  53. bool PgclBlock::hasParameters() const {
  54. return !(this->parameters.empty());
  55. }
  56. bool PgclBlock::hasObserve() const {
  57. return this->observe;
  58. }
  59. bool PgclBlock::hasNondet() const {
  60. return this->nondet;
  61. }
  62. bool PgclBlock::hasLoop() const {
  63. return this->loop;
  64. }
  65. iterator PgclBlock::find(element &statement) {
  66. return std::find(this->sequenceOfStatements.begin(), this->sequenceOfStatements.end(), statement);
  67. }
  68. }
  69. }