support call/N

This commit is contained in:
Mark Thom
2017-05-24 19:10:31 -06:00
parent 39f0f2bacb
commit 2f23541ee0
16 changed files with 2574 additions and 1362 deletions

View File

@@ -129,13 +129,13 @@ impl<'a> Allocator<'a> for NaiveAllocator<'a>
self.bindings.clear();
}
fn advance(&mut self, term_loc: GenContext, term: &'a Term) {
fn advance(&mut self, term_loc: GenContext, term: QueryTermRef<'a>) {
if let GenContext::Head = term_loc {
self.arg_c = 1;
self.temp_c = max(term.subterms() + 1, self.temp_c);
self.temp_c = max(term.arity() + 1, self.temp_c);
} else {
self.arg_c = 1;
self.temp_c = term.subterms() + 1;
self.temp_c = term.arity() + 1;
}
}