How to convert integ开发者_高级运维er to decimal point in PROLOG? Example, imagine I assign Integer = 10
Assume that you want a predicate that replaces Number1 with Number2 in a list. Of course it is trivial to write a recursive function for that, like:
I recently began 开发者_如何学Goprogramming in Prolog and am currently trying to create rules that find the element after a given element in a list. For example, I want find(2,X,[1,2,3,4]). to result
I have a list of characters (basically a word) and I want to substitute the vowels in the word by underscore [\'_\'] and return a new list.
How do I do an operation for each element of a list, in order? Based on these two resources: http://www.swi-prolog.org/pldoc/doc/swi/library/lists.pl
I am using Windows, and i want to interpret/compile a prolog file with cmd, is any method to do that?. The purpose is to make a shell to the interpreter/compiler prolog to a file like:
I can\'t find any documentation on "not equal" sign in Visual Prolog. Please provide the right solution of this problem:
Excuse me if this is the wrong place to ask. I have been using SWI Prolog\'s clpq library to solve simplex. I find the syntax pretty simple and expressive. It looks like this:
For example I have: upred(mary, have, knife). upred(john, have,sword). upred(sam, have, bowl). upred(sword, is,long).
anyone have idea how to solve this problem counts the number of occurrences of an operator inside an expression. For instance, the query: