pub fn execute_with_timeout(
solver_path: &Path,
args: &[String],
timeout: Option<Duration>,
) -> Result<(String, String), SATSolverError>Expand description
Executes a command with an optional timeout.
This is a helper function used by solver executors to run the solver binary with timeout support.
§Arguments
solver_path- Path to the solver binaryargs- Command-line arguments for the solvertimeout- Optional timeout duration. IfNone, the maximum possible duration is used (effectively no timeout).
§Returns
Returns a tuple of (stdout, stderr) as strings.
§Errors
Returns SATSolverError if:
- The process fails to spawn (
SATSolverError::Io) - The process crashes with a non-standard exit code (
SATSolverError::ProcessCrashed) - The timeout is exceeded (
SATSolverError::Timeout)
§Exit Code Handling
The following exit codes are considered successful:
10: SATISFIABLE (standard SAT solver convention)20: UNSATISFIABLE (standard SAT solver convention)0: General success
Any other exit code is treated as a crash.