-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwolimplmgr.cpp
49 lines (40 loc) · 1 KB
/
wolimplmgr.cpp
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
41
42
43
44
45
46
47
48
49
/*
* wolimplmgr.cpp
*
* Created on: Sep 24, 2014
* Author: user
*/
#include "wolimplmgr.h"
#include "common.h"
#include "wolexp.h"
#include "wolimplengine.h"
#include "wolgenengine.h"
#include "wolvalue.h"
namespace wolver {
void
WolImplMgr::initializeImplicationEngine() {
_impEngine = new WolWLImplEngine();
_genEngine = new WolSimpleGenEngine();
}
WolImplMgr::~WolImplMgr() {
delete _impEngine;
delete _genEngine;
}
std::pair<bool, nodeL>
WolImplMgr::performImplications(WolNodeSptr node) {
return _impEngine->performImplication(node);
}
std::pair<bool, nodeL>
WolImplMgr::performImplications(nodeL &inputs, nodeL &outputs) {
implResult res = _impEngine->performImplication(inputs, outputs);
if (res.first == false) {
// cleanup the stored values at the nodes
for( auto i : res.second) i->setSValue(nullptr);
}
return res;
}
WolValueSptr
WolImplMgr::performGenarilization(WolNodeSptr node, WolValueSptr value) {
return _genEngine->performGenerlization(node, value);
}
}