runtimeverification / haskell-backend

The symbolic execution engine powering the K Framework
BSD 3-Clause "New" or "Revised" License
204 stars 39 forks source link

Enable using `cvc5` SMT solver in Kore #3905

Open geo2a opened 1 month ago

geo2a commented 1 month ago

We have evidence (see Slack thread) that CVC5 is more successful than Z3 in dealing with some non-linear arithmetic problems arising in rules' side condition in kasmer and kontrol.

We have for a long time considered adding CVC5 as an alternative/companion solver to Z3.

We should start with the simplest possible implementation: use CVC5 instead of Z3, controlled by the --smt-solver command line option.

geo2a commented 1 month ago

@goodlyrottenapple experiment reveals that there are roadblocks in integrating CVC5 into Kore:

More context could be found in this Slack thread. @goodlyrottenapple please add any other information you think is relevant.

goodlyrottenapple commented 1 month ago

The investigation also revealed that the way we encode data-types is similarly incompatible with CVC5; we are currently using forall quantifiers to send assertions such as no junk for each type. However, there is code which uses the standard declare-datatype smtlib functionality, which could be pulled out into a PR and merged as a stepping stone towards supporting other solvers (I have checked that using declare-datatype works in CVC5, however as mentioned before, CVC5 seems to break when the datatype declaration is too big)