-
Notifications
You must be signed in to change notification settings - Fork 1
/
TLFormula.cpp
113 lines (87 loc) · 2.16 KB
/
TLFormula.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
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
/*
* File: TLFormula.cc
* Project: QUEST
* Author: Marc Diefenbruch, Axel M. Hirche
* Date: (C) 1997, 1998 University of Essen, Germany
*/
#include "SCL/SCObject.h"
#include "TLFormula.h"
#if _TL_INLINING == 0
#include "TLFormula.inl.h"
#endif
#include "TLFormulaUnary.h"
#include "TLFormulaBinary.h"
#include "TLFormulaSet.h" // Can't move this up, as it
// includes TLFormula.h!
#include "SCL/SCListIter.h"
#if _SC_DMALLOC
#include <dmalloc.h>
#endif
// ********** static data members *************
SCBoolean TLFormula::partialRewrite = false;
SCBoolean TLFormula::simplifyFormulae = false;
// ********** Methods *************
TLFormula::~TLFormula (void)
{
op = TLLETTER_UNDEFINED;
acceptanceSetNo = UNDEFINED_LISTINDEX;
}
SCNatural TLFormula::NumOfSymbols (void) const
{
return 1; // Only the operator.
}
SCStream& TLFormula::Display (SCStream& out) const
{
switch (op)
{
case AND:
return out << "&&";
case OR:
return out << "||";
case UNTIL:
return out << "U";
case V_OPER:
return out << "V";
case WAITFOR:
return out << "W";
case Z_OPER:
return out << "Z";
case IMPLIES:
return out << "->";
case EQUIVALENT:
return out << "<->";
case ALWAYS:
return out << "[]";
case EVENTUALLY:
return out << "<>";
case NEXTTIME:
return out << "X";
case NOT:
return out << "~";
default:
assert (false); // Should not be here!
return out;
}
}
SCBoolean TLFormula::operator== (const TLFormula& pPhi) const
{
if (op != pPhi.op)
return false;
return true;
}
SCBoolean TLFormula::operator== (const TLFormula* pPhi) const
{
return *this == *pPhi;
}
SCBoolean TLFormula::operator!= (const TLFormula& pPhi) const
{
return !(*this == pPhi);
}
SCBoolean TLFormula::operator!= (const TLFormula* pPhi) const
{
return !(*this == *pPhi);
}
SCBoolean TLFormula::HasAcceptanceStateSet (void) const
{
return false; // will be modified by <>, U, Z.
}