I have this code that uses library(clpBNR):
edge(T, A, B) :-
seg(A1, B1),
point(A,PA),
point(B,PB),
dist(A1, PA, T),
dist(B1, PB, T).
dist(p(X1, Y1), p(X2, Y2), D) :-
% clpBNR constraint, X1/Y1/X2/Y2/D don't have to be ground
{ sqrt((X2 - X1)^2 + (Y2 - Y1)^2) =< D }.
seg(..., ...) % Not important, omitted for brevity
point(..., ...)
Now, when I try to get the body of edge/3 with clause/2 I get … silent death:
122 ?- listing(edge/3).
experiment_file:edge(T, A, B) :-
seg(A1, B1),
point(A, PA),
point(B, PB),
dist(A1, PA, T),
dist(B1, PB, T).
true.
123 ?- clause(edge(A,B,C), Bod).
false.
Is this normal? Is there an alternative to clause/2 to get the body of a clause when there are attributed variables in one of the body goals?