fix duplicate_term bug

This commit is contained in:
Mark Thom
2018-01-14 23:05:15 -07:00
parent 08b94dcdf5
commit a4022d569f
10 changed files with 60 additions and 32 deletions

View File

@@ -338,6 +338,7 @@ pub enum QueryTerm {
Catch(Vec<Box<Term>>),
Cut,
Display(Vec<Box<Term>>),
DuplicateTerm(Vec<Box<Term>>),
Functor(Vec<Box<Term>>),
Inlined(InlinedQueryTerm),
Is(Vec<Box<Term>>),
@@ -350,8 +351,9 @@ impl QueryTerm {
match self {
&QueryTerm::Arg(_) => 3,
&QueryTerm::Catch(_) => 3,
&QueryTerm::Throw(_) => 1,
&QueryTerm::Throw(_) => 1,
&QueryTerm::Display(_) => 1,
&QueryTerm::DuplicateTerm(_) => 2,
&QueryTerm::Functor(_) => 3,
&QueryTerm::Inlined(ref term) => term.arity(),
&QueryTerm::Is(_) => 2,
@@ -720,7 +722,6 @@ pub enum ArithmeticInstruction {
pub enum BuiltInInstruction {
CleanUpBlock,
CompareNumber(CompareNumberQT, ArithmeticTerm, ArithmeticTerm),
DuplicateTerm,
EraseBall,
Fail,
GetArg,
@@ -751,6 +752,8 @@ pub enum ControlInstruction {
Deallocate,
DisplayCall,
DisplayExecute,
DuplicateTermCall,
DuplicateTermExecute,
Execute(Rc<Atom>, usize),
ExecuteN(usize),
FunctorCall,
@@ -773,6 +776,8 @@ impl ControlInstruction {
&ControlInstruction::CatchExecute => true,
&ControlInstruction::DisplayCall => true,
&ControlInstruction::DisplayExecute => true,
&ControlInstruction::DuplicateTermCall => true,
&ControlInstruction::DuplicateTermExecute => true,
&ControlInstruction::Execute(_, _) => true,
&ControlInstruction::CallN(_) => true,
&ControlInstruction::ExecuteN(_) => true,