/*******************************************************************\

Module: SAT-optimizer for minimizing expressions

Author: Georg Weissenbacher
    
Date: July 2006

Purpose: Find a satisfying assignment that minimizes a given set
         of symbols

\*******************************************************************/

#ifndef CPROVER_CEGAR_SAT_OPTIMIZER_H
#define CPROVER_CEGAR_SAT_OPTIMIZER_H

#include <propsolve/satcheck.h>
#include <propdec/bv_pointers.h>
#include <propdec/prop.h>

typedef std::list<exprt> minimization_listt;

class satcheck_minimizert:public satcheckt
{
public:
  satcheck_minimizert(): satcheckt() { }
  // prop_solve with constraints can be called several times
  virtual resultt prop_solve(const std::list<literalt> &constraints);
};

class bv_minimizing_dect:public bv_pointerst
{
public:
  virtual const std::string description()
  { return "Bit vector miminizing SAT"; }

  bv_minimizing_dect():
    bv_pointerst(satcheck) { }

  bool minimize(const minimization_listt &symbols);

  satcheck_minimizert satcheck;
};

#endif
