Skip to main content

execute_with_timeout

Function execute_with_timeout 

Source
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 binary
  • args - Command-line arguments for the solver
  • timeout - Optional timeout duration. If None, the maximum possible duration is used (effectively no timeout).

§Returns

Returns a tuple of (stdout, stderr) as strings.

§Errors

Returns SATSolverError if:

§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.