From fisch@ptolemy.arc.nasa.gov  Tue Apr 25 19:47:39 2000
Received: from ptolemy.arc.nasa.gov (ptolemy.arc.nasa.gov [128.102.112.134])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id TAA02111
	for <prolog@swi.psy.uva.nl>; Tue, 25 Apr 2000 19:47:34 +0200 (MET DST)
Received: from bowl (bowl.arc.nasa.gov [128.102.113.238])
	by ptolemy.arc.nasa.gov (8.8.8+Sun/8.8.8) with SMTP id KAA01084
	for <prolog@swi.psy.uva.nl>; Tue, 25 Apr 2000 10:47:50 -0700 (PDT)
From: "Bernd Fischer" <fisch@ptolemy.arc.nasa.gov>
To: <prolog@swi.psy.uva.nl>
Subject: operators
Date: Tue, 25 Apr 2000 10:57:40 -0700
Message-ID: <NDBBLGANCLGPPKPLENDJEEMFCDAA.fisch@ptolemy.arc.nasa.gov>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200

Hi,

I try to abuse SWI-prolog as read-eval loop for a small language but can't
wrestle it into using the operators I want. Specifically, I try to declare
operators :/2 and |-/1 as infix and prefix with some suitable arity. The
declarations

:- op(1150, fy, '|-').
:- op(1100, xfx, ':').

go through, but don't work. ':' still refers to the module-operator, so
x:t gives the message 'predicate x:t/0 not defined'; the directive

:- redefine_system_predicate ':'/2.

gives a syntax error. As for |-, it doesn't work either: |- 0 < 1 gives
the warning 'Arithmetic: ``|'' is not a function' (instead of calling my
prover to show me that 0 < 1 holds...)

Any easy ways out or am I stuffed? I don't really want to change my language
syntax, though, and I certainly don't want to use quoted versions in the
read-eval loop...


-- fisch

--
------------------------------------------------------------------------------
Bernd Fischer                             Automated Software Engineering Group
RIACS, NASA Ames Research Center                    fisch@ptolemy.arc.nasa.gov
M/S 269-2                               http://ase.arc.nasa.gov/people/fischer
Moffett Field, CA 94035, USA             +1(650)604-2977  fax 4036  rm 269-239

