Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!munnari.oz.au!lee From: lee@munnari.oz.au (Lee Naish) Newsgroups: comp.lang.prolog Subject: Re: canonical syntax Message-ID: <2899@munnari.oz.au> Date: 9 Dec 89 04:21:43 GMT References: Sender: news@cs.mu.oz.au Reply-To: lee@munmurra.UUCP (Lee Naish) Distribution: comp Organization: Comp Sci, University of Melbourne Lines: 26 In article matsc@sics.se (Mats Carlsson) writes: > prefix operators >with precedence > 999 must be parenthesized *in the canonical syntax* >when they occur in compound terms, as in > > p((public)). In the NU-Prolog parser parentheses are not needed in this context, which is certainly an advantage for canonical IO. Unfortunately, some input which "standard" parsers can handle is not accepted by NU-Prolog. The main reason for the nonstandard parser is so we can have prefix binary operators (for quantifiers). >The canonical syntax would become independent of op declarations if >the two (**) rules and the constraint on @var{atom} not being a prefix >operator were deleted. Would this measure make it more difficult to >parse or cause any other bad effects? Not being an expert in parsing (or Prolog syntax) I don't know what bad effects there might be (possible ambiguity?). However, the grammar modifications suggested by Mats don't correspond to what NU-Prolog is able to parse. "not ?- ." causes an error, for example, even though it is unambiguous. By adopting Mats' scheme more unambiguous, currently unparsable terms could be parsed. lee