Make all terms compatible in TPTP
This commit is contained in:
@@ -195,8 +195,8 @@ where
|
||||
for (predicate_declaration, completed_definition) in completed_definitions
|
||||
{
|
||||
println!("tff(completion_{}_{}, axiom, {}).", predicate_declaration.name,
|
||||
predicate_declaration.arity, crate::output::human_readable::display_formula(
|
||||
&completed_definition, None, &context));
|
||||
predicate_declaration.arity, crate::output::tptp::display_formula(
|
||||
&completed_definition, &context));
|
||||
}
|
||||
|
||||
if !context.integrity_constraints.borrow().is_empty()
|
||||
@@ -207,8 +207,7 @@ where
|
||||
for integrity_constraint in context.integrity_constraints.borrow().iter()
|
||||
{
|
||||
println!("tff(integrity_constraint, axiom, {}).",
|
||||
crate::output::human_readable::display_formula(&integrity_constraint, None,
|
||||
&context));
|
||||
crate::output::tptp::display_formula(&integrity_constraint, &context));
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@@ -4,6 +4,9 @@ pub(crate) struct Definitions
|
||||
pub definitions: Vec<crate::ScopedFormula>,
|
||||
}
|
||||
|
||||
type InputConstantDeclarationDomains
|
||||
= std::collections::BTreeMap<std::rc::Rc<foliage::FunctionDeclaration>, crate::Domain>;
|
||||
|
||||
type VariableDeclarationDomains
|
||||
= std::collections::BTreeMap<std::rc::Rc<foliage::VariableDeclaration>, crate::Domain>;
|
||||
|
||||
@@ -16,6 +19,7 @@ pub(crate) struct Context
|
||||
std::rc::Rc<foliage::PredicateDeclaration>, Definitions>>,
|
||||
pub integrity_constraints: std::cell::RefCell<foliage::Formulas>,
|
||||
|
||||
pub input_constant_declaration_domains: std::cell::RefCell<InputConstantDeclarationDomains>,
|
||||
pub function_declarations: std::cell::RefCell<foliage::FunctionDeclarations>,
|
||||
pub predicate_declarations: std::cell::RefCell<foliage::PredicateDeclarations>,
|
||||
pub variable_declaration_stack: std::cell::RefCell<foliage::VariableDeclarationStack>,
|
||||
@@ -32,15 +36,31 @@ impl Context
|
||||
definitions: std::cell::RefCell::new(std::collections::BTreeMap::<_, _>::new()),
|
||||
integrity_constraints: std::cell::RefCell::new(vec![]),
|
||||
|
||||
input_constant_declaration_domains:
|
||||
std::cell::RefCell::new(InputConstantDeclarationDomains::new()),
|
||||
function_declarations: std::cell::RefCell::new(foliage::FunctionDeclarations::new()),
|
||||
predicate_declarations: std::cell::RefCell::new(foliage::PredicateDeclarations::new()),
|
||||
variable_declaration_stack: std::cell::RefCell::new(foliage::VariableDeclarationStack::new()),
|
||||
variable_declaration_domains: std::cell::RefCell::new(VariableDeclarationDomains::new()),
|
||||
variable_declaration_stack:
|
||||
std::cell::RefCell::new(foliage::VariableDeclarationStack::new()),
|
||||
variable_declaration_domains:
|
||||
std::cell::RefCell::new(VariableDeclarationDomains::new()),
|
||||
variable_declaration_ids: std::cell::RefCell::new(VariableDeclarationIDs::new()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::traits::InputConstantDeclarationDomain for Context
|
||||
{
|
||||
fn input_constant_declaration_domain(&self,
|
||||
declaration: &std::rc::Rc<foliage::FunctionDeclaration>)
|
||||
-> Option<crate::Domain>
|
||||
{
|
||||
let input_constant_declaration_domains = self.input_constant_declaration_domains.borrow();
|
||||
|
||||
input_constant_declaration_domains.get(declaration).map(|x| *x)
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::traits::GetOrCreateFunctionDeclaration for Context
|
||||
{
|
||||
fn get_or_create_function_declaration(&self, name: &str, arity: usize)
|
||||
|
Reference in New Issue
Block a user