forked from DrorFried/Synthesis-via-Decomposition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMSSGenerator.hpp
40 lines (31 loc) · 1.09 KB
/
MSSGenerator.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include "CNFFormula.hpp"
#include "Set.hpp"
#include "Vector.hpp"
#include "Optional.hpp"
#include "open-wbo/MaxSATFormula.h"
#include "open-wbo/algorithms/Alg_WBO.h"
/**
* Class that generates Maximal Satisfiable Subsets using a MaxSAT solver.
*/
class MSSGenerator
{
openwbo::MaxSATFormula maxSatFormula; /**< formula encoding the constraints for the problem */
//openwbo::WBO maxSatSolver; /**< MaxSAT solver used for generating the MSS */
Set<BVar> allIndicatorVars;
/** Add hard clause */
void enforceClause(const CNFClause& clause);
/** Add hard clause blocking given MSS */
void blockMSS(const Set<BVar>& mss);
public:
MSSGenerator(Set<BVar> indicatorVarSet,
const Vector<BVar>& indicators,
const Vector<CNFClause>& clauses);
/**
* Generate new MSS, or nothing if there are no MSS left.
* MSS is represented by the set of Z and Y variables set to true.
*/
Optional<Set<BVar>> newMSS();
/** Generate new MSS containing the given variables, or nothing if there are no MSS left */
Optional<Set<BVar>> newMSSCovering(const Set<BVar>& vars);
};