Dear Yoel Kim,
Am 28.11.24 um 09:32 schrieb Yoel Kim:
> Firstly, I reviewed the 'util/predicates/precisionConverter/BVConverter.java'
> code and noticed that it seems unable to parse array types, likely due to
> the getSMTType method:
Yes, that may well be. The conversion of predicates from one theory to
another was an older side project, and it is likely that it only
supports a limited subset of formulas and theories.
> Secondly, even when I do not use the PrecisionConverter (by setting the
> options 'cpa.predicate.encodeBitvectorAs = INTEGER' and
> 'options.encodePredicates = PrecisionConverter.DISABLE'), an error still
> occurs.
> However, the error message differs from the previous one:
>
> org.sosy_lab.cpachecker.cpa.predicate.persistence.PredicatePersistenceUtils$
> PredicateParsingFailedException: Parsing failed in line 8 of predmap.txt:
> unrecognized text: :
> at org.sosy_lab.cpachecker.cpa.predicate.persistence.
> PredicateMapParser.parsePredicates(PredicateMapParser.java:261)
> at org.sosy_lab.cpachecker.cpa.predicate.persistence.
> PredicateMapParser.parsePredicates(PredicateMapParser.java:118)
>
> This issue seems to be related to the util/predicates/precisionConverter/FormulaParser.java
> code, which I am unable to fully interpret.
FormulaParser should not be used at all in this configuration.
We pass the formula to the SMT solver that is used and let it parse it.
The predmap.txt that you sent in your original mail contains invalid
SMTLIB definitions, at least according to MathSAT.
Identifiers with :: need to be quoted within |...|.
The syntax for an array type is (Array Int Int), and there are some
missing parentheses.
After fixing that, CPAchecker can parse the file.
> Do I need to provide predicates in the form of bitvectors directly?
That is a good question.
In the default settings (i.e., bitvector usage), the predicates have to
be based on bitvectors as well (except with encodePredicates, for which
I do not know how well it works).
If you use encodeBitvectorAs=INTEGER the predicates should be written
with integers, and I think this should work, but likely this is even
less often used and tried out than the BV case.
I would recommend to try this out with a simpler example.
For example, take doc/examples/example.c and and verify it
(with --predicateAnalysis for bitvectors or --predicateAnalysis-linear
for integers), take the resulting predmap.txt file and pass it back to
CPAchecker as initial predicates.
If everything works, you get "Number of CEGAR refinements: 0" in the
statistics of CPAchecker (--stats or output/Statistics.txt).
A quick check seems to indicate that this works for
--predicateAnalysis-linear and doc/examples/example.c. So you can build
on this and try out more complex programs and predicate with heap data
or translation of predicates.
I hope this helps!
Greetings
Philipp