Comments (10)
Boolector currently does not have an API function for this, but can handle it internally. We can add this functionality.
from boolector.
Thanks for reporting! This was a bug in the model generation and was not directly related to constant arrays, but was uncovered by it. This is now fixed on master e69de24.
from boolector.
I'm happy to assist on the implementation if that would be helpful. I haven't ever touched the Boolector codebase, but if you would give me a pointer for how this should be implemented I can give it a shot.
from boolector.
Thanks for the offer, but I already have an implementation for it, just need to test it. I'll probably merge it back to master early next week.
from boolector.
@cdisselkoen This is now implemented on master with commit a1b1408. However, we do not yet fully support equality over constant arrays. In this case, Boolector will abort with an error.
from boolector.
Awesome, thanks!
from boolector.
Hmm, is it possible this feature doesn't yet work in incremental solving mode? I have the following minimal example using the C API (omitting resource cleanup etc for brevity):
#include <stdio.h>
#include <stdlib.h>
#include "boolector.h"
int main() {
Btor *btor = boolector_new();
boolector_set_opt(btor, BTOR_OPT_MODEL_GEN, 2);
boolector_set_opt(btor, BTOR_OPT_INCREMENTAL, 1);
BoolectorSort eight_bit = boolector_bitvec_sort(btor, 8);
BoolectorSort array_sort = boolector_array_sort(btor, eight_bit, eight_bit);
BoolectorNode *fortytwo = boolector_unsigned_int(btor, 42, eight_bit);
BoolectorNode *const_array = boolector_const_array(btor, array_sort, fortytwo, 0);
BoolectorNode *seven = boolector_unsigned_int(btor, 7, eight_bit);
BoolectorNode *val = boolector_read(btor, const_array, seven);
printf("val is %sconstant\n", boolector_is_const(btor, val) ? "" : "not ");
// printf("val's bits are %s\n", boolector_get_bits(btor, val));
if (boolector_sat(btor) != BOOLECTOR_SAT) abort();
printf("assignment for val is %s\n", boolector_bv_assignment(btor, val));
}
If I comment out the BTOR_OPT_INCREMENTAL
line, it works fine: it gives a value of 42 for val
as expected. However, as written, with incremental mode, it gives a value of 0 for val
.
I'm testing on macOS with Boolector commit dfce248e
and the Lingeling solver.
from boolector.
@mpreiner Does this have a matching smt2 syntax? Z3 uses ((as const (Array Int Int)) 1))
, which I believe is non-standard.
from boolector.
I haven't added support in the SMT2 parser yet. I's on my TODO list. I'll let you know as soon as this is supported.
from boolector.
It's not in the standard (yet), but at least CVC4 and Z3 support defining constant arrays like that.
from boolector.
Related Issues (20)
- Is there any Distribution Constraint sv equivalent in boolector?
- Printing of Constant Arrays
- Linker error when building boolector from source HOT 2
- windows10 install pyboolector failed HOT 1
- ./configure.sh problem HOT 2
- install pyboolector failed on python 3.11 macos
- Stuck rewriting in rewrite_eq_exp
- Installing pyboolector fails for python 3.11.3 on Linux (Arch) HOT 2
- install error on macos 13.4.1
- Hello, how do I install Boolector and cryptominisat offline? HOT 1
- Make error while running btor2tools HOT 15
- How to install pyboolector for pypy HOT 1
- Tests fail to compile: error: no member named 'make_unique' in namespace 'std', etc. HOT 1
- FileNotFoundError when installing on windows
- BtorMC --kind not converging
- Wrong path for libbtor2parser.a in reach's Makefile HOT 1
- Difference of boolector_not and boolector_neg? HOT 1
- PyBoolector metadata version mismatch causing install failure HOT 4
- Tests fail to build: error: C++ versions less than C++14 are not supported HOT 3
- The test 'bv' doesn't finish in 8 mins
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boolector.