Category "prolog"

How can i set a newline in a set string in SWI-Prolog?

I have this string: B='Dogs cats birds and fish'. and i need it to appear in the format bellow: Dogs, cats, birds, and fish Is there any possible way for

Prolog power of 2 recursion

Need help creating a recursive clause is a rule: X is a power of 2 only if there is a Y such that when adding Y to Y the result is X, and Y is a power of 2. in

SWI-Prolog: Use operators from modules?

I have a prolog-file (name definitions.pl) of this kind of type: :- module(definitions,[]). :-op(699, xfx, :=). :-op(599, xfy, ∪). C := (A ∪ B) :- u

SWI-Prolog: How to retrieve confidence intervals for both input and output?

I have a knowledge base in SWI-Prolog that consists of rules with the form: input(a,c1,b,c2,c,c3):-output(good,c4). (c1,c2,c3,c4 represent the confidence values

Representing Infinite Domains in Prolog

How is it possible to represent infinite domains in Prolog? I have been searching this topic for a while, but do not have a clue. Any help is appreciated.

Finding shortest path of undirected weighted graph in prolog

I am trying to do a shortest path for a London underground system inside prolog, and I'm stuck I've managed to get the code to return lists of all the possible

How to get the first, middle and last element of a list scheme and prolog?

I am trying to write a function in Scheme and Prolog that returns first, middle and last item of a list. E.g., find([4,5,8,7,9],L), L = [4,8,9]. I came up with

How to generate distinct solutions in Prolog for '8 out of 10 cats does countdown' numbers game solver?

I wrote a Prolog program to find all solutions to any '8 out of 10 cats does countdown' number sequence. I am happy with the result. However, the solutions are

Constraint Programming library or syntax issue in SWI-Prolog

I'm just trying to figure out constraint programming in SWI-Prolog, looking at this tutorial : http://en.wikibooks.org/wiki/Prolog/Constraint_Logic_Programming