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

Propositions used in expressions are defined twice in discharge #487

Closed
UnsignedByte opened this issue Jan 24, 2025 · 0 comments · Fixed by #488
Closed

Propositions used in expressions are defined twice in discharge #487

UnsignedByte opened this issue Jan 24, 2025 · 0 comments · Fixed by #488
Assignees
Labels
bug Something isn't working C: Internals Component: Compiler internals

Comments

@UnsignedByte
Copy link
Collaborator

Propositions that are used in expressions (namely in the ternary operation) are defined twice. This does not cause problems with z3 (I assume it is overridden by the second definition, but as both are equal nothing bad happens), but cvc5 has issues when this occurs.

let relevant_props = idx
.relevant_props(&data.comp)
.into_iter()
.map(|i| (i, data.comp.get(i)));
for (pidx, prop) in relevant_props {
let assign = self.prop_to_sexp(prop);
let sexp = self
.sol
.define_const(Discharge::fmt_prop(pidx), bs, assign)
.unwrap();
self.prop_map.insert(pidx, SExprWrapper::SExpr(sexp));
}

Every proposition is added again here:

for (idx, prop) in data
.comp
.props()
.iter()
.filter(|(idx, _)| idx.valid(&data.comp))
{
// Define assertion equating the proposition to its assignment
let assign = self.prop_to_sexp(prop);
if let Ok(sexp) =
self.sol.define_const(Discharge::fmt_prop(idx), bs, assign)
{
self.prop_map.insert(idx, SExprWrapper::SExpr(sexp));
}
}
// Pass does not need to traverse the control program.
Action::Continue

In CVC5 we get

[TRACE] -> (define-fun prop12 () Bool (> e37 e57))
[TRACE] <- (error "Parse Error: <shell>:1.13: Symbol 'prop12' previously declared as a variable")
@UnsignedByte UnsignedByte added bug Something isn't working C: Internals Component: Compiler internals labels Jan 24, 2025
@UnsignedByte UnsignedByte self-assigned this Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working C: Internals Component: Compiler internals
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant