ezSAT: Added frozen_literal() API

This commit is contained in:
Clifford Wolf 2014-03-03 02:13:17 +01:00
parent 895e9fc70c
commit d5bd93997c
2 changed files with 16 additions and 0 deletions

View File

@ -67,6 +67,20 @@ int ezSAT::literal(const std::string &name)
return literalsCache.at(name); return literalsCache.at(name);
} }
int ezSAT::frozen_literal()
{
int id = literal();
freeze(id);
return id;
}
int ezSAT::frozen_literal(const std::string &name)
{
int id = literal(name);
freeze(id);
return id;
}
int ezSAT::expression(OpId op, int a, int b, int c, int d, int e, int f) int ezSAT::expression(OpId op, int a, int b, int c, int d, int e, int f)
{ {
std::vector<int> args(6); std::vector<int> args(6);

View File

@ -79,6 +79,8 @@ public:
int value(bool val); int value(bool val);
int literal(); int literal();
int literal(const std::string &name); int literal(const std::string &name);
int frozen_literal();
int frozen_literal(const std::string &name);
int expression(OpId op, int a = 0, int b = 0, int c = 0, int d = 0, int e = 0, int f = 0); int expression(OpId op, int a = 0, int b = 0, int c = 0, int d = 0, int e = 0, int f = 0);
int expression(OpId op, const std::vector<int> &args); int expression(OpId op, const std::vector<int> &args);