From b7233ba9b3096df47649ef57a5f8d0a6eac2a858 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 13 Nov 2023 14:11:07 +0100 Subject: [PATCH] ; Exclude grammar rules from regular goal completion * sweep.pl (sweep_heads_collection/2): Exclude DCG non-terminals when completing a regular goal. --- sweep.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sweep.pl b/sweep.pl index b5eb37c..3109b99 100644 --- a/sweep.pl +++ b/sweep.pl @@ -1288,7 +1288,11 @@ sweep_heads_collection([D,M0,Bef,Aft], Ps) :- -> true ; term_string(M, M0) ), - sweep_matching_predicates(Bef, Aft, D, M, PIs), + sweep_matching_predicates(Bef, Aft, D, M, PIs0), + ( D == 0 + -> exclude([M:P/A]>>sweep_grammar_rule(M, P, A), PIs0, PIs) + ; PIs = PIs0 + ), maplist(sweep_format_head_(D), PIs, Ps). sweep_format_head_(D, M:F/A, [S|SP]) :- -- 2.39.2