Skip to content

Commit

Permalink
FIXED: explain/1 to report the same predicate multiple times.
Browse files Browse the repository at this point in the history
This happens if the predicate is imported into multiple modules.
  • Loading branch information
JanWielemaker committed Nov 27, 2024
1 parent c1379fa commit 29fffe2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/explain.pl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
[ explain/1,
explain/2
]).
:- autoload(library(apply),[maplist/2,maplist/3]).
:- autoload(library(apply),[maplist/2]).
:- autoload(library(lists),[flatten/2]).
:- autoload(library(prolog_code), [pi_head/2]).
:- autoload(library(solution_sequences), [distinct/2]).

:- if(exists_source(library(pldoc/man_index))).
:- autoload(library(pldoc/man_index), [man_object_property/2]).
Expand Down Expand Up @@ -146,7 +147,7 @@
Arity >= 0,
!,
functor(Head, Name, Arity),
known_predicate(Module:Head),
distinct(Module, known_predicate(Module:Head)),
( Module == system
-> true
; \+ predicate_property(Module:Head, imported_from(_))
Expand Down

0 comments on commit 29fffe2

Please sign in to comment.