/src/tools/semantics/code/assertions/liberty_composed_assertions.e

http://github.com/tybor/Liberty · Specman e · 69 lines · 47 code · 8 blank · 14 comment · 1 complexity · b7d4441152c3a5027f5e4778532c1e53 MD5 · raw file

  1. -- This file is part of Liberty Eiffel.
  2. --
  3. -- Liberty Eiffel is free software: you can redistribute it and/or modify
  4. -- it under the terms of the GNU General Public License as published by
  5. -- the Free Software Foundation, version 3 of the License.
  6. --
  7. -- Liberty Eiffel is distributed in the hope that it will be useful,
  8. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. -- GNU General Public License for more details.
  11. --
  12. -- You should have received a copy of the GNU General Public License
  13. -- along with Liberty Eiffel. If not, see <http://www.gnu.org/licenses/>.
  14. --
  15. deferred class LIBERTY_COMPOSED_ASSERTIONS
  16. inherit
  17. LIBERTY_ASSERTIONS
  18. feature {ANY}
  19. left, right: LIBERTY_ASSERTIONS
  20. feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
  21. mark_reachable_code (mark: INTEGER) is
  22. do
  23. left.mark_reachable_code(mark)
  24. right.mark_reachable_code(mark)
  25. end
  26. feature {LIBERTY_FEATURE, LIBERTY_ASSERTIONS}
  27. specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
  28. local
  29. l, r: LIBERTY_ASSERTIONS
  30. do
  31. l := left.specialized_in(a_type)
  32. r := right.specialized_in(a_type)
  33. if l = left and then r = Void then
  34. Result := Current
  35. else
  36. Result := twin
  37. Result.set_specialized_in(l, r)
  38. end
  39. end
  40. feature {LIBERTY_COMPOSED_ASSERTIONS}
  41. set_specialized_in (l: like left; r: like right) is
  42. do
  43. left := l
  44. right := r
  45. end
  46. feature {}
  47. make (a_left: like left; a_right: like right) is
  48. require
  49. a_left /= Void
  50. a_right /= Void
  51. do
  52. left := a_left
  53. right := a_right
  54. ensure
  55. left = a_left
  56. right = a_right
  57. end
  58. invariant
  59. left /= Void
  60. right /= Void
  61. end