ask-dracula-rs/src/main.rs

25 lines
724 B
Rust
Raw Normal View History

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