-
Notifications
You must be signed in to change notification settings - Fork 0
/
solver.hpp
29 lines (23 loc) · 852 Bytes
/
solver.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
// (c) Jaco van de Pol
// Aarhus University
#ifndef SOLVER_H
#define SOLVER_H
#include "bdd_sylvan.hpp"
#include "circuit.hpp"
#include <set>
class Solver {
private:
const Circuit& c; // the circuit to solve
Sylvan_Bdd matrix; // keeps current state of algorithm
vector<std::set<int>> cleanup; // bdds that can be cleaned up at each stage
// The following functions must be called in this order:
void matrix2bdd(); // transform all gates up to output to BDD
void prefix2bdd(); // quantifier elimination up to first block
bool verdict() const;
void computeCleanup(); // compute when bdds can be cleaned up
public:
Solver(const Circuit& circuit);
bool solve();
Valuation example() const; // can only be called after solve()
};
#endif // SOLVER_H