list - prolog delete head from a clause -


i using yap. suppose have scenario:

p(x,y) :- q(x), f(x,y), g(x).

i need put body of predicate in list using command listing(p).

expected output should be: [q,f,g].

how can that?

with service predicate

enum_conj((a, b),x) :- !, (enum_conj(a, x) ; enum_conj(b, x)). enum_conj(x, x). 

we can do

?- clause(p(_, _), p), setof(f, j^a^(enum_conj(p, j), functor(j, f, a)), l). l = [f,g,q], p = (q(x),f(x,y),g(x)) 

all builtins used iso standard


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -