optimizations

This commit is contained in:
Mark Thom
2017-03-22 22:30:45 -06:00
parent 540a5b805f
commit 9362aa6af3
7 changed files with 147 additions and 37 deletions

View File

@@ -80,6 +80,10 @@ impl VarReg {
}
}
pub fn is_temp(self) -> bool {
!self.norm().is_perm()
}
pub fn root_register(self) -> usize {
match self {
VarReg::ArgAndNorm(_, root) => root,
@@ -126,10 +130,11 @@ pub enum FactInstruction {
GetList(Level, RegType),
GetStructure(Level, Atom, usize, RegType),
GetValue(RegType, usize),
GetVariable(RegType, usize),
GetVariable(RegType, usize),
UnifyConstant(Constant),
UnifyVariable(RegType),
UnifyValue(RegType)
UnifyValue(RegType),
UnifyVoid(usize)
}
pub enum QueryInstruction {
@@ -140,7 +145,8 @@ pub enum QueryInstruction {
PutVariable(RegType, usize),
SetConstant(Constant),
SetVariable(RegType),
SetValue(RegType)
SetValue(RegType),
SetVoid(usize)
}
pub enum ChoiceInstruction {