clpfd
Prolog: iteration
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.[详细]
2023-03-29 17:07 分类:问答Prolog recursion overflow
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[详细]
2023-03-15 01:44 分类:问答Prolog Cryptarithmetic Puzzle
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[详细]
2023-02-24 19:20 分类:问答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[详细]
2023-02-22 20:05 分类:问答Cryptogram solver in Prolog
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[详细]
2023-02-18 19:13 分类:问答Tennis match scheduling
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.[详细]
2023-02-06 06:13 分类:问答prolog, test(X, Y, Z) :- Y is X + Z
How to get Y and Z in prolog, when I only k开发者_开发问答now X? For example: test(X, Y, Z) :- X is Y + Z.[详细]
2023-01-29 11:35 分类:问答convert float to integer in prolog
How to convert float to integer in prolog? 开发者_JS百科 I tried: ?- integer(truncate(sqrt(9))). false.[详细]
2023-01-28 03:41 分类:问答Simple nth1 predicate in Prolog
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[详细]
2023-01-25 23:08 分类:问答Unification - Infinity of results
I\'m developing (in Java), for fun, an applic开发者_如何学Cation which uses an unification algorithm.[详细]
2023-01-24 19:45 分类:问答