parse_file

Function parse_file 

Source
pub fn parse_file<T: Literal, S: LiteralStorage<T>>(
    file_path: &PathBuf,
) -> Result<Cnf<T, S>>
Expand description

Parses a DIMACS CNF file specified by its path.

This is a convenience function that opens the file, wraps it in a BufReader, and then calls parse_dimacs.

§Type Parameters

  • T: The Literal type for the Cnf.
  • S: The LiteralStorage type for the Cnf.

§Arguments

  • file_path: A string slice representing the path to the DIMACS file.

§Errors

Returns io::Result::Err if the file cannot be opened or read (e.g. path does not exist, permissions error). Panics from parse_dimacs (e.g. malformed content) will propagate.

§Returns

io::Result::Ok(Cnf<T, S>) if parsing is successful.