update tests to properly reflect answer order.
This commit is contained in:
@@ -300,7 +300,7 @@ pub enum Term {
|
||||
}
|
||||
|
||||
pub enum InlinedQueryTerm {
|
||||
CompareNumber(CompareNumberQT, Vec<Box<Term>>),
|
||||
CompareNumber(CompareNumberQT, Vec<Box<Term>>),
|
||||
IsAtomic(Vec<Box<Term>>),
|
||||
IsVar(Vec<Box<Term>>),
|
||||
IsInteger(Vec<Box<Term>>)
|
||||
@@ -309,7 +309,7 @@ pub enum InlinedQueryTerm {
|
||||
impl InlinedQueryTerm {
|
||||
pub fn arity(&self) -> usize {
|
||||
match self {
|
||||
&InlinedQueryTerm::CompareNumber(_, _) => 2,
|
||||
&InlinedQueryTerm::CompareNumber(_, _) => 2,
|
||||
&InlinedQueryTerm::IsAtomic(_) => 1,
|
||||
&InlinedQueryTerm::IsInteger(_) => 1,
|
||||
&InlinedQueryTerm::IsVar(_) => 1,
|
||||
@@ -346,8 +346,8 @@ impl QueryTerm {
|
||||
match self {
|
||||
&QueryTerm::Arg(_) => 3,
|
||||
&QueryTerm::Catch(_) => 3,
|
||||
&QueryTerm::Throw(_) => 1,
|
||||
&QueryTerm::Display(_) => 1,
|
||||
&QueryTerm::Throw(_) => 1,
|
||||
&QueryTerm::DuplicateTerm(_) => 2,
|
||||
&QueryTerm::Functor(_) => 3,
|
||||
&QueryTerm::Inlined(ref term) => term.arity(),
|
||||
@@ -384,8 +384,8 @@ impl<'a> ClauseType<'a> {
|
||||
&ClauseType::Arg => "arg",
|
||||
&ClauseType::CallN => "call",
|
||||
&ClauseType::Catch => "catch",
|
||||
&ClauseType::Deep(_, _, name, _) => name.as_str(),
|
||||
&ClauseType::Display => "display",
|
||||
&ClauseType::Deep(_, _, name, _) => name.as_str(),
|
||||
&ClauseType::DuplicateTerm => "duplicate_term",
|
||||
&ClauseType::Functor => "functor",
|
||||
&ClauseType::Is => "is",
|
||||
@@ -735,7 +735,7 @@ pub enum ArithmeticInstruction {
|
||||
|
||||
pub enum BuiltInInstruction {
|
||||
CleanUpBlock,
|
||||
CompareNumber(CompareNumberQT, ArithmeticTerm, ArithmeticTerm),
|
||||
CompareNumber(CompareNumberQT, ArithmeticTerm, ArithmeticTerm),
|
||||
EraseBall,
|
||||
Fail,
|
||||
GetArg,
|
||||
@@ -765,9 +765,9 @@ pub enum ControlInstruction {
|
||||
CallN(usize), // arity.
|
||||
CatchCall,
|
||||
CatchExecute,
|
||||
Deallocate,
|
||||
DisplayCall,
|
||||
DisplayExecute,
|
||||
Deallocate,
|
||||
DuplicateTermCall,
|
||||
DuplicateTermExecute,
|
||||
Execute(TabledRc<Atom>, usize),
|
||||
|
||||
@@ -578,12 +578,8 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
|
||||
code
|
||||
}
|
||||
|
||||
fn compile_query_line(&mut self,
|
||||
term: &'a QueryTerm,
|
||||
term_loc: GenContext,
|
||||
code: &mut Code,
|
||||
index: usize,
|
||||
is_exposed: bool)
|
||||
fn compile_query_line(&mut self, term: &'a QueryTerm, term_loc: GenContext,
|
||||
code: &mut Code, index: usize, is_exposed: bool)
|
||||
{
|
||||
self.marker.reset_arg(term.arity());
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ impl<'a> VariableFixtures<'a>
|
||||
// 1. move the use sets of each variable to a local HashMap, use_set
|
||||
// (iterate mutably, swap mutable refs).
|
||||
// 2. drain use_set. For each use set of U, add into the
|
||||
// no-use sets of appropriate variables T /= U.
|
||||
// no-use sets of appropriate variables T =/= U.
|
||||
// 3. Move the use sets back to their original locations in the fixture.
|
||||
// Compute the conflict set of u.
|
||||
|
||||
|
||||
@@ -112,9 +112,9 @@ impl fmt::Display for ControlInstruction {
|
||||
&ControlInstruction::CatchExecute =>
|
||||
write!(f, "execute_catch"),
|
||||
&ControlInstruction::DisplayCall =>
|
||||
write!(f, "call_display"),
|
||||
write!(f, "display_call"),
|
||||
&ControlInstruction::DisplayExecute =>
|
||||
write!(f, "execute_display"),
|
||||
write!(f, "display_execute"),
|
||||
&ControlInstruction::DuplicateTermCall =>
|
||||
write!(f, "call_duplicate_term"),
|
||||
&ControlInstruction::DuplicateTermExecute =>
|
||||
@@ -164,7 +164,7 @@ impl fmt::Display for BuiltInInstruction {
|
||||
&BuiltInInstruction::CleanUpBlock =>
|
||||
write!(f, "clean_up_block"),
|
||||
&BuiltInInstruction::CompareNumber(cmp, ref at_1, ref at_2) =>
|
||||
write!(f, "number_test {}, {}, {} ", cmp, at_1, at_2),
|
||||
write!(f, "number_test {}, {}, {} ", cmp, at_1, at_2),
|
||||
&BuiltInInstruction::DynamicCompareNumber(cmp) =>
|
||||
write!(f, "dynamic_number_test {}", cmp),
|
||||
&BuiltInInstruction::EraseBall =>
|
||||
|
||||
@@ -39,11 +39,7 @@ impl<'a> QueryIterator<'a> {
|
||||
&QueryTerm::Catch(ref terms) => {
|
||||
let state = TermIterState::Clause(0, ClauseType::Catch, terms);
|
||||
QueryIterator { state_stack: vec![state] }
|
||||
},
|
||||
&QueryTerm::Display(ref terms) => {
|
||||
let state = TermIterState::Clause(0, ClauseType::Display, terms);
|
||||
QueryIterator { state_stack: vec![state] }
|
||||
},
|
||||
},
|
||||
&QueryTerm::DuplicateTerm(ref terms) => {
|
||||
let state = TermIterState::Clause(0, ClauseType::DuplicateTerm, terms);
|
||||
QueryIterator { state_stack: vec![state] }
|
||||
@@ -56,11 +52,15 @@ impl<'a> QueryIterator<'a> {
|
||||
let state = TermIterState::Clause(0, ClauseType::Functor, terms);
|
||||
QueryIterator { state_stack: vec![state] }
|
||||
},
|
||||
&QueryTerm::Display(ref terms) => {
|
||||
let state = TermIterState::Clause(0, ClauseType::Display, terms);
|
||||
QueryIterator { state_stack: vec![state] }
|
||||
},
|
||||
&QueryTerm::Inlined(InlinedQueryTerm::CompareNumber(_, ref terms))
|
||||
| &QueryTerm::Is(ref terms) => {
|
||||
let state = TermIterState::Clause(0, ClauseType::Is, terms);
|
||||
QueryIterator { state_stack: vec![state] }
|
||||
},
|
||||
},
|
||||
&QueryTerm::Inlined(InlinedQueryTerm::IsAtomic(ref terms))
|
||||
| &QueryTerm::Inlined(InlinedQueryTerm::IsInteger(ref terms))
|
||||
| &QueryTerm::Inlined(InlinedQueryTerm::IsVar(ref terms)) =>
|
||||
|
||||
Submodule src/prolog/parser updated: 87d3b043bb...aa164cabe6
Reference in New Issue
Block a user