- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpredicate.cpp
More file actions
Latest commit
42 lines (37 loc) · 649 Bytes
/
Copy pathpredicate.cpp
File metadata and controls
42 lines (37 loc) · 649 Bytes
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
#include"predicate.h"
Predicate::Predicate(string n)
{
name = n;
}
vector<string> Predicate::paramNames()
{
vector<string> res;
for (unsignedint i =0; i < params.size(); i++)
{
res.push_back(params[i]->toString());
}
return res;
}
string Predicate::toString()
{
string res = name;
res += "(";
for (unsignedint i = 0; i < params.size(); i++)
{
if (i) res += ",";
res += params[i]->toString();
}
res += ")";
return res;
}
voidPredicate::addParam(tok t)
{
params.push_back(newParameter(t));
}
Predicate::~Predicate()
{
for (unsignedint i = 0; i < params.size(); i++)
{
delete params[i];
}
}