What does this operator expected error mean? 
Author Message
 What does this operator expected error mean?

I found the following file for the send more money problem
on the net. I tried to run it, but I received the following error:
================= the error ===================
[debug]  ?- consult(smo).
ERROR: c:/s_prolog/smo.pl:3: Syntax error: Operator expected
% smo compiled 0.00 sec, 0 bytes
================ the file ======================
:-  import(const_domain).

send([[S,E,N,D],  [M,O,R,E],  [M,O,N,E,Y]])  :-
              (Digits  =  [S,E,N,D,M,O,R,Y],
              Carries  =  [C1,C2,C3,C4],
              Digits  in  0..9,
              Carries  in  0..1,

              M                ?=              C4,
              O  +  10  *  C4  ?=  M  +  S  +  C3,
              N  +  10  *  C3  ?=  O  +  E  +  C2,
              E  +  10  *  C2  ?=  R  +  N  +  C1,
              Y  +  10  *  C1  ?=  E  +  D,

              M  ?>=  1,
              S  ?>=  1,
              all_distinct(Digits),
              label(Digits)).
%
%[user]  ?-  send(X).
%X            =  [[9,5,6,7],[1,0,8,5],[1,0,6,5,2]]
%yes



Sat, 08 May 2004 12:41:15 GMT  
 What does this operator expected error mean?

Quote:

> I found the following file for the send more money problem
> on the net. I tried to run it, but I received the following error:
> ================= the error ===================
> [debug]  ?- consult(smo).
> ERROR: c:/s_prolog/smo.pl:3: Syntax error: Operator expected
> % smo compiled 0.00 sec, 0 bytes

General advice: tell us which Prolog system you use when you ask such questions !

Bart Demoen



Sat, 08 May 2004 16:36:00 GMT  
 What does this operator expected error mean?

Quote:

>I found the following file for the send more money problem
>on the net. I tried to run it, but I received the following error:
>================= the error ===================
>[debug]  ?- consult(smo).
>ERROR: c:/s_prolog/smo.pl:3: Syntax error: Operator expected
>% smo compiled 0.00 sec, 0 bytes
>================ the file ======================
>:-  import(const_domain).

>send([[S,E,N,D],  [M,O,R,E],  [M,O,N,E,Y]])  :-
>              (Digits  =  [S,E,N,D,M,O,R,Y],
>              Carries  =  [C1,C2,C3,C4],
>              Digits  in  0..9,

This line is not standard Prolog syntax.
A standard Prolog implementation might well
report an error message such as the one above,
complaining that an operator was expected
between "Digits" and "in" (and between "in" and "0",
and between "0" and "..", and between ".." and "9").

Such an error message is hinting at the fact that
a subgoal such as

                Digits = in + 0 + .. + 9,

would be valid syntax.  But since that syntax would
hardly have any useful meaning, the error message is
not very helpful.

In other words, all this Prolog implementation is
saying is that somewhere in the clause beginning
at line 3, there is a syntax error, and it has no
clue as to what you meant.

--

The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.



Sat, 08 May 2004 17:51:23 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Please take a look at this expect script doing in loop with error checking

2. what is meaning of the \+ operator

3. Expect: error with puts after expect

4. Doing background while during an interact in expect ???

5. operator expected problem

6. EXPECT EXCEPTION ERROR - slavedrv.exe Application error

7. What does this ERROR mean?

8. Error message..what does it mean

9. What does this error mean (Eiffel3)

10. what does Error 1605 mean during LabView 6.1 installation

11. Fatal C3049 error - what does it mean

12. What does internal error 1010 mean?

 

 
Powered by phpBB® Forum Software