runtimeverification / haskell-backend

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

Reasoning about remainders #3948

Open PetarMax opened 2 weeks ago

PetarMax commented 2 weeks ago

As part of exploring CSE in Kontrol, a few issues have come up. Specifically: 1) The backend exhibits spurious branching because it's not able to prove a large remainder (11 branches) UNSAT. An initial investigation with @geo2a revealed that the satisfiability of the remainder is not checked with respect to the current path constraint. The corresponding bug report is attached: it exhibits a 9-way branching when only an 8-way branching is expected). 2) The remainders are not minimised, in the sense that even though some branches have been cut as infeasible, we still get the negation of their constraints in the remainder (in the example, the branching is initially 11-way and then three branches are discarded). 3) The remainder is not propagated back using rule_predicate, which leads to a mischaracterisation of the branching by pyk, and causes an infinite loop in combination with 1).

From what I understand, the remainders are initially of the form #Not ( ... #Or ... ), which is then transformed into #Not (...) #And #Not (...). I believe that there is room for further simplification or minimisation at the #Or stage, perhaps even Z3 could be asked to minimise this before the transformation to #And.

nine-way-branch.tar.gz