fix several issues with goal expansion, crashing after attribute_goals is called

This commit is contained in:
Mark Thom
2019-10-08 12:28:23 -06:00
parent 673fb31ae2
commit 3409db010f
8 changed files with 150 additions and 180 deletions

View File

@@ -7,16 +7,7 @@
user:term_expansion(Term0, (Head :- Body)) :-
dcg_rule(Term0, Term),
Term = (Head :- Body0),
unravel_commas(Body0, Body).
unravel_commas(((A, B), C), Body) :-
!,
unravel_commas((B, C), Body0),
unravel_commas((A, Body0), Body).
unravel_commas((A, B), (A, Body0)) :-
!, unravel_commas(B, Body0).
unravel_commas(Body, Body).
Term = (Head :- Body).
phrase(GRBody, S0) :-
phrase(GRBody, S0, []).