refine *_void emission"
This commit is contained in:
@@ -9,9 +9,10 @@ pub trait CompilationTarget<'a> {
|
||||
fn to_constant(Level, Constant, RegType) -> Self;
|
||||
fn to_list(Level, RegType) -> Self;
|
||||
fn to_structure(Level, Atom, usize, RegType) -> Self;
|
||||
|
||||
fn to_void(usize) -> Self;
|
||||
|
||||
fn is_void_instr(&self) -> bool;
|
||||
fn incr_void_instr(&mut self);
|
||||
|
||||
fn constant_subterm(Constant) -> Self;
|
||||
|
||||
@@ -56,6 +57,13 @@ impl<'a> CompilationTarget<'a> for FactInstruction {
|
||||
}
|
||||
}
|
||||
|
||||
fn incr_void_instr(&mut self) {
|
||||
match self {
|
||||
&mut FactInstruction::UnifyVoid(ref mut incr) => *incr += 1,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn constant_subterm(constant: Constant) -> Self {
|
||||
FactInstruction::UnifyConstant(constant)
|
||||
}
|
||||
@@ -114,6 +122,13 @@ impl<'a> CompilationTarget<'a> for QueryInstruction {
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
||||
fn incr_void_instr(&mut self) {
|
||||
match self {
|
||||
&mut QueryInstruction::SetVoid(ref mut incr) => *incr += 1,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn constant_subterm(constant: Constant) -> Self {
|
||||
QueryInstruction::SetConstant(constant)
|
||||
|
||||
Reference in New Issue
Block a user