-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPreTableau.h
79 lines (55 loc) · 2.09 KB
/
PreTableau.h
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#pragma once
#include<vector>
#include "LTLFormulaSet.h"
#include "Model.h"
#include "Tableau.h"
class PreTableauState
{
public:
PreTableauState(int state, LTLFormulaSet&& formulas, const InterpretationFunction& interpretation);
PreTableauState(int state, LTLFormulaSet&& formulas, InterpretationFunction&& interpretation);
PreTableauState(PreTableauState&& state) = default;
~PreTableauState();
void addChild(PreTableauState& child);
void dissociate(bool fromParents = false, bool fromChildren = false);
bool isDissociated() const { return this->parents.size() == 0 && this->children.size() == 0; };
const std::vector<PreTableauState*>& getChildren() const { return this->children; };
const std::vector<PreTableauState*>& getParents() const { return this->parents; };
const LTLFormulaSet& getFormulas() const { return this->formulas; };
const InterpretationFunction& getInterpretationFunction() const { return this->interpretation; };
int getState() const { return this->state; };
LTLFormulaSet& getFormulas() { return this->formulas; };
InterpretationFunction& getInterpretationFunction() { return this->interpretation; };
bool operator==(const PreTableauState& other) const;
//bool operator==(const TableauState& other) const;
void setId() { this->id = PreTableauState::lastID++; };
int id;
static int lastID;
static void resetNextIds() { PreTableauState::lastID = 0; };
private:
int state;
LTLFormulaSet formulas;
InterpretationFunction interpretation;
std::vector<PreTableauState*> children;
std::vector<PreTableauState*> parents;
};
class PreTableau
{
public:
PreTableau(const Model* model, LTLFormula* formula);
~PreTableau();
void createInitialState();
void expRule();
void nextRule();
void preTableauComputation();
Tableau convertToTableau();
//TODO move to private, for tests
std::vector<std::unique_ptr<PreTableauState>> states;
std::vector<std::unique_ptr<PreTableauState>> preStates;
private:
const Model* const model;
LTLFormula* formula;
std::vector<PreTableauState*> currentStates;
std::vector<PreTableauState*> currentPreStates;
PreTableauState* rootState;
};