0
:-consult('external data base.pl').

listaw:-
    new(SS, dialog('Rekordy w bazie wiedzy')),
    send(SS, display, new(W3,text('some text'))),
    new(M,menu(von,cycle)),
    findall(B,failure(B,_,_),Y),
    send_list(M, append, Y),
    send(SS,open).

with external Data base with facts: failure(aaa,bwww,cdd).

I have error:

26 ?- listaw. ERROR: Arguments are not sufficiently instantiated ^ Exception: (18) pce_util:send_list(user:@18495295/menu, append, _G534) ?

What is the problem? When I have all facts in the same file with code above, everything works... but I want to use external data base...enter code here

false
  • 10,264
  • 13
  • 101
  • 209
Przemek
  • 71
  • 1
  • 1
  • 4
  • Tried your code above, both with the `failure/3` fact in the same file as the `listaw/0` predicate and in an external file. It worked in both cases without throwing any exception. – Paulo Moura Sep 10 '13 at 02:05
  • @Paulo Moura ... strange. Did you cleaned dynamic memory after compiling code with predicade in the same file and before compiling with predicate in external file? – Przemek Sep 10 '13 at 07:35
  • 1
    I restarted the Prolog interpreter between the two experiments. Are you sure that your database file is being successfully loaded? Best to wrap the call to `consult/1` in an `initialization/1` directive. This way you will get a printed warning if the directive fails. Also, using arbitrary queries as directives instead of the `initialization/1` directive is bad programming style. – Paulo Moura Sep 10 '13 at 10:19
  • Thanks! I know where is the problem. IF in database is blank record: failure(_,_,_) - then the program isn't working... . I had something like this... . – Przemek Sep 10 '13 at 11:05

0 Answers0