Prolog Syntax Error : Operator expected 
You need to say at the beginning of the
file/module
: use_module(library(clpfd)).
And apart from that, you most probably want to say
T2 #>= T1 + L1.
Also, abs(T2T1) #>= min(L1,L2) can be said,
regardless of the order.

Prolog  Matrix equation 
To utilize clpfd, let's use library(clpfd)), not
library(bounds)!
: use_module(library(clpfd)).
We can state the constraints that must hold like
this:
m3x3_zs(Mss,Zs) :
Mss = [[M11,M12,M13], [M21,M22,M23],
[M31,M32,M33]],
Zs = [ M11,M12,M13 , M21,M22,M23 ,
M31,M32,M33 ],
Zs ins 0..9,
5 #= M11+M12M13, % row
constraints
8 #= (M21M22)*M23, % (see t

Somebody could help me with this little program in prolog? 
(Your program has several errors: In particular
use_module(xx) must be prefixed with :)
constraints/1 essentially looks like this:
constraints(L) :
member(a, L),
member(b, L),
member(c, L),
member(d, L).
So you demand that a, b, c, and d are elements of
L. But nowhere do you state how long the list
should be. You can observe this by looking at
alternate answers pressing ;Return.

Converting input to list in prolog 
In SWIPrologyou can use atomic_list_concat/3 with
the first argument (a list) uninstantiated, the
second argument the separatorn (',' in your case)
and the third argument the atom you already have
(A). Note that this use of atomic_list_concat/3 is
not portable
E.g.:
atomic_list_concat(L, ',', A)

Printing on separate lines from a list 
You can do it by applying writeln to list elements
using maplist/2:
mylist([quick,brown,fox,jumps,over,the,lazy,dog]).
:mylist(X), maplist(writeln, X).
Demo.
The above prints
quick
brown
fox
jumps
over
the
lazy
dog

How to change string to integer 
Prolog datatypes don't include 'strings'.
SWIprolog added it recently, but you can stay on
ISO safety lane with number_codes

Inequality solving using Prolog 
library(clpr) documentation advises that it deals
with non linear constraints only passively, so
you're out of luck. You need a more sophisticated
algebra system.

Converting a user input string to list 
SWIProlog offers tokenize_atom
? [library(porter_stem)].
? tokenize_atom('How are you today ?', L).
L = ['How', are, you, today, ?].
note that quoting atoms is necessary only when the
lexical representation aliases some other type
(notably variables)

Prolog  Subset 
(Many Prolog systems including SICStus and SWI
have a subset/2 in their library, but rather
subset(Subset, Set) ; and it is also not a clean
relation...)
It all depends on what you mean by a set. Is [1,
1] a valid set? Do they have to occur in one order
or the other? Your definition is fine, if you
permit duplicates. After all your definition
reads:
set_subset(Set, Subset): All elements of Su

set up a Parent son relationship in prolog 
Your parent(X, L) predicate only takes 2
variables, X and L, but you are trying to call it
with 3. You need to either create or update a
parent predicate to take 3 parameters, or you need
to not pass Solution into parent.
Without seeing the rest of the code, we can't be
sure which way is correct.

Prolog  Arguments are not sufficiently instantiated  Knight/chessboard 
It's breaking on the >= test in validSquare. You
can't determine the truth value of X <= Y when
both are unbound, basically, because numerical
operators don't assign values. You could solve
this by using a member to bind the coordinates to
valid squares, i.e.
validSquare(X1/Y1, X2/Y2):
member(X1, [1,2,3,4,5,6,7,8]),
member(X2, [1,2,3,4,5,6,7,8]),
member(Y1, [1,2,3,4,5,6,7,8]),

Represent following fact in prolog 
Prolog allows to represent knowledge by facts and
rules. A
fact and a rule have the following format:
A : A1, .., An
Where A, A1, .., An are so called literals. If n=0
then its
a fact, if n>0 then its a rule.
A literal has the folllowing syntax, name is the
predicate name
and the terms are the arguments of the predicate:
literal = atom [ "(" term { "," term } ].
Knowledge respresentati

Not in Prolog and use of Bagof 
Use of not
You can't use Prolog predicates like functions.
not/1 is a predicate which accepts a query as an
argument. So this isn't doing what you think:
movie(X,not(abrams),fantasy).
This is querying movie with a second argument of
not(abrams). You don't have any facts or
predicates that match movie(_, not(_), _) so it
will always fail.
If you want to know which films were not
thrillers, you

prolog implement custom flatten 
Not perfect but works:
myflat([[A,BList]ListOfLists], [AOutput]) :
myflat([[BList]ListOfLists], Output).
myflat([[A],[AList]ListOfLists], [A,0Output])
:
myflat([[AList]ListOfLists], Output).
myflat([[A],[BList]ListOfLists], [AOutput]) :
A == B,
myflat([[BList]ListOfLists], Output).
myflat([[A]], [A]).
Sample input/output:
? myflat([[1,2,1],[1,2],[2,1]], X).
X

Sum of alternating elements of a list 
Things like these can be better expressed with the
program structure:
list_altsum([], 0).
list_altsum([A], S) :
S is A.
list_altsum([A,BABs],S0) :
list_alsum(ABs, S1),
S0 is AB+S1.
Alternatively:
list_altsum(Xs, S) :
list_altsum(Xs, 1, S).
list_altsum([], _, 0).
list_altsum([AAs], F0, S0) :
F1 is F0,
list_altsum(As, F1, S1),
S0 is F0*A+S1.

prolog generate list of numbers from a list[x,y] 
The problem is in your second clause. When you
have [XT], it means that T is a list. In the body
you write generate([X,S1],[T]): by writing [T]
you're now saying the second argument to generate
is a list of which the only element is this list
T. What you want to say is that it is simply this
list T:
generate([T,1], [T]).
generate([X,S], [XT]) : S1 is S1,
generate([X,S1], T).

Turn Depth First Search into a BestFirst (greedy) Search in prolog 
The trick is to not allow prolog to choose the
next move for you, but rather gather all of the
possible moves so you can use your criteria to
select the best one.
Look into the find_all predicate.

Prolog simple generator 
Your description is not that clear to me, I am
rather guessing which values should be known and
which are asked. So I will rather use
library(clpfd) where I do not have to make such
considerations myself.
N>M>0, K>L>0, (M/N)*(K/L) = 2 and
(M+K)<A
p(A, M/N, K/L) :
N #> M, M #> 0,
K #> L, L #> 0,
M+K #< A,
(M/N) * (K/L) #= 2.
? 3/2 #= F.
F = 1.
? (

Prolog: Splitting List into 3 Lists in Order 
div(L, L1, L2, L3) :
append(L1, L1_suffix, L),
append(L2, L3, L1_suffix).
Do you see how this splits the three lists? Now
you don't say how long you expect the lists L1,
L2, and L3 to be. You can use length/2 to get the
length of L and set the length of the three
results if you don't want the predicate to be as
general as it is at the moment.
Since you say "relatively even length", whi

How do two atomic formulas unify? 
In order for unification the functors must match
exactly. That is m and n are two different
functors hence the entire expression cannot unify.
In the first example the functors for both
expressions are the same.


