Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!icdoc!sappho!cdsm From: cdsm@sappho.doc.ic.ac.uk (Chris Moss) Newsgroups: comp.lang.prolog Subject: Re: Prefix operators and blanks (was: WG17) Message-ID: <1412@gould.doc.ic.ac.uk> Date: 13 Dec 89 13:10:10 GMT References: <24703@cup.portal.com> Sender: news@doc.ic.ac.uk Reply-To: cdsm@doc.ic.ac.uk (Chris Moss) Organization: Logic Group, Dept. of Computing, Imperial College, London, UK. Lines: 45 In article <24703@cup.portal.com> pgl@cup.portal.com (Peter G Ludemann) writes: >If one decides to define 'not' as a prefix operator and also >chooses to use it with as a functor (e.g. `not(a,b)'), one is >asking for trouble and should instead disambiguate by extra >quote marks or parentheses: 'not'(a,b) or not((a,b)). > >I therefore suggest that the Prolog standard specifically >disallow using a prefix operator as a functor. The use of >quotes and extra parentheses allows clear disambiguation. This >will break a few programs, but in an acceptable way (i.e., they >will produce easily fixed syntax errors, rather than be >accepted silently in an unexpected way). The history of this within BSI is as follows: In PS/154 (a BSI document) I put forward two possible syntaxes. One (close to) the normal Edinburgh syntax, the other close to Peter's suggestion, where quotes are used to distinguish prefix operators. Inasfar as it received sensible discussion it was vetoed on the grounds that have been expressed by Lee Naish and Mats Carlsson. In particular having a normal form for terms is nice, and you don't want always to quote things. But the biggest argument is that many people (but NOT all) have got used to doing it the Edinburgh way. _I_ think it's rather ugly, but I don't see that cleaning things up for its own sake is part of the standardisation process if what's there already works. So in N9 (PS/239) I scrapped that and try to do it Edinburgh way and also supply a set of rules that would dismbiguate any ambiguous expressions arising out of using different operator declations at the same level. The attempt didn't work and that was the last contribution I made before resigning from the BSI/ISO committee in despair. Several people, including Tony Dodd and Hamish Taylor have made proposals to cope with this. The set of rules in N40 is as far as I can see a variant on N9 that doesn't do much better. The normal suggestion from Edinburgh is "take a parser and standardize that", the normal candidate being Richard O'Keefe's read predicate in the Edinburgh library. However when it comes to ambiguous expressions, and which one is taken, then different "Edinburgh" Prologs do vary. I'll dig up my examples if anyone wants them. And as a methodolgy for standardization it is about as undeclarative as you can get. Enough history! Chris Moss.