add built_in to predicate_property

This commit is contained in:
Mark Thom
2021-02-02 15:03:14 -07:00
parent 814c034683
commit 8900df6f13
7 changed files with 60 additions and 9 deletions

View File

@@ -16,11 +16,13 @@ phrase(GRBody, S0) :-
phrase(GRBody, S0, S) :-
( var(GRBody) -> throw(error(instantiation_error, phrase/3))
( var(GRBody) ->
throw(error(instantiation_error, phrase/3))
; strip_module(GRBody, _, GRBody0),
dcg_constr(GRBody0) ->
phrase_(GRBody0, S0, S)
; functor(GRBody, _, _) -> call(GRBody, S0, S)
; functor(GRBody, _, _) ->
call(GRBody, S0, S)
; throw(error(type_error(callable, GRBody), phrase/3))
).
@@ -49,6 +51,7 @@ phrase_(phrase(NonTerminal), S0, S) :-
phrase_([T|Ts], S0, S) :-
append([T|Ts], S, S0).
% The same version of the below two dcg_rule clauses, but with module scoping.
dcg_rule(( M:NonTerminal, Terminals --> GRBody ), ( M:Head :- Body )) :-
dcg_non_terminal(NonTerminal, S0, S, Head),