Skip to content

BDD model checker: early variable quantification#1801

Draft
kroening wants to merge 1 commit into
diffblue:mainfrom
kroening:kroening/early-variable-quantification
Draft

BDD model checker: early variable quantification#1801
kroening wants to merge 1 commit into
diffblue:mainfrom
kroening:kroening/early-variable-quantification

Conversation

@kroening

@kroening kroening commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Implement the early variable quantification optimisation from Burch, Clarke, McMillan, Dill, Hwang: Symbolic Model Checking for Sequential Circuit Verification (1992).

Changes

Instead of building the monolithic conjunction of all transition conjuncts and then quantifying out next-state variables, EX now interleaves conjunction and quantification: after conjoining each partition, it immediately quantifies out next-state variables that do not appear in any remaining partition. This can reduce intermediate BDD sizes from exponential to polynomial.

The core addition is project_next_early(), which:

  1. Computes the support (variable set) of each conjunct
  2. After conjoining each partition, quantifies out any next-state variable not needed by remaining partitions

The old monolithic approach is retained as EX_monolithic() for benchmarking.

Benchmark

A benchmark in benchmarking/bdd_model_checking/ demonstrates the effect using an identity relation with separated variable ordering. The metric is peak intermediate BDD node count, which directly reflects memory usage.

Bits Monolithic peak nodes Early peak nodes Monolithic time Early time
8 765 3 1ms 10µs
12 12,285 3 22ms 18µs
16 196,605 3 348ms 23µs
18 786,429 3 1.6s 27µs

Monolithic peak BDD nodes grow as O(3^N); early quantification keeps them O(1). Time grows O(N) for early quantification vs exponentially for the monolithic approach.

Testing

All unit tests (122 assertions, 32 test cases) and all regression tests pass.

@kroening kroening force-pushed the kroening/early-variable-quantification branch from 09b462f to 7339bcf Compare April 9, 2026 21:48
Implement the early variable quantification optimisation from
Burch, Clarke, McMillan, Dill, Hwang: "Symbolic Model Checking
for Sequential Circuit Verification" (1992).

Instead of building the monolithic conjunction of all transition
conjuncts and then quantifying out next-state variables, we
interleave conjunction and quantification: after conjoining each
partition, we immediately quantify out next-state variables that
do not appear in any remaining partition. This can reduce
intermediate BDD sizes from exponential to polynomial.

The old monolithic approach is retained as EX_monolithic for
benchmarking purposes.

A benchmark in benchmarking/bdd_model_checking/ demonstrates the
effect using an identity relation with separated variable ordering,
where the monolithic approach produces O(3^N) peak BDD nodes while
early quantification stays O(1).
@kroening kroening force-pushed the kroening/early-variable-quantification branch from 7339bcf to 213858d Compare April 9, 2026 21:50
@kroening kroening marked this pull request as draft April 9, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant