For Programmers: Free Programming Magazines  


Home > Archive > Prolog > April 2004 > HELP! Prefix operator precedence error message









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HELP! Prefix operator precedence error message
FirewallVictim

2004-04-27, 2:08 pm

Could someone please help/advise with a small prolog problem i'm
having. Im fairly new to prolog and im only a beginner programmer. I
developed a small prolog program based on eliza in SWI-prolog for
windows but when i try and migrate it to UNIX im getting an error
message. Any advice would be much appreciated.

Code runs in windows but not in unix.

append([],L2,L2).
append([H|L1],L2,[H|L3]):-
append(L1,L2,L3).

% Redefine append as ...
:- op(900,fy,'...').
....(X,Y,Z) :- append(X,Z,Y).

response(Response List) -->
..._, [keyword], ..._.


Error Message: Prefix operator precedence too high (HERE being where
error occurs)

response(Response List) --> <<HERE>>
..._, [keyword], ..._.

I get the feeling unix or prolog doesnt like the use of ... or the way
the rule is defined. Any pointers?

Thanks in advance
Jan Wielemaker

2004-04-27, 2:08 pm

In article <ba2190a1.0404270850.3a8e08d8@posting.google.com>,
FirewallVictim wrote:
> Could someone please help/advise with a small prolog problem i'm
> having. Im fairly new to prolog and im only a beginner programmer. I
> developed a small prolog program based on eliza in SWI-prolog for
> windows but when i try and migrate it to UNIX im getting an error
> message. Any advice would be much appreciated.
>
> Code runs in windows but not in unix.
>
> append([],L2,L2).
> append([H|L1],L2,[H|L3]):-
> append(L1,L2,L3).
>
> % Redefine append as ...
>:- op(900,fy,'...').
> ...(X,Y,Z) :- append(X,Z,Y).
>
> response(Response List) -->
> ..._, [keyword], ..._.
>
>
> Error Message: Prefix operator precedence too high (HERE being where
> error occurs)
>
> response(Response List) --> <<HERE>>
> ..._, [keyword], ..._.
>
> I get the feeling unix or prolog doesnt like the use of ... or the way
> the rule is defined. Any pointers?


I don't think Unix can be involved in any way. Neither is SWI-Prolog,
unless it is a modified version. First of all the Windows and Unix
versions are fully compatible, certainly as far as the parser is
concerned. Second, it doesn't know the error message "operator
precedence too high", so it can't be SWI-Prolog :-)

--- Jan
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com