Skip to content

Booster: Optimise handling of known predicates when rewriting #4029

Closed as not planned
@geo2a

Description

@geo2a

When processing an "execute" request, we are rewriting from one Pattern to one or more Patterns. In Booster, we assume definedness of the initial Pattern, i.e. it must have no "bad" applications of partial functions and the constrains should not be inconsistent.

Since the introduction of the SMT solver into Booster, we have been very conservative in how we interact with it, potentially leaving a lot of performance on the table. We should optimise the communication of the constraints of the initial Pattern, aka the known predicates, aka "the path condition" to the solver:

  • when starting an execute request, we should check the consistency of the constraints to make sure we are not rewriting inside a vacuous state (this is done in 4012 evaluate pattern pruning #4020)
  • if the constraints are consistent, we will reuse the created Z3 scope for all subsequent queries, hopefully making the side condition checks very fast
  • when we add new constraints to the current Pattern withing the same "execute" request, we have two options:
    • the conservative option would be to pop the scope, add the ensured condition to the known predicates, push them ch check-sat;
    • the more performant option is to push the scope before checking the ensures conditions and avoid re-checking the previous know truth.

We will need to re-think how we do solver retries. Currently, we do a hard reset every time we retry, which restarts the solver. We should instead to a soft reset:

  • pop the last scope, which includes the predicate we are checking
  • reuse the previous scopes that contain the known predicates
  • change the timeout setting, push and check sat

The comments to this issue will outline the specific changes that need to be done to the SMT-related types and function in Booster to implement this approach.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions