diff --git a/src/commands/verify_program.rs b/src/commands/verify_program.rs
index 9054b9e..ee853d7 100644
--- a/src/commands/verify_program.rs
+++ b/src/commands/verify_program.rs
@@ -1,32 +1,36 @@
-pub fn run
(program_path: P, specification_path: P,
+pub fn run(program_path: P1, specification_paths: &[P2],
proof_direction: crate::problem::ProofDirection, no_simplify: bool,
color_choice: crate::output::ColorChoice)
where
- P: AsRef,
+ P1: AsRef,
+ P2: AsRef,
{
let mut problem = crate::Problem::new(color_choice);
- log::info!("reading specification “{}”", specification_path.as_ref().display());
-
- let specification_content = match std::fs::read_to_string(specification_path.as_ref())
+ for specification_path in specification_paths
{
- Ok(specification_content) => specification_content,
- Err(error) =>
+ log::info!("reading specification file “{}”", specification_path.as_ref().display());
+
+ let specification_content = match std::fs::read_to_string(specification_path.as_ref())
{
- log::error!("could not access specification file: {}", error);
+ Ok(specification_content) => specification_content,
+ Err(error) =>
+ {
+ log::error!("could not access specification file: {}", error);
+ std::process::exit(1)
+ },
+ };
+
+ // TODO: rename to read_specification
+ if let Err(error) = crate::input::parse_specification(&specification_content, &mut problem)
+ {
+ log::error!("could not read specification file: {}", error);
std::process::exit(1)
- },
- };
+ }
- // TODO: rename to read_specification
- if let Err(error) = crate::input::parse_specification(&specification_content, &mut problem)
- {
- log::error!("could not read specification: {}", error);
- std::process::exit(1)
+ log::info!("read specification “{}”", specification_path.as_ref().display());
}
- log::info!("read specification “{}”", specification_path.as_ref().display());
-
problem.process_output_predicates();
log::info!("reading input program “{}”", program_path.as_ref().display());
diff --git a/src/main.rs b/src/main.rs
index ff4c514..edf9dd5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,8 +13,8 @@ enum Command
program_path: std::path::PathBuf,
#[structopt(name = "specification", parse(from_os_str), required(true))]
- /// Specification file path
- specification_path: std::path::PathBuf,
+ /// One or more specification file paths
+ specification_paths: Vec,
/// Proof direction (forward, backward, both)
#[structopt(long, default_value = "forward")]
@@ -41,12 +41,12 @@ fn main()
Command::VerifyProgram
{
program_path,
- specification_path,
+ specification_paths,
proof_direction,
no_simplify,
color_choice,
}
- => anthem::commands::verify_program::run(&program_path, &specification_path,
+ => anthem::commands::verify_program::run(&program_path, specification_paths.as_slice(),
proof_direction, no_simplify, color_choice),
}
}