From a9fa343bad934ba416981f2c6b7d909b84ed1aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 22 Oct 2015 11:58:29 +0100 Subject: [PATCH] don't expand meta-vars and don't expand expanded variables... --- pl/modules.yap | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pl/modules.yap b/pl/modules.yap index 6be66e2eb..8cd4c8b77 100644 --- a/pl/modules.yap +++ b/pl/modules.yap @@ -765,7 +765,11 @@ expand_goal(G, NG) :- '$do_expand'(G, Mod, prolog, []-G, NG), !. expand_goal(G, G). -'$do_expand'(G, _HM, _BM, _SM, _, G) :- var(G), !. +'$do_expand'(G, _HM, _BM, SM, HVars-_, OG) :- var(G), !, + ( lists:identical_member(G, HVars) -> OG = G; OG = SM:G). +% nothing I can do here: +'$do_expand'(M:G, _HM, _BM, _SM, _HVars, M:G) :- !, + nonvar(M), var(G), !. '$do_expand'(M:G, HM, _BM, _SM, HVars, M:GI) :- !, nonvar(M), '$do_expand'(G, HM, M, M, HVars, GI).