-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTLState.h
More file actions
164 lines (130 loc) · 7.67 KB
/
Copy pathTLState.h
File metadata and controls
164 lines (130 loc) · 7.67 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/* File: TLState.h
Author: Axel Hirche, Marc Diefenbruch
Project: QUEST
Date: (C) 1997, 1998 University of Essen, Germany
*/
#ifndef _TLSTATE_H_
#define _TLSTATE_H_
#include "TL.h"
#include "SCL/SCStream.h"
class TLNode;
class TLState
{
friend class TLNode;
friend class SCStream& operator<< (class SCStream&, TLState&);
public:
TLState (const TLState*); // Copy constructor.
TLState (const TLState&); // Copy constructor.
TLState (const TLNode*); // Create state from node.
TLState (const TLNode&);
TLState (class TLFormulaSet* NowSet, // Set of formulae that have
// to be valid in this state.
class TLFormulaSet* NextSet, // Set of formulae, that have
// to be valid in the next
// state.
class TLStateList *inEdgesSet, // List of incoming edges.
class TLStateList *outEdgesSet, // List of outgoing egdes.
SCBitSet acceptSets = 0ULL,
// Set containing all formulae, for
// which the state is an accepting
// state.
SCBoolean init = false); // Indicates whether state
// is an initial state.
~TLState (void);
class TLFormulaSet* GetNow (void) const;
class TLFormulaSet* GetNext (void) const;
SCNatural GetName (void) const;
void SetIsInitial (SCBoolean); // Make state an initial state.
SCBoolean IsInitial (void) const; // Determine, whether state
// is initial.
class TLStateList* GetInEdges (void);
class TLStateList* GetOutEdges (void);
SCBoolean AddToIncoming (TLState*);
SCBoolean AddToOutgoing (TLState*);
SCBoolean MergeToIncoming (const class TLStateList& toMerge);
// Merge toMerge into inEdges
// as if the lists were sets, and
// insert this into outEdges
// of every state from toMerge
// that is added to this->inEdges.
SCNatural NumOfSuccessors (void) const;
SCBoolean NowIsValid (void) const; // Evaluates all atomic
// propositions in nowSet and
// returns true, iff all of
// them evaluate to true.
SCBoolean IsAcceptingState (void) const;
// True, if *this is an
// accepting state, i.e.
// if acceptanceSets
// is non-empty.
void SetUpAcceptanceSets (TLFormulaSet* acceptSetPhiSet);
// This requires that nowSet
// contains ALL propositions
// not onyl the atomics.
// acceptSetPhiSet is a formula
// set containing all formulae
// that have an aceptance state
// set.
SCBitSet GetAcceptanceSets (void);
SCBoolean operator== (const TLState&) const;
SCBoolean operator== (const class TLNode&) const;
SCBoolean operator!= (const TLState&) const;
SCBoolean operator!= (const class TLNode&) const;
static void Initialize (SCBoolean pTrueEquivEmpty,
// {TRUE} == {}
SCBoolean pNowIsPureAtomic,
// Restrict nowSet to
// atomic propositions
// thereby possibly reducing
// the number of generated
// states.
SCBoolean pNowDisplaysOnlyAtomics,
// Do NOT restrict nowSet to
// atomic propositions but
// display only the atomic
// propositions in nowSet.
SCBoolean pExtendedAutomaton,
// Extend the basic set of
// operators.
SCBoolean pGreedyAutomaton);
// Try to advance to an
// accepting state as quickly as
// possible. This is a heuristic,
// that will help in determining
// the fulfillabilty of a
// formula, but may not help with
// the crossproduct automaton.
static SCNatural GetLastName (void); // Return the last name used.
static SCNatural GetNextname (void); // Return the next valid name and
// update counter.
SCBoolean isReallyAccepting; // Use this to see whether a
// state is an accepting state
// because it fulfills a formula
// or just because no formula
// with acceptance state set is
// in nowSet.
protected:
TLState (void); // Standard constructor.
SCBoolean SetInEdges (class TLStateList* l);
SCBoolean SetOutEdges (class TLStateList* l);
class TLFormulaSet* nowSet;
class TLFormulaSet* nextSet;
class TLStateList* inEdges;
class TLStateList* outEdges;
SCBoolean isInitial; // If true, the state is an
// initial state.
SCNatural name;
SCBitSet acceptanceSets;
static SCNatural nextName;
static SCBoolean trueEquivEmpty;
static SCBoolean nowIsPureAtomic;
static SCBoolean nowDisplaysOnlyAtomics;
static SCBoolean extendedAutomaton;
static SCBoolean greedyAutomaton;
};
class SCStream& operator<< (class SCStream&, TLState&);
class SCStream& operator<< (class SCStream&, TLState*);
#if _TL_INLINING_
#include "TLState.inl.h"
#endif // _TL_INLINING_
#endif // _TLSTATE_H_