[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jul 11 14:46:41 2000 
Subject:Re: defining "|" as or in Poplog Prolog 
From:Alan Newman 
Volume-ID:1000711.02 

Aaron Sloman See text for reply address wrote:
> 
> Some versions of prolog allow "|" as an alterantive to ";" for
> disjunction. In Poplog prolog, code written like that causes
> compile time (syntax) error.
> 
> Does anyone have a modification for poplog prolog that accepts
> "|" in that context.
> 
> I could try to understand the compiler and change it, but if someone
> has already done this I'll be grateful for the code.


I'm not familiar with Poplog's implementation of Prolog, but in a
typical Prolog system, the following two lines should work.  The
first sets the operator status of the | symbol, and the second
defines the operator to behave the same as the ; operator.  The 1100
precedence value may need to be changed if Poplog uses a diferent
precendent for the ; operator as you want them both the same.

    :- op( 1100, xfy, | ) .

    X | Y :- X ; Y .

-- Alan Newman