Add subcommand for verifying programs
This commit is contained in:
parent
072fa34e69
commit
ad3a2d18f8
24
src/main.rs
24
src/main.rs
@ -2,21 +2,31 @@ use structopt::StructOpt as _;
|
|||||||
|
|
||||||
#[derive(Debug, structopt::StructOpt)]
|
#[derive(Debug, structopt::StructOpt)]
|
||||||
#[structopt(name = "anthem", about = "Use first-order theorem provers with answer set programs.")]
|
#[structopt(name = "anthem", about = "Use first-order theorem provers with answer set programs.")]
|
||||||
struct Options
|
enum Command
|
||||||
{
|
{
|
||||||
#[structopt(parse(from_os_str))]
|
#[structopt(about = "Verifies a logic program against a specification")]
|
||||||
input: Vec<std::path::PathBuf>,
|
VerifyProgram
|
||||||
|
{
|
||||||
|
#[structopt(parse(from_os_str))]
|
||||||
|
input: Vec<std::path::PathBuf>,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main()
|
fn main()
|
||||||
{
|
{
|
||||||
pretty_env_logger::init();
|
pretty_env_logger::init();
|
||||||
|
|
||||||
let options = Options::from_args();
|
let command = Command::from_args();
|
||||||
|
|
||||||
if let Err(error) = anthem::translate::verify_properties::translate(&options.input)
|
match command
|
||||||
{
|
{
|
||||||
log::error!("could not translate input program: {}", error);
|
Command::VerifyProgram{input} =>
|
||||||
std::process::exit(1)
|
{
|
||||||
|
if let Err(error) = anthem::translate::verify_properties::translate(&input)
|
||||||
|
{
|
||||||
|
log::error!("could not translate input program: {}", error);
|
||||||
|
std::process::exit(1)
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user