restore old thread_goals to fix top-level solutions printing bug
This commit is contained in:
@@ -709,15 +709,6 @@ expand_goal(UnexpandedGoals, Module, ExpandedGoals, HeadVars) :-
|
|||||||
)
|
)
|
||||||
).
|
).
|
||||||
|
|
||||||
thread_goals([SG|SGs], G, F) :-
|
|
||||||
( SGs \== [], functor(G, F, 2) ->
|
|
||||||
arg(1, G, SG),
|
|
||||||
arg(2, G, Gs1),
|
|
||||||
thread_goals(SGs, Gs1, F)
|
|
||||||
; SG = G,
|
|
||||||
SGs = []
|
|
||||||
).
|
|
||||||
|
|
||||||
thread_goals(Goals0, Goals1, Hole, Functor) :-
|
thread_goals(Goals0, Goals1, Hole, Functor) :-
|
||||||
( var(Goals0) ->
|
( var(Goals0) ->
|
||||||
Goals1 =.. [Functor, Goals0, Hole]
|
Goals1 =.. [Functor, Goals0, Hole]
|
||||||
@@ -731,7 +722,6 @@ thread_goals(Goals0, Goals1, Hole, Functor) :-
|
|||||||
)
|
)
|
||||||
).
|
).
|
||||||
|
|
||||||
/*
|
|
||||||
thread_goals(Goals0, Goals1, Functor) :-
|
thread_goals(Goals0, Goals1, Functor) :-
|
||||||
( var(Goals0) ->
|
( var(Goals0) ->
|
||||||
Goals0 = Goals1
|
Goals0 = Goals1
|
||||||
@@ -744,7 +734,6 @@ thread_goals(Goals0, Goals1, Functor) :-
|
|||||||
; Goals1 = Goals0
|
; Goals1 = Goals0
|
||||||
)
|
)
|
||||||
).
|
).
|
||||||
*/
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
%
|
%
|
||||||
|
|||||||
@@ -380,13 +380,6 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
|||||||
LS::evacuate(self)
|
LS::evacuate(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
#[inline(always)]
|
|
||||||
pub(crate) fn load_state(&mut self) -> &mut LoadStatePayload<<LS as LoadState<'a>>::TS> {
|
|
||||||
self.payload.as_mut()
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
fn dequeue_terms(&mut self) -> Result<Option<Declaration>, SessionError> {
|
fn dequeue_terms(&mut self) -> Result<Option<Declaration>, SessionError> {
|
||||||
while !self.payload.term_stream.eof()? {
|
while !self.payload.term_stream.eof()? {
|
||||||
let load_state = &mut self.payload;
|
let load_state = &mut self.payload;
|
||||||
@@ -395,7 +388,6 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
|||||||
|
|
||||||
let term = load_state.term_stream.next(&composite_op_dir)?;
|
let term = load_state.term_stream.next(&composite_op_dir)?;
|
||||||
|
|
||||||
// if is_consistent is false, self.predicates is not empty.
|
|
||||||
if !term.is_consistent(&load_state.predicates) {
|
if !term.is_consistent(&load_state.predicates) {
|
||||||
self.compile_and_submit()?;
|
self.compile_and_submit()?;
|
||||||
}
|
}
|
||||||
@@ -450,14 +442,6 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
|||||||
let machine_st = LS::machine_st(&mut self.payload);
|
let machine_st = LS::machine_st(&mut self.payload);
|
||||||
let term_addr = machine_st[heap_term_loc];
|
let term_addr = machine_st[heap_term_loc];
|
||||||
|
|
||||||
/*
|
|
||||||
if let Ok(lit) = Literal::try_from(term_addr) {
|
|
||||||
return Ok(Term::Literal(Cell::default(), lit));
|
|
||||||
} else if machine_st.is_cyclic_term(term_addr) {
|
|
||||||
return Err(SessionError::from(CompilationError::CannotParseCyclicTerm));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
let mut term_stack = vec![];
|
let mut term_stack = vec![];
|
||||||
let mut iter = stackful_post_order_iter(&mut machine_st.heap, term_addr);
|
let mut iter = stackful_post_order_iter(&mut machine_st.heap, term_addr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user