Prolog natural language parser, Arguments are not sufficiently instantiated - prolog

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.

Related

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

Julia GraphDisplay error

I am running an example and I receive this error.
ERROR: LoadError: error compiling anonymous: unsupported or misplaced expression "using" in function anonymous
while loading /home/xxx/Desktop/xxx/TD1/exemple.jl, in expression starting on line 25
These are lines 25 and 26 in the example,
if GraphDisplay
using Plots
I also get a warning
WARNING: could not import Base.issymmetric into LinearOperators
which goes away when I run Pkg.add("LinearOperators") but I have to do this everytime I quit and reopen Julia.

Convert a static library ".a" into Binding Library

I tried to use sharpies to convert a library .a into Binding Library but I have some error. The command that I have executed is:
sharpie bind -v -output=[...] --namespace=[...] --sdk=iphoneos11.0 lib.a
and the errors returned are:
Error: unable to handle compilation, expected exactly one compiler job
in '' Error while processing
/Users/federicopieri/Desktop/GPDL/libMSSUniversal.a.
Done. Exiting with error code 1. error: Clang failed to parse input
and exited with code 1
Any help would be appreciated

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.

how do i solve dompdf error?

I am using dopdf for my reports and on one of the reports it gives me this error:
Fatal error: Call to undefined method
Inline_Frame_Decorator::normalise() in
C:\xampp\htdocs\sraerca\system\helpers\dompdf\include\table_frame_decorator.cls.php
on line 252
But works fine with other reports.

Resources