Prolog undefined procedure error? - prolog

just recently started learning Prolog, and I have NO idea why I'm getting this error.
This is the 'code' in the .pl file:
bigger(elephant, horse).
bigger(horse, donkey).
bigger(donkey, dog).
bigger(donkey, monkey).
isbigger(X, Y) :- bigger(X, Y).
isbigger(X, Y) :- bigger(X, Z),print(Z),print(’ ’) ,isbigger(Z, Y).
Whenever I attempt to check which animal is bigger I get this error:
1 ?- bigger(donkey, monkey).
ERROR: toplevel: Undefined procedure: bigger/2 (DWIM could not correct goal)
Any help please?
Thanks.

You need an assert I think:
assert(bigger(donkey, monkey)).
Just started today myself and this one took me a while to figure out.
Good luck!

Related

sjPlot is loaded but R complains that it could not find sjt.corr function

Does anyone have a clue for why stj.corr fails here?
library(sjPlot)
view_df(cars) # works fine
sjt.corr(cars)# produces error Error in sjt.corr(cars) : could not find function "sjt.corr"
tab_corr(cars) would do the job! I guess the other function is deprecated

how to consult a file on a ftp area in prolog?

I try to consult a prolog file from a home server. See below.
So far, no success.
No urgency: I just upload the file locally to a PC where swi-prolog is installed and make the works from there. making the works remote would be a bit better.. = I could works from any PC in the house without uploading locally the file on a PC.
I see the file with PCManFM 1.2.5 from any PC: perhaps this is a question of access because prolog should store in any way the user and pw in order to access automatically the file via ftp.
?- consult(ftp://192.168.178.1/EXCHANGE_02/transfer/uwr).
ERROR: Syntax error: Operator expected
ERROR: consult(ft
ERROR: ** here **
ERROR: p://192.168.178.1/EXCHANGE_02/transfer/uwr) .
?- consult('ftp://192.168.178.1/EXCHANGE_02/transfer/uwr.pl').
ERROR: source_sink `'ftp://192.168.178.1/EXCHANGE_02/transfer/uwr.pl'' does not exist
?- consult("ftp://192.168.178.1/EXCHANGE_02/transfer/uwr.pl").
ERROR: source_sink `"ftp://192.168.178.1/EXCHANGE_02/transfer/uwr.pl"' does not exist

Prolog natural language parser, Arguments are not sufficiently instantiated

i am trying to make a prolog language parser. when i go to load my script my get the error
ERROR: Arguments are not sufficiently instantiated
ERROR: In:
ERROR: [13] throw(error(instantiation_error,_1940))
ERROR: [7] <user>
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
my code is as follows
sentence(Sentence,sentence(np(Noun_Phrase),vp(Verb_Phrase))):-
np(Sentence,Noun_Phrase,Rem),
vp(Rem,Verb_Phrase,[]).
np([X|T],np(det(X),NP2),Rem):-
det(X),
np2(T,NP2,Rem).
np(Sentence,Parse,Rem):- np2(Sentence,Parse,Rem).
np(Sentence,np(NP,PP),Rem):-
np(Sentence,NP,Rem1),
pp(Rem1,PP,Rem).
np2([H|T],np2(noun(H)),T):- noun(H).
np2([H|T],np2(adj(H),Rest),Rem):- adj(H),np2(T,Rest,Rem).
pp([H|T],pp(prep(H),Parse),Rem):-
prep(H),
np(T,Parse,Rem).
vp([H|[]],verb(H),Rem):-
verb(H).
vp([H|Rest],vp(verb(H),RestParsed),Rem):-
verb(H),
pp(Rest,RestParsed).
vp([H|Rest],vp(verb(H),RestParsed),Rem):-
verb(H),
np(Rest,RestParsed).
det(the).
noun(cat).
noun(mat).
verb(sat).
prep(on).
adj(big).
adj(fat).
adj(comfy).
i have read through some of the other posts on this but im still not sure where i have gone wrong.
to check that np pp and vp work i am using the calls; np([the,cat,sat,on,the,mat],O,L). , pp([on,the,mat],P,L). and vp([the,cat,sat,on,the,mat],O,L).. one call the error ERROR: Undefined procedure: vp/3 (DWIM could not correct goal) appears, it is the same error for all 3 calls with the only difference being vp/3 is either np/3 or pp/3
the desired goal is to use the call sentence(some_sentence) and have the program output the results of np pp and vp.

Prolog read_file_to_string/3

When I call the function read_file_to_string/3 in prolog, why am I getting this error:
ERROR: toplevel: Undefined procedure: read_file_to_string/3(DWIM could not correct goal).
I have tried calling it from a file that successfully compiles, but I get the same error.
Thank you.

Linux compile error: undefined reference to `kvm_arch_vcpu_runnable'

I want to call function kvm_arch_vcpu_runnable() in tick-sched.c, but got the following error:
/usr/src/linux-3.13.9/kernel/time/tick-sched.c:213: undefined reference to `kvm_arch_vcpu_runnable'
how can I fix this?
Just find definition of this function in kernel and use:
EXPORT_SYMBOL_GPL(kvm_arch_vcpu_runnable)
I hope it help.

Resources