Subject: operators

From: "Bernd Fischer" <[email-masked]>
Date: Tue, 25 Apr 2000 10:57:40 -0700

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                    [email-masked]
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