3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 21:38:44 +00:00

local state

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-05-11 17:11:52 -07:00
parent 2e627e78bc
commit bf6ab3fc03
2 changed files with 9 additions and 7 deletions

View file

@ -106,6 +106,7 @@ tbv* tbv_manager::allocate(char const* bv) {
if (*bv == '0') set(*result, i++, tbit::BIT_0);
else if (*bv == '1') set(*result, i++, tbit::BIT_1);
else if (*bv == '*') i++;
else if (*bv == 'x') i++;
else if (i == 0 && (*bv == ' ' || *bv == '\t')) ;
else break;
++bv;

View file

@ -93,7 +93,7 @@ datalog::ddnf_core* populate_ddnf(char const* file, ptr_vector<tbv>& tbvs) {
std::getline(is, line);
tbv* t = tbvm.allocate(line.c_str());
ddnf->insert(*t);
//tbvm.display(std::cout << line << " ", *t) << "\n";
IF_VERBOSE(2, tbvm.display(verbose_stream() << line << " ", *t) << "\n";);
tbvs.push_back(t);
if (p > P) {
std::cout << "port number " << p << " too big " << P << "\n";
@ -110,16 +110,17 @@ datalog::ddnf_core* populate_ddnf(char const* file, ptr_vector<tbv>& tbvs) {
}
static void read_args(char ** argv, int argc) {
if (argc == 3) {
g_file = argv[2];
static void read_args(char ** argv, int argc, int& i) {
if (argc = i + 2) {
g_file = argv[i + 1];
++i;
return;
}
if (!g_file) {
std::cout << "Need routing table file as argument. Arguments provided: ";
for (int i = 0; i < argc; ++i) {
std::cout << argv[i] << " ";
for (int j = i; j < argc; ++j) {
std::cout << argv[j] << " ";
}
std::cout << "\n";
exit(0);
@ -128,7 +129,7 @@ static void read_args(char ** argv, int argc) {
}
void tst_ddnf(char ** argv, int argc, int& i) {
read_args(argv, argc);
read_args(argv, argc, i);
ptr_vector<tbv> tbvs;
datalog::ddnf_core* ddnf = populate_ddnf(g_file, tbvs);
create_forwarding(g_file, *ddnf, tbvs);