I’m using: SWI-Prolog version 8.2.1
I had to do a project for university and my professor gave me a list of predicates to recreate. Some of those already exist and so, when i’m compiling, the listener give me this No permission to redefine imported_procedure for each predicate. I have problems with vertices/2 and heap_size/2.
The listener says that i’m importing some library that probably he’s loading without my will (library ugraph and library heap).
My code looks like this:
:- dynamic graph/1.
:- dynamic vertex/2.
:- dynamic arc/4.
:- dynamic heap/2.
:- dynamic heap_entry/4.
...
vertices(G, Vs) :-
graph(G),
findall(V, vertex(G, V), Vs),
!.
...
heap_size(H, S) :-
heap(H, S).
I had the same problem with the predicate neighbors/3 in previous days, but now nothing happens.
neighbors(G, V, Ns) :-
vertex(G, V),
!,
findall(arc(G, V, N, W), arc(G, V, N, W), Ns1),
findall(arc(G, N, V, W), arc(G, N, V, W), Ns2),
append(Ns1, Ns2, Ns).