Repository navigation
Equivalence/inclusion of DPAs: build the product once and store its edges - #158
Merged
Merged
Conversation
leonbohn
added a commit
that referenced
this pull request
Nov 9, 2026
…sitions (#159) Part of the Spot comparison work (#143); cheaper alternative to the BDD backend switch (#156) for few propositions. ## What `PropExpression` stores expressions over at most 6 atomic propositions as a 64-bit truth table (`Repr::Table`), larger ones as `Bdd` (`Repr::Bdd`). The representation is canonical (table iff `num_aps <= 6`), so the derived `Eq`/`Hash` stay correct. `&`, `|`, `!`, `overlaps`, `intersection` and matching are bit operations; equality/hash are integer operations; clones do not allocate. `from_parts`, `from_bdd`, `into_bdd`, `to_hoa_label` and `Display` convert to and from BDDs, so the public API is unchanged. **Behavior change:** for tables, `sat_vals()`/`symbols()` yield symbols in ascending raw order. The BDD iteration order is not a function of the set (don't-care variables vary differently), so it could not be kept; no test depended on it. Noted in CHANGELOG. ## Measurements (gungraun, instructions, `cargo bench --bench dpa`, HOA-based fixtures) | bench | before | after | |---|---|---| | normalized_fixtures ltl | 5 493 570 | 1 517 740 (-72 %) | | normalized_fixtures synthetic | 21 767 464 | 10 076 508 (-54 %) | | complement_fixtures ltl | 5 592 064 | 1 569 234 (-72 %) | | complement_fixtures synthetic | 22 217 532 | 10 407 320 (-53 %) | | witnesses_fixtures ltl | 4 937 378 | 2 261 062 (-54 %) | | witnesses_fixtures synthetic | 94 085 634 | 19 684 166 (-79 %) | Independent of #158; the effects should add up. Not yet measured against Spot (`benches/versus`). ## Tests New: `truth_tables_agree_with_bdds` (all functions over 2 and a sample over 3 propositions: symbols, `!`, `|`, overlap, intersection, matching against the BDD operations), `expressions_over_many_propositions_use_bdds`. fmt, clippy, doc, `cargo hack --each-feature` and tests in all three feature configurations pass; `scripts/check` stops at the MSRV step (no rustup in the Nix shell); the Python crate was not built or tested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the Spot comparison work (#143).
What
Equivalenceof deterministic parity/Büchi automata searched two products, one per direction (product_lasso(.., (true,false)).or_else(.. (false,true))). It now builds the product once and searches both acceptances on it.cycles::searchrecomputed all edge labels (BDD intersections on propositional alphabets).product_lassonow explores the product once (explore_product) into anNTSand searches that.Measurements (gungraun, instructions,
cargo bench --bench dpa)These benches use
CharAlphabet; on propositional alphabets (BDD intersections) the saving should be larger. Not yet measured against Spot (benches/versus, needs the Python build).Checks
cargo fmt, clippy (default/no-default/all), doc,cargo hack --each-feature, tests in all three configurations pass.scripts/checkstops at the MSRV step here because the Nix toolchain has no rustup (cargo +1.88); the Python crate was not built or tested.