This commit is contained in:
Mark Thom
2020-05-04 11:18:13 -06:00
parent 0111db6744
commit 8e9273a96a
2 changed files with 14 additions and 17 deletions

View File

@@ -6,11 +6,6 @@
:- use_module(library(error)).
:- use_module(library(lists), [append/3]).
user:term_expansion(Term0, Term) :-
nonvar(Term0),
dcg_rule(Term0, (Head :- Body)),
Term = (Head :- Body).
phrase(GRBody, S0) :-
phrase(GRBody, S0, []).
@@ -133,3 +128,8 @@ dcg_cbody(\+ GRBody, S0, S, ( \+ phrase(GRBody,S0,_), S0 = S )).
dcg_cbody(( GRIf -> GRThen ), S0, S, ( If -> Then )) :-
dcg_body(GRIf, S0, S1, If),
dcg_body(GRThen, S1, S, Then).
user:term_expansion(Term0, Term) :-
nonvar(Term0),
dcg_rule(Term0, (Head :- Body)),
Term = (Head :- Body).