Top "Prolog" questions

Do not use this tag like Prologue and Epilogue.

Deleting all occurrences of an element from a list

Trying to write a procedure that given a value and a list, it deletes all the occurence of that value …

prolog prolog-dif
Prolog-iterating through list

Let's say i have list Xs = [a,b,c]. Now i want to iterate through all elements and call another …

list prolog iteration head
Program to generate fibonacci series in GNU Prolog is giving an instantiation error

This is my code:- fib(0,0). fib(1,1). fib(F,N) :- N>1, N1 is N-1, N2 is N-2, F …

prolog fibonacci instantiation-error
Prolog gives error "undefined procedure" when trying to use :-

I'm using SWI-Prolog on Windows and am getting the following error: 14 ?- parent(X, Y) :- child(Y, X). ERROR: …

prolog prolog-toplevel
Difference between logic programming and functional programming

I have been reading many articles trying to understand the difference between functional and logic programming, but the only deduction …

haskell functional-programming prolog
Prolog implying a negative predicate

How can I write the following rule in PROLOG: if P then not Q I understand that you can easily …

prolog negation
Prolog map procedure that applies predicate to list elements

How do you write a Prolog procedure map(List, PredName, Result) that applies the predicate PredName(Arg, Res) to the …

prolog map-function meta-predicate
Prolog Create a List

I have to create list of n elements for example, do_list(5,L1). should return, L1=[1,2,3,4,5]. This is what I …

list prolog insert-update
Exclamation mark in Prolog

Given the following facts and predicates: sound(time1). sound(time2). sun(time3). relax(X):-sound(X),!,sun(X). relax(_):-sun(_). …

prolog
Prolog - ASSERT and RETRACT

I was wondering, I am aware you can use assert to add facts or rules or whatever if you have …

prolog prolog-assert