Look up predicates

This commit is contained in:
Patrick Lühne 2020-05-04 16:48:35 +02:00
parent 56885dc290
commit 555f983285
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -82,7 +82,8 @@ where
D: crate::FindOrCreateFunctionDeclaration + crate::FindOrCreatePredicateDeclaration,
{
pub fn new(input: &'i str, declarations: &'d D,
variable_declaration_stack: &'v crate::VariableDeclarationStackLayer<'p>) -> Self
variable_declaration_stack: &'v crate::VariableDeclarationStackLayer<'p>)
-> Self
{
Self
{
@ -366,10 +367,8 @@ where
crate::parse::error::Location::new(0, Some(0))))
}
// TODO: implement look-up
let declaration =
crate::PredicateDeclaration::new(predicate_name.to_string(), arguments.len());
let declaration = std::rc::Rc::new(declaration);
let declaration = self.declarations.find_or_create_predicate_declaration(predicate_name,
arguments.len());
return Ok(crate::Formula::predicate(declaration, arguments));
}