optimizations up to section 5.7.

This commit is contained in:
Mark Thom
2017-03-23 01:06:06 -06:00
parent 9362aa6af3
commit e1cc5ecfd6
7 changed files with 58 additions and 24 deletions

View File

@@ -117,6 +117,15 @@ pub struct Rule {
pub clauses: Vec<Term>
}
impl Rule {
pub fn last_clause(&self) -> &Term {
match self.clauses.last() {
None => &self.head.1,
Some(clause) => clause
}
}
}
pub enum TermRef<'a> {
AnonVar(Level),
Cons(Level, &'a Cell<RegType>, &'a Term, &'a Term),
@@ -159,6 +168,7 @@ pub enum ControlInstruction {
Allocate(usize),
Call(Atom, usize),
Deallocate,
Execute(Atom, usize),
Proceed
}