tags:

views:

83

answers:

2

Hey guys, this should be quite simple to answer....

Im using XSB Prolog...trying to load a .p prolog database

I have a file xxx.P in directory C:\XSB

So in XSB I type

?consult('xxx.p').

and i get:

cannot find the file or module xxx.p

i've tried moving the p file to the same directory as the XSB executable but no luck. Any ideas?

edit: contents of xxx.p:

has_access(tom,123).
has_access(bob,456).

thanks

+1  A: 

Try using the fully qualified name of the file like this:

 ?consult('C:\\XSB\\xxx.p').

If I remember correctly you have to escape the backslashes.

Vincent Ramdhanie
tried that, just seems to return: no
KP65
Returning no means that it found the file so that is progress. Maybe the content of the file needs to be considered now. What does the file contain?
Vincent Ramdhanie
please see the original post for the contents of the file. thanks
KP65
+1  A: 

XSB uses the file extension to determine the file type and it only recognizes .P (capital P) and .pl as Prolog files. Name your file with either a .P or .pl extension and consult it that way.

| ?- consult('test.p').

no
| ?- consult('test.P').
[Compiling .\test]
[test compiled, cpu time used: 0.0200 seconds]
[test loaded]

yes
Jeff Dallien
wohoo! thank you sir!
KP65