Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions crates/filament/src/ir_passes/discharge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,22 +303,22 @@ impl Construct for Discharge {
}

impl Discharge {
fn fmt_param(&self, param: ir::ParamIdx, ctx: &ir::Component) -> String {
fn fmt_param(&self, param: ir::ParamIdx) -> String {
match self.sol_base {
// CVC5 does not correctly print out quoted SExps
cmdline::Solver::Z3 => {
format!("|{}@param{}|", ctx.display(param), param.get())
format!("|param{}|", param.get())
}
_ => {
format!("param{}", param.get())
}
}
}

fn fmt_event(&self, event: ir::EventIdx, ctx: &ir::Component) -> String {
fn fmt_event(&self, event: ir::EventIdx) -> String {
match self.sol_base {
cmdline::Solver::Z3 => {
format!("|{}@event{}|", ctx.display(event), event.get())
format!("|event{}|", event.get())
}
_ => format!("event{}", event.get()),
}
Expand Down Expand Up @@ -585,13 +585,12 @@ impl Visitor for Discharge {
log::debug!("Checking {}", data.comp.display(fact.prop));
}

let comp = &data.comp;
// Declare all parameters
let int = self.sort();
for (idx, _) in data.comp.params().iter() {
let sexp = self
.sol
.declare_fun(self.fmt_param(idx, comp), vec![], int)
.declare_fun(self.fmt_param(idx), vec![], int)
.unwrap();
self.overflow_assert(sexp);
self.param_map.push(idx, sexp);
Expand All @@ -601,7 +600,7 @@ impl Visitor for Discharge {
for (idx, _) in data.comp.events().iter() {
let sexp = self
.sol
.declare_fun(self.fmt_event(idx, comp), vec![], int)
.declare_fun(self.fmt_event(idx), vec![], int)
.unwrap();
self.overflow_assert(sexp);
self.ev_map.push(idx, sexp);
Expand Down
Loading