I ran into the following broken behavior:
Three tiny files (attached):
:- export foo/1.
test(X) :- G = (m1:foo(X)), load_dyn(m2), fact(G1), G=G1.
I am testing here if m1:foo/1 from m2.P is the same as m1:foo/1 from m3.P.
If you ask ?- test(X) then you get a no -- they are not the same.
The culprit here is
which somehow imports foo/1 into usermod and changes the meaning of G = (m1:foo(X)).
If you delete ?- [m1]. in m3.P then the query test(X) returns X=abc, i.e., the two m1:foo/1's are the same functor.
I think this is a serious bug that makes XSB modules very hard to use reliably for meta programming.
I could possibly understand the rationale there might have been if I were using straight foo/1 instead of m1:foo/1 But with m1:foo I am clearly stating that my intent is to construct foo/1 in module m1.
So, I am not sure what XSB is doing here.