If I have defined all the digits in a Prolog database, such as dig(0), dig(1), ...,开发者_如何学运维 dig(9). What query can I use for Prolog to return the largest digit -- in this case, 9?
I am trying to call a prolog program and receive output into my bash script. 开发者_C百科 Currently I am using the extremely crude version of using halt(0) or halt(1) and then examining the exit code
Ok, here\'s the deal: I\'ve got two piles of shirts I want to take a random shirt from each pile and put them in a new pile
I need to build a new list with a \"loop\". Basically i can\'t use recursion explicitly, so i am using append to go through lists of list.
So , i still don\'t completely understand how lists and recursion work in prolog, could be why i am having trouble with this, but i don\'t even know how to begin this problem.
I am trying my hands on SWI-Prolog in win xp. I am trying to understand how to split a sentence in Prolog into separate atoms.
I have a problem where I have a list like this: [[el1, el2, el3], [el4, el5, el6], [[el7, el8, el9], [el10, el11, el12], ..... , [elxx, elyy, elzz]],
TL;DR: Need help calling a rule with a fact I´ve started out with Prolog, coming from C and got stuff working... until they evidently got broken. I´m writing a small car-paint program for myself as
I am trying to write Prolog code to determine whether the bound variable X is in the scope of the bound variable Y in a list. Lists may be nested and X is in the scope of Y if X and Y are members of t
i am writing a predicate in prolog to delete an atom in a list, but i stuck on how to check if the atom is whether a list inside a list. a开发者_运维百科ny suggestions.Iterate throughout a list and ge