Minor refactoring

This commit is contained in:
Patrick Lühne 2020-05-28 05:00:56 +02:00
parent 1b827edd45
commit fe277b6773
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -20,63 +20,42 @@ where
}; };
// TODO: rename to read_specification // TODO: rename to read_specification
match crate::input::parse_specification(&specification_content, &mut problem) if let Err(error) = crate::input::parse_specification(&specification_content, &mut problem)
{
Ok(_) => (),
Err(error) =>
{ {
log::error!("could not read specification: {}", error); log::error!("could not read specification: {}", error);
std::process::exit(1) std::process::exit(1)
} }
}
log::info!("read specification “{}”", specification_path.as_ref().display()); log::info!("read specification “{}”", specification_path.as_ref().display());
log::info!("reading input program “{}”", program_path.as_ref().display()); log::info!("reading input program “{}”", program_path.as_ref().display());
// TODO: make consistent with specification call (path vs. content) // TODO: make consistent with specification call (path vs. content)
match crate::translate::verify_properties::Translator::new(&mut problem).translate(program_path) if let Err(error) = crate::translate::verify_properties::Translator::new(&mut problem)
{ .translate(program_path)
Ok(_) => (),
Err(error) =>
{ {
log::error!("could not translate input program: {}", error); log::error!("could not translate input program: {}", error);
std::process::exit(1) std::process::exit(1)
} }
}
match problem.check_consistency(proof_direction) if let Err(error) = problem.check_consistency(proof_direction)
{
Ok(_) => (),
Err(error) =>
{ {
log::error!("{}", error); log::error!("{}", error);
std::process::exit(1) std::process::exit(1)
} }
}
if !no_simplify if !no_simplify
{ {
match problem.simplify() if let Err(error) = problem.simplify()
{
Ok(_) => (),
Err(error) =>
{ {
log::error!("could not simplify translated program: {}", error); log::error!("could not simplify translated program: {}", error);
std::process::exit(1) std::process::exit(1)
} }
} }
}
match problem.prove(proof_direction) if let Err(error) = problem.prove(proof_direction)
{
Ok(()) => (),
Err(error) =>
{ {
log::error!("could not verify program: {}", error); log::error!("could not verify program: {}", error);
std::process::exit(1) std::process::exit(1)
} }
} }
log::info!("done");
}