Hi, I have an example from Bratko, Exercise 3.13. The problem is to make operators of 'was', 'of', 'the' in such a way as to make:
diana was the secretary of the department.
correct prolog and then to be able to write things like:
?- Who was the secretary of the department. and get: Who = diana etc.
This set of definitions doesn't work in ciao, but works in gprolog: %% file: diana.pl :- op(200, fy, the). :- op(250, xfy, of). :- op(300, yfx, was).
diana was the secretary of the department. %% end diana.pl
betenoir ~/logic> ciao Welcome to the Ciao Prolog Development System!
** WARNING **: your shell initialization scripts have not been properly modified for locating the Ciao on-line documentation. Please refer to the instructions in the file /usr/local/ciao/lib/ciao/NewUser.
Ciao-Prolog 1.8 #2: Sat Feb 8 22:26:15 MST 2003 ?- [diana]. Note: [diana] is obsolete, use ensure_loaded(diana) instead
yes ?- Who was the secretary of the department. {SYNTAX ERROR: (lns 6-6) operator expected after expression Who ** here ** was the secretary of the department . }
no ?- -- end ciao
--gprolog session: betenoir ~/logic> gprolog GNU Prolog 1.2.16 By Daniel Diaz Copyright (C) 1999-2002 Daniel Diaz | ?- [diana]. compiling /home/jd/logic/diana.pl for byte code... /home/jd/logic/diana.pl compiled, 5 lines read - 589 bytes written, 9 ms
yes | ?- Who was the secretary of the department.
Who = diana
yes | ?- -- end gprolog
I saw an email by Daniel Cabeza Gras on Aug-13-02 but I don't think that's relevant. Am I doing something wrong?
(I did :- use_module(library(operators)). also but it made no difference)
Thanks for any info,
Jeff Donner
============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------