ask-dracula-rs/src/main.rs

25 lines
724 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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(|_| "couldnt parse input file")?;
println!("{}", project);
println!("");
println!("{}", project.display_tptp());
Ok(())
}