#ifndef __FORENSICS_MINSEARCHER_HH__
#define __FORENSICS_MINSEARCHER_HH__

#include "forensics-gecode.hh"
#include "datasource.hh"


// Given an interval, it searches within the interval.

// Returns PATTERN_RESULT_FOUND if a match was found.
// In this case, "lower" is updated with the starting offset of the successful match.  Similarly, "maxEnd" is updated 
// with the end offset of the successful match.

// Returns PATTERN_RESULT_FAILED if no match was found.

// Returns PATTERN_RESULT_INDETERMINATE when it cannot proceed because the underlying datasource
// is unavailable.

// Note that there is a distinction between "definitely unavailable" and "may be unavailable".

enum MinSearcherResult {
  PATTERN_RESULT_FOUND,
  PATTERN_RESULT_FAILED,
  PATTERN_RESULT_INDETERMINATE,
};

class MinSearcher 
{
public:
  virtual MinSearcherResult find_minimum (Gecode::Space& home, DataSource& ds, int64_t& lower, int64_t upper, int64_t& maxEnd) = 0;
};

#endif
