Skip to content

Commit

Permalink
docs: Add simple documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
atimaly committed Apr 22, 2024
1 parent 8f0cf64 commit bb46402
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rustsat/src/instances/fio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@ pub(crate) fn open_compressed_uncompressed_write<P: AsRef<Path>>(
Ok(Box::new(io::BufWriter::new(raw_writer)))
}

/// The possible values a corretly working SAT solver outputs.
#[derive(Debug, PartialEq, Eq)]
pub enum SolverOutput {
Sat(types::Assignment),
Unsat,
Unknown,
}

/// The possible errors that can happen to a SAT solver's output.
#[derive(Error, Debug)]
pub enum SatSolverOutputError {
#[error("The output of the SAT solver is incorrect.")]
Expand All @@ -95,6 +97,7 @@ pub enum SatSolverOutputError {
InvalidSLine,
}

/// The possible errors that can happen to a value line in the SAT solver's output.
#[derive(Error, Debug)]
pub enum InvalidVLine {
#[error("The value line does not start with 'v ' ")]
Expand Down Expand Up @@ -130,7 +133,7 @@ pub fn parse_sat_solver_output<R: BufRead>(reader: R) -> anyhow::Result<SolverOu

//Value line
if line.starts_with("v ") {
//Have we already see a vline?
//Have we already seen a vline?
match &mut solution {
Some(assign) => assign.extend_from_vline(&line)?,
_ => solution = Some(Assignment::from_vline(&line)?),
Expand Down

0 comments on commit bb46402

Please sign in to comment.