Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Logical S-expression serialization, sketches out bottomup_formula_to_bdd #159

Merged
merged 4 commits into from
Jul 24, 2023

Conversation

mattxwang
Copy link
Member

@mattxwang mattxwang commented Jul 24, 2023

Part of #155.

Usage:

$ cat bloop.sexp 
(And (Or (Var X) (Var Y)) (Or (Not (Var X)) (Not (Var Y))))
$ cargo run --bin bottomup_formula_to_bdd --features="cli" -- -f bloop.sexp
{"nodes":[{"topvar":1,"low":"False","high":"True"},{"topvar":0,"low":{"Ptr":{"index":0,"compl":true}},"high":{"Ptr":{"index":0,"compl":false}}}],"roots":[{"Ptr":{"index":1,"compl":true}}]}

Or, for a manual ordering,

$ cat bloop.sexp 
(And (Or (Var X) (Var Y)) (Or (Not (Var X)) (Not (Var Y))))
$ cat bloop.json
{ "order": ["Y", "X"] }
$ cargo run --bin bottomup_formula_to_bdd --features="cli" -- -f bloop.sexp -v --ordering manual -c bloop.json
=== METADATA ===
variable mapping: {"X": 0, "Y": 1}
variable ordering: [1, 0]
=== STATS ===
compilation time: 0.0033s
recursive calls: 9
{"nodes":[{"topvar":0,"low":"False","high":"True"},{"topvar":1,"low":{"Ptr":{"index":0,"compl":true}},"high":{"Ptr":{"index":0,"compl":false}}}],"roots":[{"Ptr":{"index":1,"compl":true}}]}

@mattxwang mattxwang merged commit af20185 into main Jul 24, 2023
7 checks passed
@mattxwang mattxwang deleted the logical-s-expr branch July 24, 2023 19:53
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