BNF in C

4
8/13/2019 BNF in C http://slidepdf.com/reader/full/bnf-in-c 1/4 Backus Naur Form Hoa T. Le November 2, 2013 Contents 1 Introduction 1 2 Research Problem 2 3 Sentence outline 2 1 Introduction Context-free grammars are of fundamental importance for programming languages. However, in the specification of programming languages usually a form different to the one provided in our Definition of context-free grammars is used. This form is the so-called Backus normal form or Backus-Naur form. BNF is an acronym for ”Backus Naur Form”. John Backus and Peter Naur introduced for the first time a formal notation to describe the syntax of a given language (This was for the description of the ALGOL 60 programming language, see [Naur 60]). To be precise, most of BNF was introduced by Backus in a report presented at an earlier UNESCO conference on ALGOL 58. Few read the report, but when Peter Naur read it he was surprised at some of the differences he found between his and Backus’s interpretation of ALGOL 58. He decided that for the successor to ALGOL, all participants of the first design had come to recognize some weaknesses, should be given in a similar form so that all participants should be aware of what they were agreeing to. He made a few modificiations that are almost universally used and drew up on his own the 1

Transcript of BNF in C

Page 1: BNF in C

8/13/2019 BNF in C

http://slidepdf.com/reader/full/bnf-in-c 1/4

Backus Naur Form

Hoa T. Le

November 2, 2013

Contents

1 Introduction 1

2 Research Problem 2

3 Sentence outline 2

1 Introduction

Context-free grammars are of fundamental importance for programminglanguages. However, in the specification of programming languages usually

a form different to the one provided in our Definition of context-freegrammars is used. This form is the so-called Backus normal form or

Backus-Naur form. BNF is an acronym for ”Backus Naur Form”. JohnBackus and Peter Naur introduced for the first time a formal notation to

describe the syntax of a given language (This was for the description of theALGOL 60 programming language, see [Naur 60]). To be precise, most of 

BNF was introduced by Backus in a report presented at an earlierUNESCO conference on ALGOL 58. Few read the report, but when PeterNaur read it he was surprised at some of the differences he found between

his and Backus’s interpretation of ALGOL 58. He decided that for thesuccessor to ALGOL, all participants of the first design had come to

recognize some weaknesses, should be given in a similar form so that allparticipants should be aware of what they were agreeing to. He made a few

modificiations that are almost universally used and drew up on his own the

1

Page 2: BNF in C

8/13/2019 BNF in C

http://slidepdf.com/reader/full/bnf-in-c 2/4

BNF for ALGOL 60 at the meeting where it was designed. Depending onhow you attribute presenting it to the world, it was either by Backus in 59or Naur in 60. (For more details on this period of programming languages

history, see the introduction to Backus’s Turing award article inCommunications of the ACM, Vol. 21, No. 8, august 1978. This note was

suggested by William B. Clodius from Los Alamos Natl. Lab).

2 Research Problem

1. How do you design an AI engine that will improve over time to give amore engaging game?

2. How do you implement the AI engine on a mobile phone?

3. What type of game based on consumer profile has the widest age range?

4. How does one write a fitness function to constitute a good play fromthe AI?

3 Sentence outline

1. The growth of the mobile gaming market offers considerable potentialfor the deployment of engaging and compelling games constructed usingAI components and techniques.

(a) The digital media consultancy, Machines That Go Ping [?] sug-

gest that the growth in mobile gaming is largely due to improvedhardware, particularly screen displays.

(b) In a survey reported in [?] 20% of respondents stated that thegames available on a platform affected their mobile phone selec-tion.

(c) ”Gaming is the fourth most popular activity” people use theirphones for, behind voice calls, texting and taking photographs.”That beats music, video, TVonly 5.8% of all UK adults have pur-chased a mobile game for their phone, but 19% of 16-24 year oldshave purchased games for their handset. [?]

2

Page 3: BNF in C

8/13/2019 BNF in C

http://slidepdf.com/reader/full/bnf-in-c 3/4

(d) mobile gamers are more likely to replace their handset twice a yearor more, spend 25% more on hardware and are willing to pay 75%more for mobile games. The report also found that mobile gamersare ”significantly more likely than other gamers to use their cellphones for non-gaming tasks such as downloading content and

Internet access”.[?]

(e) 78% of mobile game players are under 25, as note on-line gamingis no longer the preserve of adolescent boys, but appeals to bothgenders and increasingly to a wider age range. The emergingconsumer profile of the mobile gamer is of a young adult, havinga few minutes spare and wanting to play something simple, butengaging.[?]

2. The GENETIC ALGORITHM is a model of machine learning whichderives its behavior from a metaphor of some of the mechanisms of 

EVOLUTION in nature.(a) Genetic algorithms are intrinsically parallel. Most other algo-

rithms are serial and can only explore the solution space to aproblem in one direction at a time, and if the solution they dis-cover turns out to be suboptimal, there is nothing to do but aban-don all work previously completed and start over. However, sinceGAs have multiple offspring, they can explore the solution space inmultiple directions at once. If one path turns out to be a dead end,they can easily eliminate it and continue work on more promis-ing avenues, giving them a greater chance each run of finding the

optimal solution.[?](b) One of the most novel and compelling demonstrations of the power

of genetic algorithms was presented by Chellapilla and Fogel 2001,who used a GA to evolve neural networks that could play the gameof checkers. [?]

3. Java 2 Micro Edition (J2ME) is a form of the Java language that isoptimized for small devices such as mobile phones and PDAs.

(a) J2ME is limited by comparison to desktop Java, but it vastlyimproves the ability of mobile phones to support games. It allows

far better control over interface than either SMS or WAP, allows

3

Page 4: BNF in C

8/13/2019 BNF in C

http://slidepdf.com/reader/full/bnf-in-c 4/4

sprite animation, and can connect over the air network to a remoteserver.[?]

(b) Because of its capabilities and the widespread and growing de-ployment of Java-enabled phones, it is a natural for mobile game

development today[?

]

4