Good evening, i have a simple problem, and i warn you that i am very new with prolog. Suppose to have three lists of the same size, each containing only 1s, 0s or -1s.
fact(1,1):-!. fact(N,F):- N1=N-1, fact(N1,F1), F=F1*N. It leads to the stackoverflow(not the site)! It shouldn\'t because of the cut(!). Does it work 开发者_运维技巧in SWI-Prolog?Please note that bo
I have been asked to solve a Cryptarithmetic Puzzle using Prolog: GIVE * ME ------ MONEY The above is the puzzle, I cannot figure out where is the problem, the result always returns false. Plus I
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
I have to solve a cryptogram which looks like this: ABC / DEF = 0.GHGHGH... where length of variables may be different. Also rep开发者_开发百科etition may be different (like 0.XYZXYZ...). I\'ve wri
There are a limited number of players and a limited number of tennis courts.At each round, there can be at most as many matches as there are courts.
How to get Y and Z in prolog, when I only k开发者_开发问答now X? For example: test(X, Y, Z) :- X is Y + Z.
How to convert float to integer in prolog? 开发者_JS百科 I tried: ?- integer(truncate(sqrt(9))). false.
With SWI Prolog, there\'s a predicate that finds the nth item in a list called nth1.I want to implement my own version of the predicate but SWI\'s is so complicated if you look at the listing(nth1) co
I\'m developing (in Java), for fun, an applic开发者_如何学Cation which uses an unification algorithm.