How troubleshoot ERROR: toplevel: Undefined procedure ?!
Hello, I Follow: Knowledge Processing For Autonomous Robot
I write a simple knowledge base as a test.pl in prolog file, in my package then I try to query it
prolog -f test.pl
and I get a top level error !
?- cup(cup0).
ERROR: toplevel: Undefined procedure: cup/1 (DWIM could not correct goal)
Edit
amal@amal-HP-G62-Notebook-PC:~$ prolog -f test.pl
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 5.10.4)
Copyright (c) 1990-2011 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
?- cup(cup0).
ERROR: toplevel: Undefined procedure: cup/1 (DWIM could not correct goal)
?-
and that is what in test.pl
cup(cup0).
dairyProduct(milk1).
meatProduct(ham2).
cupboard(cupboard3).
refrigerator(fridge4).
perishable(Prod) :- dairyProduct(Prod), meatProduct(Prod).
storagePlaceFor(Loc, Item) :- refrigerator(Loc), perishable(Item).
storagePlaceFor(Loc, Item) :- cupboard(Loc), cup(Item).
searchForIn(Item,Loc) :- storagePlaceFor(Loc, Item).
any suggestion ?!
Thanks.