forked from DrorFried/Synthesis-via-Decomposition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Model.hpp
40 lines (30 loc) · 1.13 KB
/
Model.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 "Vector.hpp"
#include "Set.hpp"
#include "CNFFormula.hpp"
/**
* Class representing the function being synthesized.
*
* Stores a partition of the z variables into components controlling disjoint y variables,
* and for each component a list of MSS associated with that component.
*/
class Model
{
/** List of components as sets of z variables */
Vector<Set<BVar>> _componentList;
/** List of MSS for each component */
Vector<Vector<Set<BVar>>> _componentMSS;
public:
size_t componentCount() const;
size_t mssCount() const;
/** Returns list of components */
const Vector<Set<BVar>>& allComponents() const;
/** Returns list of MSS for a given component */
const Vector<Set<BVar>>& mssForComponent(size_t componentId) const;
/** Adds component to list of components and returns index as identifier */
size_t addComponent(Set<BVar> component);
/** Adds MSS to MSS list of the component with the given identifier */
void addMSS(size_t componentId, Set<BVar> mss);
/* Returns true if the given set is a subset of any MSS of the given component */
bool alreadyCovered(size_t componentId, const Set<BVar>& s);
};