From 1b4c400bfb067bbfae3a89b8542c1418549f2200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Mon, 4 May 2020 16:55:21 +0200 Subject: [PATCH] Look up variables --- src/parse/formulas.rs | 1 - src/parse/terms.rs | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/parse/formulas.rs b/src/parse/formulas.rs index ec0b332..cf88406 100644 --- a/src/parse/formulas.rs +++ b/src/parse/formulas.rs @@ -375,7 +375,6 @@ where let declaration = self.declarations.find_or_create_predicate_declaration(predicate_name, arguments.len()); - return Ok(crate::Formula::predicate(declaration, arguments)); } diff --git a/src/parse/terms.rs b/src/parse/terms.rs index 95fdfc0..305cb6b 100644 --- a/src/parse/terms.rs +++ b/src/parse/terms.rs @@ -434,9 +434,7 @@ where crate::parse::error::Location::new(0, Some(0)))) } - // TODO: implement look-up - let declaration = crate::VariableDeclaration::new(identifier.to_string()); - let declaration = std::rc::Rc::new(declaration); + let declaration = self.variable_declaration_stack.find_or_create(identifier); return Ok(crate::Term::variable(declaration)); }, _ if is_function_name(identifier) =>