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

CLI: Ternary And operations giving incorrect output #186

Open
lisaoakley opened this issue Nov 8, 2023 · 0 comments
Open

CLI: Ternary And operations giving incorrect output #186

lisaoakley opened this issue Nov 8, 2023 · 0 comments

Comments

@lisaoakley
Copy link

lisaoakley commented Nov 8, 2023

Bug:

When doing a ternary And with the RSDD CLI, RSDD only considers the first two arguments in the conjunction, and ignores the third. This is the case for all n-ary operations with n>2.

Repro Steps:

Command:

cargo run --release --bin weighted_model_count --features="cli" -- -f minimal_example.sexp -w minimal_example_weights.json

minimal_example.sexp:

(And (Not (Var T0)) (Not (Var T1)) (Not (Var T2)))

minimal_example_weights.json:

{"T0": { "low": 0.9, "high": 0.1}, "T1": { "low": 0.9, "high": 0.1}, "T2": { "low": 0.9, "high": 0.1}}

Outputs:

Expected Output:

unweighted model count: 1
weighted model count: 0.729

Actual Output:

unweighted model count: 2
weighted model count: 0.81

Notes:

There is a workaround to this issue that you can just do nesting of binary conjunctions. For example using the following formula file.

minimal_example_workaround.sexp:

(And (Not (Var T0)) (And (Not (Var T1)) (Not (Var T2))))

This is fine, but RSDD should at least error on invalid input instead of giving an incorrect output.

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

No branches or pull requests

1 participant