Skip to content
Snippets Groups Projects
Commit 7b0020d2 authored by Thorsten Wißmann's avatar Thorsten Wißmann :guitar:
Browse files

Reset setofconclusions again

parent 79c5fa44
No related branches found
No related tags found
No related merge requests found
#include "setofconclusions.h"
#include <set>
#include "../formulas/formula.h"
SetOfConclusions::SetOfConclusions(int n, const vector<vector<bool> >& set){
no_of_literals=n;
......@@ -19,17 +17,19 @@ SetOfConclusions::SetOfConclusions(int n, const vector<vector<bool> >& set){
}
}
set<set<int> > SetOfConclusions::get_jth_conclusion(IFormula* f, bdd** underlying, int j){
set< set<int> > disj;
bdd SetOfConclusions::get_jth_conclusion(bdd** underlying, int j){
bdd b = bdd_false();
for(unsigned int i=0; i < rules[j].size(); i++){
set<int> conj;
bdd clause = bdd_true();
for(int k=0; k < no_of_literals; k++){
if(rules[j][i].get_p_i(k)==1)
conj.insert(f->get_variables_back(bdd_var(*(underlying[k]))));
clause = bdd_and(clause, *(underlying[k]));
if(rules[j][i].get_p_i(k)==0)
conj.insert(-f->get_variables_back(bdd_var(bdd_not(*(underlying[k])))));
clause = bdd_and(clause, bdd_not(*(underlying[k])));
}
disj.insert(conj);
b = bdd_or(clause, b);
}
return disj;
return b;
}
......@@ -3,7 +3,6 @@
#include <vector>
#include <set>
#include <stdio.h>
#include <cmath>
......@@ -19,8 +18,6 @@ using namespace std;
typedef vector<TruthAssignment> Conclusion;
class IFormula;
class SetOfConclusions{
private:
int no_of_literals;
......@@ -31,7 +28,10 @@ class SetOfConclusions{
SetOfConclusions(int n, const vector<vector<bool> >& set);
int number_of_conclusions(){return rules.size();};
set<set<int> > get_jth_conclusion(IFormula* f, bdd** underlying, int j);
bdd get_jth_conclusion(bdd** underlying, int j);
//bdd get_ith_conclusion(int i, bdd* bddarray);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment