2019-11-02 02:13:45 +01:00
|
|
|
|
use ask_dracula::format_tptp::DisplayTPTP;
|
|
|
|
|
|
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>>
|
|
|
|
|
{
|
|
|
|
|
let matches = clap::App::new("Ask Dracula: Using Vampire as an interactive theorem prover")
|
|
|
|
|
.arg(clap::Arg::with_name("file").long("file").short("f").takes_value(true).required(true))
|
|
|
|
|
.after_help("example: ask_dracula -f program")
|
|
|
|
|
.get_matches();
|
|
|
|
|
|
|
|
|
|
let file = matches.value_of("file").unwrap().to_string();
|
|
|
|
|
let file_path = std::path::Path::new(&file);
|
|
|
|
|
|
|
|
|
|
let file_content = std::fs::read_to_string(&file_path)?;
|
|
|
|
|
let (_, project) = ask_dracula::parse::project(&file_content)
|
|
|
|
|
.map_err(|_| "couldn’t parse input file")?;
|
|
|
|
|
|
2019-11-02 04:13:00 +01:00
|
|
|
|
eprintln!("{}", project);
|
2019-11-02 02:13:45 +01:00
|
|
|
|
|
|
|
|
|
println!("{}", project.display_tptp());
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|