Repository navigation
PropExpression: truth tables instead of BDDs for up to 6 atomic propositions - #159
Merged
Merged
Conversation
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); cheaper alternative to the BDD backend switch (#156) for few propositions.
What
PropExpressionstores expressions over at most 6 atomic propositions as a 64-bit truth table (Repr::Table), larger ones asBdd(Repr::Bdd). The representation is canonical (table iffnum_aps <= 6), so the derivedEq/Hashstay correct.&,|,!,overlaps,intersectionand matching are bit operations; equality/hash are integer operations; clones do not allocate.from_parts,from_bdd,into_bdd,to_hoa_labelandDisplayconvert 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)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-featureand tests in all three feature configurations pass;scripts/checkstops at the MSRV step (no rustup in the Nix shell); the Python crate was not built or tested.