Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Shikhar-Srivastava-16 committed Dec 17, 2024
1 parent 5176eeb commit b0066d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/conjure_core/src/solver/adaptors/rustsat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ pub fn instantiate_model_from_conjure(
Ok(inst)
}

fn solve(&mut solver_inst: Minisat, model_inst: Option<SatInstance>) -> bool {
fn solve(&mut solver_inst: Minisat, model_inst: SatInstance) -> bool {

let cnf_func: rustsat::instances::Cnf = model_inst.clone().unwrap().into_cnf().0;
let cnf_func: rustsat::instances::Cnf = model_inst.clone().into_cnf().0;
solver_inst.add_cnf(cnf_func);
let res = solver_inst.solve().unwrap();

Expand All @@ -117,7 +117,7 @@ fn solve(&mut solver_inst: Minisat, model_inst: Option<SatInstance>) -> bool {
SolverResult::Unsat => false,

// should not arise:
SolverResult::Interrupted => panic!((format!("SatInstance may be invalid, Interrupted."))),
SolverResult::Interrupted => panic!("SatInstance may be invalid, Interrupted."),
};

solver_res
Expand All @@ -134,7 +134,7 @@ impl SolverAdaptor for SAT {
// &self.solver_inst.add_cnf(cnf_func);
// let res = &self.solver_inst.solve().unwrap();

let solver_res = solve(self.solver_inst, self.model_inst);
let solver_res = solve(&mut self.solver_inst, self.model_inst.unwrap());

// error thrown always. impermanent
// will eventually have a SolveSucess instance being returned with Ok(), when the implementation is more permanent.
Expand Down

0 comments on commit b0066d6

Please sign in to comment.