Top "Prolog" questions

Do not use this tag like Prologue and Epilogue.

Read a file line by line in Prolog

I'd like to read a plain text file and apply a predicate to each line (the predicates contain write which …

io prolog swi-prolog dcg
How do I get the sum of given numbers in prolog?

I'm new to prolog and I'm doing some exercises for practice. So I'm trying to get the sum of the …

list prolog sum clpfd
Subsets in Prolog

I'm looking for a predicate that works as this: ?- subset([1,2,3], X). X = [] ; X = [1] ; X = [2] ; X = [3] ; X = [1, 2] ; X = [1, 2, 3] ; X = [2, 3] ; ... I've …

list prolog set subset
How to concatenate two atoms/strings?

I'm trying to find out how to concatenate two atoms: A = 'my ', B = 'atom', How can I concatenate these …

prolog
"dynamic" predicate in prolog

If I want to make a rule dynamic so i can use assert after the database file has been loaded, …

prolog prolog-directive-dynamic
What are the main technical differences between Prolog and miniKanren, with respect to logic programming?

When I want to read up on logic programming I always stumble over two "main" ways to do it nowadays: …

prolog logic-programming minikanren
What are the uses of the fail predicate in Prolog?

I can't come up with a situation where I would need it.

prolog prolog-dif
Sum of the first n numbers in prolog

Hello can anyone help me compute the sum of the first n numbers. For example n=4 => sum = 10. So far …

prolog turbo-prolog visual-prolog
Prolog: Clauses are not together in source-file

I have this piece of code: % Family tree female(pen). male(tom). male(bob). female(liz). female(pat). female(ann). …

prolog iso-prolog
SWI-Prolog - show long list

I'm using SWI-Prolog and I'm trying to print a list but if the list has more than 9 items - it …

prolog swi-prolog prolog-toplevel