Skip to content

Commit

Permalink
Move cmdline_solver to feature branch
Browse files Browse the repository at this point in the history
  • Loading branch information
hbierlee committed May 15, 2024
1 parent 961d389 commit a64303e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 144 deletions.
24 changes: 23 additions & 1 deletion crates/pindakaas/src/int/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,29 @@ Actual assignments:
#[cfg(test)]
mod tests {
use super::*;
use crate::{helpers::tests::assert_ok, solver::cmdline_solver::MapSol, Cnf, Lin, Model};
use crate::{helpers::tests::assert_ok, Cnf, Lin, Lit, Model};

pub(crate) struct MapSol(HashMap<Var, bool>);

impl From<Vec<Lit>> for MapSol {
fn from(value: Vec<Lit>) -> Self {
Self(
value
.into_iter()
.map(|lit| (lit.var(), !lit.is_negated()))
.collect::<HashMap<_, _>>(),
)
}
}

impl Valuation for MapSol {
fn value(&self, lit: Lit) -> Option<bool> {
self.0
.get(&lit.var())
.copied()
.map(|a| if lit.is_negated() { !a } else { a })
}
}

#[test]
fn model_test() {
Expand Down
3 changes: 0 additions & 3 deletions crates/pindakaas/src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ pub mod kissat;
#[cfg(feature = "splr")]
pub mod splr;

// TODO move to feature branch
pub(crate) mod cmdline_solver;

pub mod libloading;

#[cfg(feature = "ipasir-up")]
Expand Down
140 changes: 0 additions & 140 deletions crates/pindakaas/src/solver/cmdline_solver.rs

This file was deleted.

0 comments on commit a64303e

Please sign in to comment.