From: Paul.Broome <Paul.Broome@MDLogix.com> - 2004-08-28 07:13:33
|
That sounds reasonable to me. I guess that would avoid future surprises for others, but for me I've found a simple work-around. Looks like I can just translate the ';' back into '|'. Terrance Swift wrote: >So it sounds like a reasonable course would be to maintain | as an >operator, but not to translate it into ;. I'll give it a try next time >I'm system hacking (probably tomorrow, Monday at the latest). > >On Fri, 27 Aug 2004, Bart Demoen wrote: > > > >>>| ?- (a|b)=(a;b). >>> >>>yes >>>| ?- >>> >>> >>> >>>My cvs is about 2 weeks old but apparently this has been true since version 2.5. >>>How can I make it fail? Thanks for your help. >>> >>> >>The culprit is probably in xsb_read.P in syslib. >>There are two places (as far as I can track quickly): >> >>read_exprtl01(punc(CH_BAR), Term, Precedence, Answer, S,S1) :- % '|' >> Precedence >= 1100, >> !, >> read4(S1, 1100, Next, S2), >> !, >> read_exprtl(S2, 1100, (Term;Next), Precedence, Answer, S). >> ^ >> | >> >>and >> >> >>read_exprtl1(punc(CH_BAR), C, Term, Precedence, Answer, S, S1) :- % '|' >> Precedence >= 1100, >> C < 1100, >> !, >> read4(S1, 1100, Next, S2), /*!,*/ >> read_exprtl(S2, 1100, (Term;Next), Precedence, Answer, S). >> ^ >> | >> >>You could try to change those pointed at ; into | >>but I am not sure whether bootstrapping that will work :-) >> >>Good luck to you, >> >>Bart >> >> >> >>A bonus :-) >> >>In SWI Prolog >> >>?- (a|b)=(a;b). >> >>fails. (| is an operator and not translated to ;) >> >> >> >>In SICStus it succeeds, even in ISO mode. (| is translated to ;) >> >> >> >>In gnuprolog (supposedly ISO) the query itself contains a syntax error >>(because | is not an operator ...) >> >> >> >>The online Executable Spec of ISO Prolog says: >> >>Program: >>p :- (a|b)=(a;b). >>Syntax error reading user program >> >>and that seems to make gnuprolog right - | does indeed not figure in the >>initial operators in ISO Prolog. >> >>See: http://www.sju.edu/~jhodgson/prolog_proj/bips.html#operators >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by BEA Weblogic Workshop >>FREE Java Enterprise J2EE developer tools! >>Get your free copy of BEA WebLogic Workshop 8.1 today. >>http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click >>_______________________________________________ >>Xsb-development mailing list >>Xsb...@li... >>https://lists.sourceforge.net/lists/listinfo/xsb-development >> >> >> > > >------------------------------------------------------- >This SF.Net email is sponsored by BEA Weblogic Workshop >FREE Java Enterprise J2EE developer tools! >Get your free copy of BEA WebLogic Workshop 8.1 today. >http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click >_______________________________________________ >Xsb-development mailing list >Xsb...@li... >https://lists.sourceforge.net/lists/listinfo/xsb-development > > > |