Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: George Neuner Newsgroups: comp.compilers Subject: Re: specifying semantics, was Formatting of Language LRMs Date: Thu, 26 Jun 2014 00:54:33 -0400 Organization: A noiseless patient Spider Lines: 56 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-06-025@comp.compilers> References: <14-06-010@comp.compilers> <14-06-023@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: miucha.iecc.com 1403910519 69958 2001:470:1f07:1126:0:676f:7373:6970 (27 Jun 2014 23:08:39 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 27 Jun 2014 23:08:39 +0000 (UTC) Keywords: semantics Posted-Date: 27 Jun 2014 19:08:38 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1280 On Tue, 24 Jun 2014 02:19:05 -0700 (PDT), seimarao@gmail.com wrote: >Is there something for semantics as BNF is for grammars ? First, there is no canon BNF. What we refer to as "Backus-Naur Form" today is not the original used for Algol-58, but is BNF plus a handful of widely accepted practical extensions - alternation set notation, closure notation, etc. - which together is known as EBNF ('E' for "extended") or sometimes "core" EBNF. Core EBNF is easily (but not trivially) portable: every popular grammar tool understands it in concept, but not every tool uses exactly the same rule syntax. In addition, nearly every tool extends core EBNF to enable its own unique features. Grammars taking advantage of any feature not in core EBNF generally will not be portable (not trivially and possibly not even easily) to a different tool. To answer your question: No ... there really is nothing for semantics that approaches the ubiquity of EBNF for grammars. The closest thing in practice is the lambda calculus, but there are multiple forms of the calculus and you'll find that every author extends their chosen form in some slightly different way. Moreover, there are 3 broad categories of semantic description: operational, denotational and axiomatic. Lambda calculus really is suitable only for expressing operational and/or denotational forms. Axiomatic descriptions generally take the form of a propositional algebra. Historically, *most* languages have been described by operational semantics alone, and the majority did not use any formal calculus to do so. The most common form of description is, in fact, text - in conjunction with a "reference" implementation: a compiler or interpreter against which new implementations can be compared. Scheme, ML and Haskell are described by denotational semantics. There undoubtedly have been others but these are the ones I know offhand. I'm not aware any languages that are described solely by axiomatic semantics [possibly some of the declarative logic or theorem prover languages, but I'm not very familiar with any of these]. AFAIHS, axiomatic descriptions tend to be more for the developer of a compiler than for the user of it. When the language gets documented, it tends to be using an operational or denotational description. >What do the books on type systems, lambda calculus, etc, teach and >where are their topics applied ? Read some and find out. George