Open leonbett opened 1 year ago
@leonbett: I don't understand the fix "(b)." The line in question is never reached in your example (I placed an assert False
to make sure), which would also be strange since your formula does not contain a semantic predicate... How did you come up with this part of the fix?
The remainder of the problem is probably related to str.to.code
.
There's currently no special support for this in ISLa (unlike to str.to.int
and str.len
), which is why Z3 also gets a regular expression attached for these variables, which is an overkill for an essentially arithmetic problem.
By the way, shouldn't it be str.to.int
in your formula and not str.to.code
??? I mean, "\x01"
is no valid digit anyway, right?
And it might make sense to use count(<start>, "<digit>", "6")
instead of (= 6 str.len(start))
.
And what do you expect from the equation of the elements of types <D>
and <D>
, which can only attain single character (non-numeric) values, with an arithmetic expression?
Thanks for your quick reply.
Regarding "(b)", seems like this was not required to make this work, sorry! :) (Both fixes were required for another problem I worked on, but probably "(a)" alone is sufficient in this case.)
As far as I understand, str.to.code
works on characters, i.e. it converts characters (singleton strings) such as 'A' to 0x41. str.to.int
converts strings that consist exclusively of digits to an int.
The constraints were extracted from a C program, which computes a checksum over the numerical values of a string, which is why it looks a bit funky.
As far as I understand,
str.to.code
works on characters, i.e. it converts characters (singleton strings) such as 'A' to 0x41.str.to.int
converts strings that consist exclusively of digits to an int.
I see. This makes sense!
Describe the bug ISLa takes a long time (~3-5 minutes) to solve a formula with many arithmetic constraints.
To Reproduce
pass
.Expected behavior I translated the same constraint to z3's theory:
(set-logic QF_AUFBV )
Z3 can then generate a solution in about a second.Is it possible to make ISLa produce a solution faster?
System/Installation Specs:
Additional context Possible reasons for the long solver time could be: (1) Z3's string solver is slow for arithmetic constraints, (2) str.to_code is slow.
Python program