#ifndef __FORENSICS_BLOCKREADPROPAGATOR_HH__
#define __FORENSICS_BLOCKREADPROPAGATOR_HH__

#include "forensics-gecode.hh"


// If m_blocks[i] is assigned, then remove [i,i] from unavailable.


class BlockRead : public Gecode::Propagator
{
protected:
  Gecode::ViewArray<Gecode::Int::IntView> blocksV;
  Gecode::Int::IntView unavailableV;
  Gecode::Int::IntView parent_unavailableV;

public:
  BlockRead (Gecode::Space& home, Gecode::ViewArray<Gecode::Int::IntView> blocksV, Gecode::Int::IntView unavailableV, Gecode::Int::IntView parent_unavailableV);

  BlockRead (Gecode::Space& home, bool share, BlockRead& p);

  virtual Gecode::Propagator* copy (Gecode::Space& home, bool share);

  virtual size_t dispose (Gecode::Space& home);

  virtual Gecode::PropCost cost (const Gecode::Space& home, const Gecode::ModEventDelta& med) const;

  virtual Gecode::ExecStatus propagate (Gecode::Space& home, const Gecode::ModEventDelta& med);

  static Gecode::ExecStatus post (Gecode::Space& home, Gecode::ViewArray<Gecode::Int::IntView> blocksV, Gecode::Int::IntView unavailableV, Gecode::Int::IntView parent_unavailableV);
};


void block_read (Gecode::Space& home, Gecode::IntVarArray blocks, Gecode::IntVar unavailable, Gecode::IntVar parent_unavailable);

#endif

