/tutorial/backtracking/logigram/constraints/constraint_couple.e

http://github.com/tybor/Liberty · Specman e · 52 lines · 21 code · 6 blank · 25 comment · 0 complexity · ed975686693b81cad76ded338d29b2a1 MD5 · raw file

  1. -- See the Copyright notice at the end of this file.
  2. --
  3. deferred class CONSTRAINT_COUPLE
  4. --
  5. -- constraint on a couple of items NOT in the same group
  6. --
  7. inherit
  8. CONSTRAINT
  9. feature {ANY}
  10. item1, item2: ITEM
  11. -- the couple of items
  12. make (i1, i2: ITEM) is
  13. -- creation
  14. require
  15. i1.group /= i2.group
  16. do
  17. item1 := i1
  18. item2 := i2
  19. end
  20. get_items (collector: ITEM_COLLECTOR) is
  21. -- collect the items
  22. do
  23. collector.put(item1)
  24. collector.put(item2)
  25. end
  26. build_masks (builder: MASK_BUILDER) is
  27. -- creation of the mask for the constaint
  28. deferred
  29. end
  30. end -- class CONSTRAINT_COUPLE
  31. --
  32. -- ------------------------------------------------------------------------------------------------------------------------------
  33. -- Copyright notice below. Please read.
  34. --
  35. -- This file is free software, which comes along with SmartEiffel. This software is distributed in the hope that it will be
  36. -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  37. -- You can modify it as you want, provided this footer is kept unaltered, and a notification of the changes is added.
  38. -- You are allowed to redistribute it and sell it, alone or as a part of another product.
  39. --
  40. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  41. -- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  42. --
  43. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  44. --
  45. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  46. -- ------------------------------------------------------------------------------------------------------------------------------