swi-prolog Questions

2

Solved

I know I can do X is random(10). to get a random number from 0 to 10, but is there a similar command to get a random matching item?
Worshipful asked 14/2, 2010 at 13:43

3

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. Ex : Say I have a sentence like this : "this is a string" Is there ...
Amherst asked 20/10, 2010 at 10:36

2

Solved

I would like to know is it possible to use predsort/3 without losing duplicate values? If not, that how should I sort this list of terms? Current sort function: compareSecond(Delta, n(_, A, _), n...
Ermines asked 23/11, 2011 at 18:9

2

Solved

I've been trying to parse a file containing lines of integers using phrase_from_file with the grammar rules line --> I,line,{integer(I)}. line --> ['\n']. thusly: phrase_from_file(line,'in...
Somme asked 26/7, 2011 at 9:6

1

Solved

How can I use the SWI-Prolog Semantic Web Library to make a query into the OWL/RDF file and extract some information? The OWL/RDF file is having information about all the Debian packages so I need...
Gondola asked 13/6, 2011 at 6:11

2

My SWI-Prolog knowledge base contains the following two facts: f(a,b). f(a,c). Now if I pose the query ?- f(a,c). true. But ?- f(a,b). true ; false. Why is f(a,b) both true and false? Thi...
Polytypic asked 24/7, 2010 at 0:2

2

Solved

I want to load this simple something into my Editor: Write:-repeat,write("hi"),nl,fail. So that it prints "hi". What should I do? I'm currently trying to do File->New and Saving a file nam...
Lasandralasater asked 31/3, 2010 at 20:29

1

what are the two stars in a list? [53, 5, 1, 53, 97, 115, 53, 50, 52, 121, 55, 56, 55, 97, 4, 1, 98, **] I tried searching but no success.
Blowzed asked 1/2, 2010 at 10:12

1

Solved

I'm interested in embedding a Prolog interpreter in Java. One option is using JPL, but the download links on the JPL site are broken, and the installation page mentions a jpl.zip that I can't find....
Bacteriostat asked 27/5, 2009 at 8:0

© 2022 - 2024 — McMap. All rights reserved.