use can_be(list, _) in all solutions predicates

This commit is contained in:
Mark Thom
2019-03-30 10:44:49 -06:00
parent 5a30c7b9be
commit 8945bae70b
5 changed files with 15 additions and 20 deletions

View File

@@ -234,7 +234,7 @@ fn setup_qualified_import(mut terms: Vec<Box<Term>>) -> Result<UseModuleExport,
fn setup_declaration(mut terms: Vec<Box<Term>>) -> Result<Declaration, ParserError>
{
let term = *terms.pop().unwrap();
match term {
Term::Clause(_, name, mut terms, _) =>
if name.as_str() == "op" && terms.len() == 3 {
@@ -405,7 +405,7 @@ impl RelationWorker {
if assume_dyn {
self.dynamic_clauses.push((term.clone(), tail));
}
Ok(term)
},
_ =>
@@ -691,7 +691,7 @@ impl RelationWorker {
Ok(decl) => return Ok(TopLevel::Declaration(decl)),
_ => {}
};
Ok(TopLevel::Query(self.setup_query(indices, terms, blocks_cuts)?))
} else if name.as_str() == ":-" && terms.len() == 2 {
Ok(TopLevel::Rule(self.setup_rule(indices, terms, blocks_cuts, true)?))