restore old thread_goals to fix top-level solutions printing bug

This commit is contained in:
Mark Thom
2021-11-23 19:59:35 -07:00
parent 4af57b0dd3
commit 10bb6ab3bb
4 changed files with 37 additions and 64 deletions

View File

@@ -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) :-
( var(Goals0) ->
Goals1 =.. [Functor, Goals0, Hole]
@@ -731,7 +722,6 @@ thread_goals(Goals0, Goals1, Hole, Functor) :-
)
).
/*
thread_goals(Goals0, Goals1, Functor) :-
( var(Goals0) ->
Goals0 = Goals1
@@ -744,7 +734,6 @@ thread_goals(Goals0, Goals1, Functor) :-
; Goals1 = Goals0
)
).
*/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%

View File

@@ -380,13 +380,6 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
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> {
while !self.payload.term_stream.eof()? {
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)?;
// if is_consistent is false, self.predicates is not empty.
if !term.is_consistent(&load_state.predicates) {
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 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 iter = stackful_post_order_iter(&mut machine_st.heap, term_addr);