GB2227339A - Complex expression generator - Google Patents

Complex expression generator Download PDF

Info

Publication number
GB2227339A
GB2227339A GB8901349A GB8901349A GB2227339A GB 2227339 A GB2227339 A GB 2227339A GB 8901349 A GB8901349 A GB 8901349A GB 8901349 A GB8901349 A GB 8901349A GB 2227339 A GB2227339 A GB 2227339A
Authority
GB
United Kingdom
Prior art keywords
macro
complex
complex expression
generated
expressions
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
GB8901349A
Other versions
GB8901349D0 (en
Inventor
Kashinath Narayan Dandeker
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to GB8901349A priority Critical patent/GB2227339A/en
Publication of GB8901349D0 publication Critical patent/GB8901349D0/en
Publication of GB2227339A publication Critical patent/GB2227339A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

This invention relates to the generation of complex expressions from simple expressions defined as macros, where each expression represents a structure which is equivalent to a specified procedure that has to be carried out in order to obtain ultimately the desired result. The required macro processing can be carried out manually but is speeded up if a suitable macro processor is used. The generated complex expression after macro processing is resolved in one step without re-arrangement by a suitable compiler. An application is implementation of parameterized views in Relational Query Languages, exploiting the link between the BNF Grammar of the Relational Query Language and the replacement texts of the macro definitions,

Description

COMPLEX EXPRESSION GENERATOR This invention relates to the generation of complex expressions from simple expressions defined as macros, where each expression represents a structure which is equivalent to a specified procedure that has to be carried out in order to obtain ultimately the desired result. The required macro processing can be carried out manually but is speeded up if a suitable macro processor is used. The generated complex expression after macro processing is resolved in one step without re-arrangement by a suitable compiler.
In Relational Query Languages a view facility is provided in order to be able to resolve efficiently a complicated query in one step by defining it in terms of simpler queries where each simple query represents a step that otherwise would have to he carried out in order to obtain ultimately the desired information. A view has a name and an associated query definition which represents the parse tree, a structure which is equivalent to a specified procedure that has to be carried out in order to obtain the required information as specified by the associated query.
At some stage in the processing of a view the name of the view is replaced by the wording of its associated query.
As this process appears to be similar to macro processing it was thought possible to implement views in Relational Query Languages by defining views as macros where the replacement text of the macro definition contains the query definition associated with the view. The complex query generated after macro processing might be re-arranged before it was resolved it one step by the Relational Query language compiler that was used. This invention has enabled that possibility to be realized. Views can be defined as macros and these can be implemented in Relational Query Languages with a suitable macro processor. Moreover the generated complex query after macro processing can be resolved in one step without rearrangement by the Relational Query Language compiler that was used.
If views are defined as macros it becomes possible to define a parameterized view as a parameterized macro in which the replacement text contains the same parameterized query definition associated with the parameterized view, so that all the information required to generate the specified procedure that has to be carried out to obtain the required information as specified by the parameterized query, is not available at the time of the definition of such a parameterized view. A parameterized view is a new concept which has not been implemented with the use of the existing methods for implementing views in Relational Query Languages.However if the parameterized view is referenced subsequently in a query and the appropriate parameters are provided at that time and processed then all the information required to generate the specified procedure that has to he carried out becomes available and the desired result can be obtained.
Parameterized views are implemented in Relational Query languages with a macro processor which can substitute text, replace parameters and has the ability to handle nested macro calls.
It was discovered that this method of implementing views as macros in Relational Query Languages depended solely on the link between the BNF Grammar of the Relational Query Language that was used and the replacement text of the macro definitions used. It was realized that this property was not limited to Relational Query Languages and query expressions but could be extended to any other type of language and to any other types of expressions or sets of symbols or structures which could be defined as macros so that the generated complicated expression or set of symbols or structure after macro processing could be resolved in one step without re-arrangement by the language compiler that was used.
This invention exploits the link between on the BNF Grammar of the language and the replacement text of the macro definitions used.
The BNF Grammar of the language should be as follows: Sentence Symbol of the language := Identifier Any Expression Any Set of Symbols Any Structure Any Expression ) i ( Any Set of Symbols Any Structure where Any Expression is a query expression, an arithmetic expression or any other expression and where "(" and ")" are a specified pair of delimiters and where complex expressions or complex sets of symbols or complex structures are made from simple expressions or simple set of symbols or simple structures by using connecting operators of the types shown in the following examples Any Expression ::= Any Expression connecting operator Any Expression where Any Expression is a query expression, or an arithmetic expression or any other expression and where connecting~operator is a suitable operator.
In this case the macro definition is of the form where the macro name is an Identifier and the replacement text of which is ( Any Expression ) where "(" and ")" are the same pair of delimiters specified in the BNF Grammar of the language used.
Any Set of Symbols := Any Set of Symbols connecting~operator Any Set of Symbols where Any Set of Symbols is a set of any symbols and where connecting operator is a suitable operator.
In this case the macro definition is of the form where the macro name is an Identifier~ and the replacement text of which is ( Any Set of Symbols ) where "(" and t are the same pair of delimiters specified in the BNF Grammar of the language used.
Any Structure := Any Structure connecting operator Any Structure where Any Structure is any structure and where connectingoperator is a suitable operator.
In this case the macro definition is of the form where the macro name is an Identifier and the replacement text of which is ( Structure ) where "(" and ")" are the same pair of delimiters as specified in the BNF Grammar of the language used.
The examples that illustrate the use of this invention will be limited to the implementation of parameterized views in Relational Query Languages with suitable macro processors. These examples will show different Relational Query Languages being used with different macro processors.
If we use the pre-processor to the C compiler provided with the Unix System as the macro processor to implement views in the Dundee form of the DEAL language then the two parameterized view definitions for citysup and impsup in the form of two parameterized macro definitions named citysup with formal parameter x and impsup with formal parameters x and y in their replacement texts and the corresponding macro call with the two actual parameters london and 30 which are provided would be as follows: #define citysup(x) ( supplier where city = 'x' #define impsup(x,y) ( citysup(x)where status > y impsup( london, 30) on processing the above macro definitions the following complex query is generated which is resolved without rearrangement by the compiler.
( ( supplier where city = 'london' ) where status > 30 The above query is equivalent to the following single query: supplier where city - 'london' and status > 30 If we use the m4 macro processor provided with the Unix System to implement views in the SQL form of the DEAL language then the two parameterized view definitions for citysup and impsup in the form of two parameterized macro definitions named citysup with positional parameter $1 and impsup with positional parameters $1 and $2 in their replacement texts and the corresponding macro call with the two actual parameters london and 30 which are provided would be as follows: define(citysup,( select * from supplier where city = '$1' )) define(impsup,( select * from citysup($1) where status > $2 impsup(london,30); on processing the above macro definitions the following complex query is generated which is resolved without rearrangement by the compiler.
( select * from ( select * from supplier where city ='lon- don' ) where status ) 30 ); The above query is equivalent to the following single query: select * from supplier where city = 'london' and status > 30; If we use a custom built pre-processor to implement views in the Dundee form of the DEAL language then the two parameterized view definitions for citysup and impsup in the form of two parameterized macro definitions named citysup with formal parameter x and impsup with formal parameters x and y in their replacement texts and the corresponding macro call with the two actual parameters london and 30 which are provided would be as follows: citysup(x) == ( anon[all] from supplier where city ='x' ) impsup(x,y) == ( anon [ allj from citysup(x) where status > y impsup(london,30); on processing the above macro definitions the following complex query is generated which is resolved without rearrangement by the compiler ( anon [ all ] from ( anon [ all ] from supplier where city 'london' ) where status > 30 ); The above query is equivalent to the following single query: anon [ all ] from supplier where city = 'london' and status > 30;

Claims (6)

  1. CLAIMS 1. A COMPLEX EXPRESSION GENERATOR enables parameterized views to be implemented in Relational Query Languages.
    The required macro processing can be carried out manually but it is speeded up with the use of a macro processor that can substitute text, replace parameters and can handle nested macro calls.
  2. 2. Parameterized views cannot be implemented in Relational Query Languages using existing methods followed in current database practice.
  3. 3. Use of a COMPLEX EXPRESSION GENERATOR is a cheaper and simpler method of implementing views in Relational Query Languages than using existing methods followed in current database practice.
  4. 4. As the complex expression generated after macro processing by the COMPLEX EXPRESSION GENERATOR is in the Relational Query language used, it is possible to read it, to decipher it and to ensure that it meets the user requirements before using it to generate the specified procedure that has to be carried out to obtain eventually the desired result. Such a procedure cannot be carried out using existing methods followed in current database practice.
  5. 5. Use of a COMPLEX EXPRESSION GENERATOR is not limited to Query expressions and Relational Query Languages. It can be used without change with Arithmetic expressions or any other expressions or any sets of symbols or any structures provided a suitable compiler is available. The complex expression generated after macro processing is resolved in one step withot re-arrangement by a suitable compiler.
  6. 6. The complex sentences generated as tlaimed in Claim 3 or Claim 4 by the COMPLEX EXPRESSION GENERATOR as claimed in Claim 1 after a subsequent protess of macre expansion, which excludes syntax checking, parsing or code generation are due to the link between the ENF Grammar of the Ianguage and the macro definitione, the macro calls and the parameter vlues provided ss claimed in Claim 2.
    6. The COMPLEX EXPRESSION ENEHATO is designed to exploit the link between the BNF Grammar of the language and the replacement text of the macro definitions used and is based on theoretical foundations which have been researched thoroughly.
    Amendments to the claims have been filed as follows
    1. The COMPLEX EXPRESSION GENERATOR comprising macro definitions, which may bs prameterised, followed by their corresponding macro calls, which may include parameter values that enables complex sentences to be generated in a language from simple sentences in that language by a subsequent process of macro expansion which excludes syntax checking, parsing and code gen- eration.
    2 The macro definitions, macro calls and the associ- ated paramter values that comprise the COMPLEX EXPRES SION GENERATOR as claimed in Claim 1 are entered and are not generated as a-result of any process.
    3. The complex sentences generated by the COMPLEX EXPRESSION GENERATOR as claimed in Claim 1 can be read, checked and understood easily before these are used to perform the equivalent specified procedures by sit as obtain eventually the desired result" Such a procedure cannot be carried out by a process which excludes syn- t-a; checking7 parsing and code generation using exist- ing methods followed in current practice.
    4. The comple. sentences generated as claimed in Claim : by The COPLE\ EXPRESSION GENERATOR as claimed in Claims I include Query expressions, Arithmetic expressions or any other expressions or any sets of symbols or any structures because the macro definitions, macro calls and the associated parameter values that comprise the COMPLEX EXPESSION GENERATOR as claimed in Claim 1 are entered as claimed in Claim 2 in an appropriate form and are subjected to an appropriate subsequent process of macra expansion which excludes syntax checking, parsing of code generation.
    5. The complex sentences generated as claimed in Claim 3 or Claim 4 by the COMPLEX EXPRESSION GENERATOR as claimed in Claim 1 after a subsequent process of macfo expansion, which excludes syntax checking, parsing or code generation, are resolved in one step without rearrangement by a suitable complier.
GB8901349A 1989-01-21 1989-01-21 Complex expression generator Pending GB2227339A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
GB8901349A GB2227339A (en) 1989-01-21 1989-01-21 Complex expression generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
GB8901349A GB2227339A (en) 1989-01-21 1989-01-21 Complex expression generator

Publications (2)

Publication Number Publication Date
GB8901349D0 GB8901349D0 (en) 1989-03-15
GB2227339A true GB2227339A (en) 1990-07-25

Family

ID=10650402

Family Applications (1)

Application Number Title Priority Date Filing Date
GB8901349A Pending GB2227339A (en) 1989-01-21 1989-01-21 Complex expression generator

Country Status (1)

Country Link
GB (1) GB2227339A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1121654A1 (en) * 1998-10-16 2001-08-08 Computer Associates Think, Inc. Method and system for an extensible macro language
US7734457B2 (en) 1999-10-16 2010-06-08 Computer Associates Think, Inc. Method and system for generating dynamic comparison models
US7865515B2 (en) * 2006-08-28 2011-01-04 Microsoft Corporation Server side bucketization of parameterized queries
CN110222159A (en) * 2019-04-30 2019-09-10 电子科技大学 A kind of text based human-computer interaction training method and system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1121654A1 (en) * 1998-10-16 2001-08-08 Computer Associates Think, Inc. Method and system for an extensible macro language
EP1121654A4 (en) * 1998-10-16 2003-09-24 Computer Ass Think Inc Method and system for an extensible macro language
US7711685B1 (en) 1998-10-16 2010-05-04 Computer Associates Think, Inc. Method and system for an extensible macro language
US7734457B2 (en) 1999-10-16 2010-06-08 Computer Associates Think, Inc. Method and system for generating dynamic comparison models
US7865515B2 (en) * 2006-08-28 2011-01-04 Microsoft Corporation Server side bucketization of parameterized queries
CN110222159A (en) * 2019-04-30 2019-09-10 电子科技大学 A kind of text based human-computer interaction training method and system

Also Published As

Publication number Publication date
GB8901349D0 (en) 1989-03-15

Similar Documents

Publication Publication Date Title
CN112527997B (en) Intelligent question-answering method and system based on power grid field scheduling scene knowledge graph
WO2001057653A3 (en) Apparatus for automatically generating source code
WO2008037572A1 (en) Method and apparatus for integrating relational and hierarchical data
CN107766456A (en) Data parsing converting system and method based on file interaction between supplementary pension system
JP2011524579A (en) General-purpose digital semantic database for machine language translation
GB2227339A (en) Complex expression generator
CN115658913A (en) Electric power equipment information map construction method based on Handle identification analysis
CN117312531A (en) Power distribution network fault attribution analysis method based on large language model with enhanced knowledge graph
EP0403057A3 (en) Method of translating sentence including adverb phrase by using translating apparatus
CN109783507A (en) The automatic auditing method and system of substation project clearance compliance
Lezius et al. Imslex representing morphological and syntactic information in a relational database
KR20180086801A (en) Apparatus and method for sentence meaning formalization and text generation based on rdf triples
JPH04297923A (en) Character coder converting system
JPS63136260A (en) Processing system for production of sentence of mechanical translation system
NO962055L (en) Device and method of controlling functions
Griswold Pattern Matching in Icon
CN113515950B (en) Natural language processing semantic analysis method suitable for intelligent power dispatching
Nguyen et al. Application of First-Order Logic Inference in Vietnamese Question Answering System
Zwiers et al. Modular completeness: Integrating the reuse of specified software in top-down program development
KR101527198B1 (en) Patent Intelligence System and its Method on Making Systemtic Relation on Technological Problems and Technical Solution
Iqbal et al. Gap analysis of beef meat industry in Pakistan with special reference to Chinese standards for meat slaughtering and processing
CN117454848A (en) Synchronous data stream language conversion method for expanding condition block
Chen et al. Development of a partially bracketed corpus with part-of-speech information only
KR100426315B1 (en) Analysis method and apparatus for extraction of ejb component from servlet program
JP2727987B2 (en) Data type inspection device