anthem-rs/src/translate/verify_properties.rs

29 lines
707 B
Rust
Raw Normal View History

mod context;
mod translate_body;
2020-02-01 15:32:41 +01:00
mod translate_head;
pub use context::Context;
2020-02-01 15:32:41 +01:00
use translate_body::translate_body;
2020-02-01 15:32:41 +01:00
use translate_head::determine_head_type;
2020-01-25 12:55:23 +01:00
2020-02-01 15:32:41 +01:00
pub fn read(rule: &clingo::ast::Rule, context: &mut Context) -> Result<(), crate::Error>
{
2020-02-01 15:32:41 +01:00
let test = translate_body(rule.body(), context)?;
println!("{:?}", test);
let test = determine_head_type(rule.head(),
|name, arity| context.find_or_create_predicate_declaration(name, arity))?;
match test
{
translate_head::HeadType::ChoiceWithSingleAtom(_) => println!("choice single"),
translate_head::HeadType::IntegrityConstraint => println!("integrity"),
translate_head::HeadType::Trivial => println!("trivial"),
_ => (),
}
Ok(())
2020-01-24 13:32:43 +01:00
}