`US 20030046061Al
`
`(19) United States
`(12) Patent Application Publication
`Preston et al.
`
`(10) Pub. No.: US 2003/0046061 Al
`Mar. 6, 2003
`(43) Pub. Date:
`
`(54) APPARATUS FOR AUTOMATICALLY
`GENERATING SOURCE CODE
`
`(76)
`
`Inventors: Keith R Preston, Woodbridge (GB);
`Caroline A Leathern, Ipswich (GB)
`
`Correspondence Address:
`Nixon & Vanderhye
`8th Floor
`1100 North Glebe Road
`Arlington, VA 22201-4714 (US)
`
`(21)
`
`Appl. No.:
`
`10/169,352
`
`(22)
`
`PCT Filed:
`
`Jan.30,2001
`
`(86)
`
`PCT No.:
`
`PCT/GBOl/00375
`
`(30)
`
`Foreign Application Priority Data
`
`Jan. 31, 2000
`
`(EP) ........................................ 00300742.4
`
`Publication Classification
`
`Int. Cl.7 ..................................................... G06F 17/27
`(51)
`(52) U.S. Cl.
`.................................................................. 704/9
`
`ABSTRACT
`(57)
`A method of automatically generating software from one or
`more predefined functions in accordance with an input
`statement entered in natural language, the method compris(cid:173)
`ing the steps of:
`(i) analysing the input statement for its semantic con(cid:173)
`tent, so as to extract first semantically meaningful
`elements from the input statement;
`(ii) analysing the one or more predefined functions for
`their semantic content, so as to extract one or more
`sets of second semantically meaningful elements
`from the one or more predefined functions;
`(iii) identifying at least one of a condition, an action
`and/or a statement in the input statement;
`(iv) comparing the first semantically meaningful ele(cid:173)
`ments with the second semantically meaningful ele(cid:173)
`ments so as to identify one or more predefined
`functions that correspond to one or more action
`and/or statement of the input statement;
`(v) combining at least some of the first semantic
`elements in accordance with any conditions identi(cid:173)
`fied at step (iii) so as to generate corresponding
`condition variables;
`(vi) combining functions and condition variables iden(cid:173)
`tified at steps (iv) and (v) according to a set of
`predetermined rules in order to generate the soft(cid:173)
`ware.
`
`S4.1
`
`Extract utility description
`and input parameter from
`functional description
`
`S4.2
`
`S4.3
`
`Analyse utility
`description for
`semantic
`content
`
`Analyse input
`parameter for
`semantic
`content
`
`Page 1 of 25
`
`
`
`Patent Application Publication Mar. 6, 2003 Sheet 1 of 13
`
`US 2003/0046061 Al
`
`c.o
`0 ...-
`____.
`
`0
`0
`
`(\
`
`\
`
`(1)
`'-
`0
`+-'
`(/)
`
`I
`LO
`0
`.,..--
`I
`
`I
`
`(/)
`<( (/)
`I- >-
`<( _J
`0 <( z
`
`<(
`
`N
`0
`
`CJ)
`
`c ·-
`
`(1) +-'
`"O
`C'O
`0
`'-
`u ~
`(1)
`<..'.J
`
`U'J
`c
`C'O
`(1)
`
`E I\
`
`(Y')
`0
`
`Page 2 of 25
`
`
`
`Patent Application Publication Mar. 6, 2003 Sheet 2 of 13
`
`US 2003/0046061 Al
`
`+-'
`Q)
`c
`'--
`Q)
`
`+-' c
`
`I
`LO
`
`0 ...(cid:173)
`'
`
`N
`...-
`...-
`
`IJ.)
`0....
`'-
`CJ) 0
`+-'
`(J)
`
`(.0
`0 --+----r--;
`
`.._
`Q)
`0
`+-'
`(/)
`
`0
`0
`
`(J)
`<{ (J)
`I- >(cid:173)
`<X: __J
`0 <{ z
`<X:
`
`N
`0
`
`N
`...-
`...-
`
`..a
`
`"(""""""
`
`Ol
`
`·-u..
`
`..-
`0 ....-
`
`Q)
`0....
`'-
`CJ) 0
`-
`ci5
`
`0 ...-
`...-
`
`co
`0
`
`---
`+-'
`c
`'-
`IJ.)
`Q)
`CJ)
`::> u
`
`M
`0
`
`Page 3 of 25
`
`
`
`Patent Application Publication Mar. 6, 2003 Sheet 3 of 13
`
`US 2003/0046061 Al
`
`N
`
`...0
`LO
`0
`N
`
`~
`Q)
`c
`~
`Q)
`~ c
`
`N
`O')
`LL
`
`0 ......
`......
`
`co
`LO
`0
`
`N,......,....-'t\-~~~~~---....
`
`(Y)
`0
`N
`
`c.o
`0
`
`0
`0
`N
`
`r-
`0
`N
`
`Page 4 of 25
`
`
`
`Patent Application Publication Mar. 6, 2003 Sheet 4 of 13
`
`US 2003/0046061 Al
`
`(Y)
`0
`
`~
`
`.....
`0
`+-' co
`.....
`Q.)
`c
`Q.)
`<..9
`
`Q.)
`-0
`0 u
`
`~
`
`0
`
`~
`
`co
`(V)
`en
`LL
`
`+-' c
`©
`u
`
`CJ)
`(/)
`c
`ro c
`o. ro
`E m
`o E -----1
`u
`
`> .....
`Q.)
`::J
`d
`
`.....
`Q.)
`(/)
`
`>-
`co
`c
`<(
`
`LO
`0
`(Y)
`
`Q.)
`(/)
`ro
`a.>
`-0 ..0 1 - - - - - - - '
`co
`0
`u -ro
`0
`
`0
`0
`N
`
`..--
`0
`("")
`
`()
`
`.....
`+-' Q.)
`(/)
`·~ 0
`CJ) +-'
`c CJ)
`_J
`
`(Y)
`0
`("")
`
`Page 5 of 25
`
`
`
`'"""'
`'"""' >
`~ c
`.i;;..
`~ c c
`N c c
`'Jl
`d
`
`~
`
`'"""' ~
`0 .....,
`Ul
`~ .....
`'Jl =-~
`
`~
`
`N c c
`
`~~
`~ :i
`~
`
`Fig 3b
`
`.... 0 =
`~ "Cl -....
`~ = .....
`~ .....
`""C
`
`~ .....
`
`I")
`
`~ .....
`O' =:
`~
`
`.... 0 =
`
`I")
`
`public void forwardCall (String phone_number){
`
`FUNCTION DEFINITION:
`
`... }
`
`-----
`
`310
`
`315
`
`317
`
`Nominated person (X)
`Input parameter:
`
`forwards incoming calls
`Utility description: phone
`
`31 3
`
`I
`
`to a nominated person
`forward an incoming call
`Causes a phone to
`Function description:
`
`*/
`you want to forward your calls to
`* This function requires the extension number that
`nominated person.
`* Causes a phone to forward an incoming call to a
`/**
`COMMENT:
`
`311
`
`Page 6 of 25
`
`
`
`~ c c
`N c
`'Jl
`d
`
`"'""
`"'"" >
`~ c
`.i;;..
`
`~
`
`"'"" ~
`0 ......,
`~
`~ ......
`'Jl =(cid:173)~
`8
`N c
`~~
`~ :"i
`~
`
`.... 0 =
`O' -....
`~
`.... 0 =
`~ "Cl -....
`~ = ......
`~ ......
`""C
`
`~ ......
`
`I")
`
`~ ......
`
`I")
`
`Fig 5
`
`Fig 4
`
`0.4
`
`content of the input statement
`that correspond to the semantic
`otherwise of predefined functions
`Identify the presence or
`
`~,
`
`S5.3
`
`().
`
`I\
`
`of the input statement
`Extract the semantic content
`
`S5.2
`
`\
`
`S5.1
`
`H
`
`statement
`structure of the input
`patterns and logical
`Extract the semantic
`
`statement
`Categorise the input
`
`content
`semantic
`parameter for
`Analyse input
`
`content
`semantic
`description for
`Analyse utility
`
`S4.3
`
`S4.2
`
`functional description
`and input parameter from
`Extract utility description
`
`S4.1
`
`Page 7 of 25
`
`
`
`Patent Application Publication Mar. 6, 2003 Sheet 7 of 13
`
`US 2003/0046061 Al
`
`LO
`0
`(0
`
`Page 8 of 25
`
`
`
`Patent Application Publication
`
`Mar. 6, 2003 Sheet 8 of 13
`
`US 2003/0046061 Al
`
`....-(cid:173)
`....--
`(!)
`
`0
`....--
`(!)
`
`en
`0
`(!)
`
`LD
`
`....--
`(!)
`
`..0 co
`
`O'l
`LL
`
`Page 9 of 25
`
`
`
`Patent Application Publication Mar. 6, 2003 Sheet 9 of 13
`
`US 2003/0046061 Al
`
`LO
`0
`r--.
`
`er:
`w
`I-
`::)
`0...
`~
`0
`u
`
`::)
`
`0 >
`
`0 er:
`<(
`0
`en
`>-w
`
`~
`
`Cf) -_J
`
`u -
`~
`
`~
`w
`0
`0
`::?!
`
`r....
`01
`LL
`
`Q)
`0
`I"-
`
`0
`0
`I"'-
`
`'!""""
`0
`'!""""
`
`Page 10 of 25
`
`
`
`'"""'
`'"""' >
`~ c
`.i;;..
`c c
`@
`N c
`'Jl
`d
`
`~
`
`'"""' ~
`0 .....,
`'"""' c
`~ .....
`'Jl =(cid:173)~
`8
`N c
`~~
`~ :"i
`~
`
`.... 0 =
`O' -....
`~
`.... 0 =
`~ "Cl -....
`~ = .....
`~ .....
`""C
`
`~ .....
`
`I")
`
`~ .....
`
`I")
`
`803b
`
`database
`
`rules
`
`expand
`Lang2
`
`database
`
`rules
`
`-
`
`801b
`
`grammar
`
`Lang2
`
`~
`
`rules
`
`expand
`Lang1
`
`database
`
`rules
`
`grammar
`
`Lang1
`
`803a
`
`801a
`
`805b
`
`lexicon
`Lang2
`
`lexicon
`Lang1
`
`805a
`
`Lexical Database
`
`Fig 8
`
`804
`
`Page 11 of 25
`
`
`
`Patent Application Publication Mar. 6, 2003 Sheet 11 of 13 US 2003/0046061 Al
`
`LO
`
`0 ..-
`
`co
`0
`....-
`
`..--
`0 ....-
`
`0:: w
`> 0:: w
`
`(/)
`
`z
`I-
`(f)
`c_
`
`0
`0
`I'--
`
`a:
`w
`I-
`:J
`Q_
`2
`0 u
`
`I-z w
`_J u
`
`(j)
`
`CJ)
`LL
`
`2
`w
`0
`0
`2
`
`0
`(()
`>-w
`
`~
`
`:J
`0
`>
`
`(j)
`0
`I'--
`
`LO
`0
`I'--
`
`..--
`0
`I'--
`
`Page 12 of 25
`
`
`
`Patent Application Publication Mar. 6, 2003 Sheet 12 of 13 US 2003/0046061 Al
`
`0
`
`0
`
`~
`
`-
`
`0
`
`en
`·-LL
`
`a:
`w
`s
`Cf)
`0
`a:
`co
`
`I-w
`_J
`0..
`0..
`_J <(
`w
`-
`I- _J
`I
`LL
`
`~ -
`
`-
`
`Cf)
`0
`
`~
`
`I
`
`Page 13 of 25
`
`
`
`Patent Application Publication Mar. 6, 2003 Sheet 13 of 13 US 2003/0046061 Al
`
`~
`0 ..--
`..--
`
`N
`0
`
`c.o
`0
`..-(cid:173)
`.--
`
`L!)
`
`0 ..--
`
`::>
`0.... u
`
`(/)
`~ f(cid:173)
`~ a:
`oo
`Uo....
`
`<(
`f(cid:173)
`<(
`0
`
`UJ
`0::
`0
`f(cid:173)
`C/)
`
`°'·
`
`LL
`
`N
`
`~
`
`0)
`LL
`
`_J
`d
`(/)
`'
`CJ.)
`
`CJ.)
`
`,_
`0
`• • +-'
`cti
`(.)
`· - ,_
`
`(.)
`
`u._
`g~
`©~
`(.) >
`CJ.) 0
`cti
`_J
`2,_>
`,_ >
`o.__ _ _. o ._
`> L - - - - - ' ~
`0)
`CJ.)~..-
`,,CJ.)
`CJ.)'
`c
`cti
`CJ.) <J)
`+-' +-'
`·u; $
`a3
`~
`c
`..0
`.......
`:J +-'
`co -
`cti
`o
`CJ.)
`en
`+-'
`cti
`<J)
`::)
`0
`
`0
`N
`
`M
`0
`N
`
`LO
`0
`N
`
`Page 14 of 25
`
`
`
`US 2003/0046061 Al
`
`Mar. 6, 2003
`
`1
`
`APPARATUS FOR AUTOMATICALLY
`GENERATING SOURCE CODE
`
`[0001] The present invention relates to apparatus for auto(cid:173)
`matically generating source code, and is particularly, but not
`exclusively, suitable for generating source code for commu(cid:173)
`nication services.
`
`[0002] Traditionally, software development has comprised
`several identifiable processes: requirements capture, where
`customer requirements are broken down into fundamental
`descriptions that can be used to create specifications; design
`of software elements to these specifications; implementation
`of the software elements to create a software deliverable;
`and maintenance of the software deliverable. In many cases,
`the customer requirements further include developing hard(cid:173)
`ware, which will be integrated with the software deliverable.
`All of these processes are time consuming and costly in their
`preparation, and often there are integration and implemen(cid:173)
`tation problems. In order to correct these problems, some
`re-design may be required, which often delays the down(cid:173)
`streaming of the deliverables and adds significantly to the
`costs.
`
`[0003] Several groups have focussed on identifying areas
`in the development process that could be pruned to offer
`time and cost savings, noting in particular that around sixty
`to seventy percent of a system's functionality duplicates that
`of other systems. There is thus significant interest in devel(cid:173)
`oping tools that generate software automatically, as this
`offers reductions in software design stage costs. AT&T have
`disclosed, in "Object Magazine 5, 1995", a tool that can
`generate object-oriented code from graphical models. How(cid:173)
`ever, ideally automatic code generators should be adaptable
`to different platforms, different standards, and different
`languages, and not be restricted to generating object oriented
`code.
`
`[0004] Automating the validation of code could also offer
`significant cost savings, as identified by the British Aero(cid:173)
`space Dependable Computer System Centre in York, in
`"Qualification of automatic code generation using formal
`techniques" 1
`. The paper presents an animation facility to
`validate the code, which embeds formal methods to perform
`the validation itself.
`1for the IEE colloquium on "practical application of formal methods"
`
`[0005] There are several quasi-automatic code generators,
`such as the "wizards" developed by the Microsoft™ Cor(cid:173)
`poration; these create basic class template syntax, leaving
`the programmer to insert the code that is specific to the
`application under development. However, these are lan(cid:173)
`guage specific, are limited to producing code templates, and
`require the user have a working knowledge of the language
`itself. Another quasi-automatic method of code generation
`includes "forms", where a user fills in fields comprising the
`form. However, the entries must adhere to a specific format,
`and the functionality of the code that is generated is
`extremely limited.
`
`[0006] Methods of using graphical methods to generate
`code are also well known. For example, the JBuilder™
`product from Borland incorporates a GUI designer by which
`the software developer can use a visual tool to draw the
`required user interface elements. The system then produces
`appropriate Java source code to handle these elements
`automatically, and allows the developer to merge this with
`
`conventionally-written code. Other systems such as Rational
`Rose TM and Oracle Designer™ allow the developer to
`express the program logic using graphical symbols, and then
`generate code automatically. In all of these cases the user
`must have a knowledge of the graphical notation used,
`which may be Unified Markup Language (UML) or some
`other convention. In addition, the user must have a good
`understanding of the programming language used in order
`that he or she can fill in certain parts of the template code
`produced, and also interface the automatically generated
`code with other parts of the software application. This
`restricts the usefulness of this type of system to experienced
`software programmers.
`
`[0007] There are many situations where it is desirable for
`a non-programmer to be able to program a system so that it
`can subsequently act on his or her behalf without further
`interaction. A telephone answering machine is a simple
`example of such a system; the user implicitly instructs the
`device to answer the telephone call and to record a message
`in his or her absence. Another well-known example is the
`video recorder, which may be set to record a programme
`when the user is out or fast asleep. However, it is well know
`that many people have difficulty even with the relatively
`simple task of programming a video recorder. In addition,
`even experienced programmers make errors, particularly
`when dealing with complex logic, and the process of testing
`that the program behaves as required (debugging) is a well
`established part of the software development process.
`
`[0008] As e-commerce continues to develop, examples of
`systems to which a user delegates some of his or her
`authority, will become more widespread. A recent example
`is that of a proxy, used in on-line auctions. The user can
`instruct his or her proxy to bid up to a certain amount for a
`particular item. Future systems may allow much more
`complex negotiations to be carried out in real time, follow(cid:173)
`ing the instructions laid down previously by the human user.
`If these systems are to be used and trusted, it is essential that
`users without programming experience can program them
`effectively and have confidence that the system will subse(cid:173)
`quently exhibit the appropriate behaviour. Preferably this
`should not require the user to learn a programming language
`or a particular graphical notation.
`
`[0009] According to one aspect of the present invention
`there is provided a method of automatically generating
`software from one or more predefined functions in accor(cid:173)
`dance with an input statement entered in natural language,
`the method comprising the steps of:
`
`[0010]
`(i) analysing the input statement for its seman(cid:173)
`tic content, so as to extract first semantically mean(cid:173)
`ingful elements from the input statement;
`
`[0011]
`(ii) analysing the one or more predefined
`functions for their semantic content, so as to extract
`one or more sets of second semantically meaningful
`elements from the one or more predefined functions;
`
`[0012]
`(iii) identifying at least one of a condition, an
`action and/or a statement in the input statement;
`
`[0013]
`(iv) comparing the first semantically mean(cid:173)
`ingful elements with the second semantically mean(cid:173)
`ingful elements so as to identify one or more pre(cid:173)
`defined functions that correspond to one or more
`action and/or statement of the input statement;
`
`Page 15 of 25
`
`
`
`US 2003/0046061 Al
`
`Mar. 6, 2003
`
`2
`
`[0014]
`(v) combining at least some of the first seman(cid:173)
`tic elements in accordance with any conditions iden(cid:173)
`tified at step (iii) so as to generate corresponding
`condition variables;
`
`[0015]
`(vi) combining functions and condition vari(cid:173)
`ables identified at steps (iv) and (v) according to a set
`of predetermined rules in order to generate the
`software.
`
`[0016] Embodiments of the invention will now be illus(cid:173)
`trated, by way of example only, with reference to the
`accompanying drawings, in which:
`[0017] FIG. la is a schematic diagram showing apparatus
`for automatically generating source code according to an
`embodiment of the present invention;
`[0018] FIG. lb is a schematic diagram showing apparatus
`for automatically generating source code according to a
`further embodiment of the present invention;
`[0019] FIG. 2 is a schematic diagram showing data stor(cid:173)
`age providing part of the apparatus of the embodiments of
`either FIG. la or FIG. lb;
`
`[0020] FIG. 3a is a schematic diagram showing analysing
`means providing part of the apparatus of the embodiments of
`either FIG. la or FIG. lb;
`[0021] FIG. 3b is a schematic diagram showing the rela(cid:173)
`tionship between a functional definition located in the data
`storage of FIG. 2 and its functional capability;
`
`[0022] FIG. 4 is a schematic block diagram showing the
`steps involved in analysing a function description for its
`semantic content;
`[0023] FIG. 5 is a schematic block diagram showing the
`steps involved in analysing an input statement for its seman(cid:173)
`tic patterns, logical structure, semantic content and for
`matching semantic content between the function descrip(cid:173)
`tions and the input statement;
`[0024] FIG. 6a is a schematic diagram showing categori(cid:173)
`sation of phrases;
`[0025] FIG. 6b is a schematic diagram showing analysis
`of semantic content of phrases;
`[0026] FIG. 7 is a block diagram showing a terminal
`utilised in a second embodiment of the invention and
`corresponding to that shown in FIG. l;
`
`[0027] FIG. 8 is a block diagram showing an arrangement
`of lexical components according to a third embodiment;
`
`[0028] FIG. 9 is a block diagram showing in greater detail
`the components comprising the client terminal shown in
`FIGS. la and lb;
`[0029] FIG. 10 is a block diagram showing in greater
`detail the processes present in the client terminal shown in
`FIGS. la and lb;
`[0030] FIG. 11 is a block diagram showing in greater
`detail the components comprising the server shown in
`FIGS. la and lb;
`
`[0032] Various phrases are used in the following descrip(cid:173)
`tion, and in the context of the present invention these are
`defined as follows:
`[0033]
`"Semantically meaningful elements" are ele(cid:173)
`ments found in natural language and may be defined
`with reference to the following example: "The cat sat
`on a mat":
`
`[0034] a) meaningful semantic entities, typically
`denoted by nouns. For example the semantic enti(cid:173)
`ties are "cat", "and "mat".
`
`[0035] b) the form of each of the entities (e.g.
`whether it is singular or plural), and whether it is
`in the definite or indefinite form. In the example,
`"the cat" is singular, and "the" indicates that it is
`the definite article. "Mat" is singular, and "a"
`indicates that it is in the indefinite form.
`[0036] c) "States of affairs"-generally indicated
`by verbs. States of affairs indicate either actions,
`as most verbs do, or states of being (e.g. the verb
`"to be"). In this example, "sat" is a state of affairs.
`
`[0037] d) The conditions attached to each state of
`affairs (e.g. the tense of the verb concerned)
`[0038] e) Modifiers (e.g. adverbs or adjectives)
`which ascribe properties or otherwise modify an
`entity or state of affairs.
`[0039]
`f) The linkages between the occurrences of
`the foregoing (e.g. which entities a state of affairs
`affects and how; and which entities or state of
`affairs a modifier modifies).
`[0040]
`"semantic content": a collection of semanti(cid:173)
`cally meaningful elements (as defined above) com(cid:173)
`prising a phrase;
`
`[0041]
`"semantic pattern": semantic identifiers that
`represent a relationship between semantically mean(cid:173)
`ingful elements;
`
`[0042]
`"logical structure": logical flow of informa(cid:173)
`tion, in the form of Boolean operators (and, or, if,
`then) and conditions and actions that are dependent
`on the operators;
`
`[0043]
`"input statement": phrase or sentence entered
`by a user for analysis of its semantic content;
`
`[0044]
`"function": a named part of a computer pro(cid:173)
`gram that can be invoked from other parts of a
`program as needed;
`
`[0045]
`"function definition": the name of a function,
`the type of the value it returns (if any), and the types
`and names of its arguments (if any) and the code
`comprising the function. The form of a function
`definition is language-specific, in terms of variable
`types, variable declaration, and code syntax;
`
`[0046]
`language
`"function description": natural
`phrase or sentence describing the functional capa(cid:173)
`bility of a function.
`
`[0031] FIG. 12 is a block diagram showing a possible
`implementation configuration for software automatically
`generated using the apparatus shown in FIGS. la and lb.
`
`[0047] Further, in the following description, a "user" is not
`necessarily limited to a human entity, as it might well be for
`instance another piece of equipment or a software agent.
`
`Page 16 of 25
`
`
`
`US 2003/0046061 Al
`
`Mar. 6, 2003
`
`3
`
`[0048] Overview
`[0049] Broadly, in a telecommunications environment for
`instance, using an embodiment of the present invention, a
`user can input a natural language instruction (an "input
`statement") and it will be analysed and used to put together
`source code customised for carrying out the user's wishes in
`that environment. For instance, the user might make the
`input statement "Please divert my phone to Frank's". That
`statement will be analysed and used to generate source code
`that causes call divert on incoming calls for that user to the
`telephone number of the named person. The source code so
`generated will need to be appropriate to the current tele(cid:173)
`communications environment for the user, for instance in
`terms of operating systems, database query languages and
`transmission protocols, but the user needs no technical
`knowledge of that environment. Further, embodiments of
`the present invention can be transferred to a different tech(cid:173)
`nical environment for the same user relatively easily.
`[0050] With reference to FIG. 1 of the accompanying
`drawings, apparatus 100 for analysing input statements and
`automatically generating customised source code according
`to the present invention may generally be referred to as a
`'software generator'lOO. The generator 100 is shown
`divided into the following functional parts:
`[0051] DATA ANALYSER 102
`[0052] CODE GENERATOR 103
`[0053] COMPUTER 105
`
`[0054] DATA STORAGE 106
`
`[0055] The COMPUTER 105 can either be a standalone
`machine, as shown in FIG. la, or a server computer that
`receives input from a client terminal 101 via a communica(cid:173)
`tions network 108, as shown in FIG. lb. The software
`generator 100 may be built into a telephone, or a mobile
`phone using speech recognition and synthesis for input and
`output respectively.
`[0056] When the computer is a server, as shown in FIG.
`lb, the computer 105 may be additionally connected to
`external data stores 112 via a communications network such
`as the Internet 110. Information about the Internet can be
`found, for example, from The World Wide Web Handbook
`from International Thomson Computer Press, ISBN: 1-850-
`32205-8. The terms "client" and "server" are illustrative but
`not limiting to any particular architecture.
`[0057] The DATA STORAGE 106 functional part of the
`apparatus is located on the computer 105 and includes one
`or more data stores comprising predefined functions,
`referred to as function definitions. These function definitions
`are used as described later in the generation of the software
`code, and include the code comprising a function, the name
`of each function and any arguments it takes and their types.
`In addition, each predefined function has an associated
`natural language description, referred to as a function
`description, from which the data analyser 102 can extract the
`functional capability of corresponding predefined functions.
`This process is explained in detail with reference to the
`embodiment below. The data storage 106 also includes
`linguistic stores comprising multilingual lexicons and lin(cid:173)
`guistic, semantic and syntactic information. The data analy(cid:173)
`ser 102 accesses the linguistic stores in order to resolve the
`meanings of input statements and function descriptions.
`
`[0058] The DATA ANALYSER 102 functional part of the
`apparatus is located on the computer 105 and includes
`analysing means and comparing means. The data analyser
`102 is used for analysing and resolving the meaning of
`function descriptions that are stored in the data storage 106
`and of input statements, so as to identify the functional
`requirements of input statements and relate them to the
`functional capability of predefined functions. In descriptive
`terms, the data analyser 102 matches these functional
`requirements with predefined functions that have been deter(cid:173)
`mined to have the functional capability of the functional
`requirement. In mechanistic terms, the data analyser 102
`determines the semantic content of the input statement and
`compares the input statement semantic content with the
`semantic content of a plurality of function descriptions
`(which have been similarly analysed for their semantic
`content). If there is a match between the semantics of the
`input statement and one of the function definitions then that
`function is considered to meet the functional requirement of
`the input statement.
`[0059] The CODE GENERATOR 103 functional part of
`the apparatus is located on the computer 105 and is used for
`generating source code from whichever predefined functions
`have been identified by the data analyser 102.
`[0060] Brief Overview of Operation
`[0061] A user enters an input statement, which comprises
`any natural language input such as a statement, conditions
`and actions, and which describes a desired functionality of
`code to be generated by the generator 100, to the client
`terminal 101. The user may also specify, using a standard file
`management browser (e.g. Windows Explorer™), a class or
`folder in which function descriptions, which relate to the
`input statement functionality, are located. The input state(cid:173)
`ment is passed to the data analyser 102 for semantic analysis
`in order to extract the functional requirement of the input
`statement. The data analyser 102 then retrieves whichever
`function descriptions are stored at the specified location
`from the data storage 106 and analyses the function descrip(cid:173)
`tions for their semantic content in order to determine the
`functional capability of the corresponding functions. The
`data analyser 102 checks, as is described in detail below, by
`comparing the semantics of the input statement against the
`semantics of the function descriptions, that there is a func(cid:173)
`tion that meets the functional requirement of the input
`statement. Assuming that there is a suitable function, the
`data analyser 102 retrieves the corresponding code compris(cid:173)
`ing the function from the data storage 106. The semantic
`analysis performed on the input statement by the data
`analyser 102 also identifies conjunctions from the input
`statement, and these, together with the retrieved code are
`passed to the code generator 103. The code generator 103
`translates the conjunctions into logical operators, and inserts
`said operators, together with the retrieved code into a
`predetermined template, according to a set of predetermined
`rules, thereby creating a processable computer program.
`Having assembled these components to form the program,
`the code generator 103 loads the program onto a terminal,
`which could be a network device such as a router, a
`telephone, a server computer or a client computer, for
`subsequent processing.
`[0062] The present invention thus:
`[0063] can make use of existing functions and/or
`methods;
`
`Page 17 of 25
`
`
`
`US 2003/0046061 Al
`
`Mar. 6, 2003
`
`4
`
`[0064] can use functions in any language and gener(cid:173)
`ate code in any language;
`
`[0065] does not require the user to be computer code
`literate;
`
`[0066] allows the user to enter requirements using
`natural language-input is not required in a standard
`format;
`
`[0067] enables validation of the software generated
`via input statements in the form of questions.
`
`[0068] First Embodiment of the Invention: Resolution of
`Input Statements into Source Code
`
`[0069] An embodiment of the present invention is oper(cid:173)
`able to automatically resolve input statements into source
`code, provided the software generator 100 has access to
`source code that it can identify as providing the functional
`requirements of the input statements. In particular, the
`present embodiment concerns generation of software to
`handle telephone calls. The software to be generated will
`implement requested behaviour by running a number of
`predefined functions which carry out the lower-level actions
`of ringing a telephone, forwarding a call etc.
`
`In practice, it will be understood that the generated
`[0070]
`software could either comprise the actual code providing a
`set of functions to implement requested behaviour, or it
`could comprise a set of calls on code which is actually
`located elsewhere in a network. In the latter case, the
`generated software thus triggers calls to this code.
`
`[0071] The embodiment is described below in more detail,
`in the following order: firstly analysis of one or more
`predefined functions, secondly analysis of an input state(cid:173)
`ment, and thirdly subsequent combining of these analyses.
`
`[0072] Analysis of One or More Predefined Functions
`
`[0073] Function Descriptions
`
`[0074] Referring to FIG. 2, information about the func(cid:173)
`tions that are accessible to the generator 100 is stored in data
`storage 106, specifically in a code database 200, which
`comprises predefined function definitions. As described
`briefly above, the predefined functions are accompanied by
`function descriptions, which, in essence, describe the func(cid:173)
`tional capability of the predefined function. The function
`descriptions may be given by a separate description that
`accompanies the functions. In accordance with the conven(cid:173)
`tions used in Java, it will be understood that a method is used
`to denote a function, and the terms method and function may
`be used interchangeably when describing the present
`embodiment. The function description will normally be
`written by a software developer who has an understanding of
`the operation of the classes, objects and methods. Descrip(cid:173)
`tions may follow the established conventions for Java docu(cid:173)
`mentation (for example, see The Design of Distributed
`Hyperlinked Programming Documentation (IWHD '95)-A
`paper on the design of javadoc, the Java Software tool for
`generating web-based API documentation. Presented at the
`International Workshop on Hypermedia Design '95), but
`may also need to take account of the requirements of the data
`analyser 102, as described later.
`
`[0075] The code database 200 may comprise one or more
`data files 201 containing predefined function definitions,
`libraries 203 of predefined function definitions and/or links
`
`205a to remote stores 112 where predefined function defi(cid:173)
`nitions 205b are located. In the present embodiment, the
`predefined function definitions are written in Java, but the
`database may be populated with definitions and descriptions
`for functions written in any programming language.
`
`[0076] The data analyser 102 identifies the functional
`capabilities of the predefined functions by analysing the
`semantic content of the function descriptions. As shown in
`FIG. 3b, function descriptions may conveniently be written
`as comments 311 in the Java source code. For example, a
`well known feature of the Java programming language is
`that information included between the"/** ... */"symbols
`are comments. When these comments are provided as a
`precursor to a method or class declaration in the Java source,
`they may be put together with a function definition 310 and
`translated into a documentation file by running a special
`program called "javadoc". Javadoc is the tool from Sun
`Microsystems for generating API documentation in HTML
`format from doc comments in source code (further infor(cid:173)
`mation is available from the Hypermedia paper referenced
`above).
`
`[0077] For example:
`
`COMMENT 311:
`/**
`* Causes a phone to forward an incoming call to a nominated person.
`* This function requires the extension number that you want to forward
`your calls to
`*/
`FUNCTION DEFINITION 310:
`public void forwardCall (String phone_number){
`
`... }
`
`[0078]
`
`is compiled by javadoc into:
`
`[0079] Documentation File
`
`[0080]
`
`forwardCall(String)
`
`[0081] Causes a phone to forward an incoming call to a
`nominated person.
`
`[0082] Thus the function description 313 for this function
`forwardCall is "Causes a phone to forward an incoming call
`to a nominated person".The function description 313 also
`details input parameters that are required for the function to
`operate; it is convenient to split the function description into
`a utility description 315"Afunction which causes a phone to
`forward an incoming call to X", and an input parameter
`317"nominated person". It is understood that splitting the
`fu