开发者_开发技巧For an assignment I have to generate a prolog procedure body dynamically. How can I do this?See here for the swi prolog manual description of relevant predicates.
I\'m terrible with prolog. I keep getting a duplicate result in this simple code\" mates(bob, john). mates(bob, bill).
I use swi prolog. My code runs for first lin开发者_运维技巧e but it doesn\'t run the others. see(Data), //open file to read
This is my assignment: My attempt was: a) If Fred is a father of Mike, then Fred is an ancestor of Mike.
I am sorry to ask this question, but it has been a lot since I programmed in Prolog.I think I am used to imperative paradigm.:-(
lookup([(X,A)|_],X,A). lookup([_|L],X,A) :- lookup(L,X,A). hi(_,t,bool). hi开发者_运维问答(_,f,bool).
Hey I \'m trying to convert the following statements into prolog code, but I\'m not sure if I did it correctly.
i try to solve a problem about lists but i can\'t... :( PLAYER(TEAM,[PLAYERS WHO PLAY IN THAT TEAM]). player(milan,[seedorf,zambrotta,gattuso]).
I have a string like \'pen,pencil,eraser\'. How can I make this predicate. things(pen,pencil,eraser). Do you have any idea? 开发者_如何学JAVA( I use prolog)Here\'s a small example of specialized Pr
I have开发者_StackOverflow a list like [apple, orange]and I want to convert it to a string like \"apple,orange\" in Prolog. Do you have any idea?In SWI-Prolog you can simply use atomic_list_concat/3 a