The algorithmic metalanguage almet

The algorithmic metalanguage almet

THE ALGORITHMIC METALA~GUAGE ALMET* V.V.CHER~YUGOV Leningrad (Received 5 February 1. Construction 1968; revised of the algorithmic 15 April 19...

503KB Sizes 8 Downloads 492 Views

THE ALGORITHMIC METALA~GUAGE

ALMET*

V.V.CHER~YUGOV Leningrad (Received

5 February

1. Construction

1968; revised

of the algorithmic

15 April

1968)

metalanguage

THE form of the quantities with which we can operate in a concrete problemoriented algorithmic language is defined and fixed in the creation of the language. A problem orientated language makes it possible for the user to call the values of the quantities indicated by names (identifi~) by means of procedures (o~rations), defined in the language or described by the user, within the scope of the types of quantities existing in the language. At the same time there is a number of problems (synthesis of schemes, translation from algorithm languages, the carrying out of analytical calculations etc.) for whose description the use of an algorithmic language with an enlarged set of types of quantity is more natural and effective. In the proposed language, as distinct from problemorientated languages, in addition to names and values the structure of the quantity is also an object of the language. Definition. An algorithmic language is a ~tala~uage if it has all three characteristic qu~tities: structure, name and value are the objects of action of the language. In the description of algorithmic processes for a metalanguage it is possible for the user to introduce quantities which are adequate for the objects of the program (such ideas as block, string ets., denoting methods of restricting variables, generally differ from the idea of the structure of a quantity). The algorithm media of a metalanguage can be used for the transformation (calculation) of the written program into the metalanguage (for instance, transformations similar to the substitution of actual parameters by name in ALGOL-60). In this way various dialects, adapted to the solution of one problem or another, can be formed within the scope of one language. If we wonsider this feature of a metalanguage, only necessary algorithmic media can be included in the base configuration, which in its turn overlooks the creation of a translator from the *Zh,

v’y>hisl. Mat. mat. Fiz.,

9, 6, 1419-1423,

1969

247

248

V. V. Chernyugov

metalanguage. In the ALMET language the means of producing grammars without context is used to describe the structure of the variables. Suppose that the contextually free grammar G is quadruple W,, V, , P, 3, where VT is a finite set of terminal symbols, VN is a finite set of non-terminal symbols (metavariables) which has no intersection with V,, p is a finite set of generating rules and S is the finite set of words in the alphabet V = V, IJ V,. The generating rules have the form di : : = ‘pii 1‘pi21 . . . 1qin 7 where Ai E V, is a metavariable and (Pii’ (Pi21””% are the words in the alphabet V. The variable generating the rule for a word consists of a change of metavariable Ai in this word to ‘pii. In the metalanguage the structure of the variable is indicated by a reference to an element of the set S. The variable with the structure II, E S, can take as its value any words from VT, which can be generated from the initial word $ by means of a consecutive application of the generating rules of this grammar. 2.

A formal description

of the algorithmic

metalaguage

ALMET

1. The structure of the language. An algorithmic metalanguage is intended to describe algorithmic processes on quantities which vary in structure. The writing of an algorithm in a metalanguage consists of descriptions: descriptions of variables, meta-variables, operations on quantities and operators. The descriptions of the metavariables give the generating grammar, by means of which the structure of the variables are defined. To control the flow of the algorithmic process an operator is introduced for a conditional jump. To increase the ease of programming and rational realization the language has a block structure and a block localization of the quantities. 1.1. Syntax :: = of operators> end :: = begin :: = 1 dist of descriptions> of operators> :: = / : : I~description of the operation> :: = \(((: :: = (the symbols of some alphabet,as well as the underlined words, left from this alphabet are symbols of the

The algorithmic

metalanguage

249

almet

metalanguage). 2. Descriptions. The description define the properties and localization descriptions

of the variables.

The

of quantities must precede their use in the algorithm (dynamically).

The quantities described are present in the block containing the descriptions these quantities.

of

A repeated description of a quantity in an embedded

(dynamically) block stops the operation of the preceding description at the time this block is working. The sphere of action of a mark is similarly defined. The appearance of a mark before an operator (: ) is considered as a description of this mark. Variables, metavariables and operations are described in a corresponding way. 2.1.

Description of variables and metavariables.

The description of a variable consists the identifier of the variable.

of relating the required structure to

The structure is defined by giving the

corresponding generating grammar in the form of a description of metavariables. The set of metavariables forms the set V,

and all the other symbols of the

metaformulae form the set of terminal symbols VT.

The structure of a variable

defines the form of the words in the alphabet VT which can be values of the variable. 2.1.1.

Syntax.

(The metalanguage symbols &and

1 are equivalent in

meaning to the symbols : = and 1.1 :: = dcl


# :: F :: # :: = ~~tlist if metaformulae> :: = :: = : : = : : =
Note.

It is considered that in every algorithm there is a description of the metavariable s and QC- fin of the form or :: = # or - fin 2 #, where represents the symbol 1, and
250

V. V. Chernyugov

such texts appears in the transformation program in the metalanguage 2.1.3. am

of the writing of the

Examples

dcl f : : = -2 : : = -

(calculation)

(z) # -

1 b #

This describes a variable withidentifier f having the structure (z). The description of the metavariable z gives the generating grammar, corresponding to which the variable f may take as values words of the form (b), (aba), (aabaa) etc. 2.2 Descriptions

of the operations.

The descriptions of the operations define the transformations to which the quantities of the defined form may be subject. The form of the quantities, to which the transformation described is applicable, is given by the structure of the argument. The specification of the operation indicates whether the procedure belongs to the class of procedure-operations, function-operations or metaoperations. 2.2.1.

Syntax.

:: = <body of operation><specification of operation> <title of operation> :: = procedure <name of operation> (<structure of argument>) <name of operation> :: = cmetalanguage symbol> <structure of argument> :: = unetaformula> <body of operation> :: = <list if operators> <specification of operation> :: = procedure - end -1function - end meta - end (<metaprogram>) uesult> :: = <expression> <metaprogram> :: = <expression> 2.2.2.<br /> <br /> (<result>)<br /> <br /> Note.<br /> <br /> In the metaformula for the structure of the argument variables may be introduced which replace the parts of the metaformula which are of equivalent structure, while in the realization of the operator for the operation the variables take as their values the parts of the argument identified with them (see 4.1.2)<br /> <br /> The algorithmic<br /> <br /> metalanguuge<br /> <br /> almet<br /> <br /> 251<br /> <br /> 3. Expressions The primary component of the description of an algorit~i~ process is the The realization of an expression consists of the calculation of the expression. values of the expression. 3.1.<br /> <br /> Syntax.<br /> <br /> <expression> :: = ) <primary expression> <expression, <primary expression> :: = <terminal symbol> / <p-variable> / <operator for the function-operation> <p-variable> :: = <variable> 1 unetavariable> of <p-variable> <operator for fun~tion~peratio~ :: = <operator for operation>. 3.2.<br /> <br /> Calculation<br /> <br /> of the value of an expression.<br /> <br /> The value of an expression is a word in VT, composed of values entering into the expression for the components. The values of the components are calculated in succession from left to right. The value of the terminal symbol is the terminal symbol itself. The value of a variable is calculated from the structural description of the value of the variable (see 4.1.2) in accordance with generating grammar, operating in the block containing the expression to be calculated. The construction <metavariable> of <p-variable> has as its value the part of the value <p-variable> corresponding to the variable mentioned. The value of the operator for a function-operation is the value of the expression uresult> of this function-operation. The operator for the function-operation is realized in the same way as the operator for an operation. 4. Operators.<br /> <br /> I<br /> <br /> The operators in a block (promo) are realized in succession in the order of their position. The natural order can be changed by a conditional jump operator. 4.1. 4.1.1.<br /> <br /> The operators for the operations. Syntax.<br /> <br /> <operator for procedure operation, :: = <operator for operation> <operator for meta-operation> :: - <operator for operation> <operator for operation, :: = <name of operation> (<argument rel="nofollow">) <argument rel="nofollow"> :: = <expressioru<br /> <br /> V. V. Chernyugov<br /> <br /> 252<br /> <br /> 4.1.<br /> <br /> Realization<br /> <br /> of the operator for an operation.<br /> <br /> The operator is applied to the value of the expression <argument rel="nofollow">. Identification (see 121) of this value is carried out from the structure of the argument (it must be noted that the algorithmic metalangnage described in I21 in not a metalanguage in the sense of the definition of a metalanguage given in Section 11. The identification is possible if the word which is the value of the ~~rnent can be derived from the word tstructure of the argument> (considering that the variables replace the parts of the metaformula which are equivalent in structure) in the grammar used in the block. If the identification is impossible this is considered as a mistake in the algorithm. The result of the identification is the structural description (S-marker) [11 of the value of the argument. The variables in the structure of the lament take new values if we take account of the branches of the structural description corresponding to the variables. The structural description of the value of the variable is used in the calculation of the value of the variable. After carrying out the identification, the operators of the body of the operation are realized. 4.1.3<br /> <br /> The meta-operation.<br /> <br /> A m&a-operation considers the value of an expression unetaprogram> as an algorithm in the metal~guage. After realizing the body of the operation the value of the expression ~e~ro~am> is ca~c~at~ and the word obtained is realized as an operator. 4.1.4.<br /> <br /> Note<br /> <br /> It is considered that two operations are described in each aIgorit~ with names input and output for effecting the input and output of i~~mation. (The body of these operations is naturally <code>.L ) The operator for the functionoperation input (<expression>) effects the input of information in accordance with the instructions which can be given by the value of the expression. The value of the operator for the f~ctio~operation input (<expression>) is the value of the word which is input. The iperator for the pr~~~~~ratioa output f<expression> outputs the value of the expression. 4.2 The operator for a conditional 4.2.1.<br /> <br /> jump.<br /> <br /> Syntax<br /> <br /> <operator for conditional jump> :: = if <Boolean expresion, then - go - to aarb <Bolosan expression> :: = <expressi&-l> urelation sign> <expression-2><br /> <br /> The algorithmic<br /> <br /> metalanguage<br /> <br /> almet<br /> <br /> 253<br /> <br /> <expression-l> ** . . = <expression> <expression-2> :: = <expression> <relation sign> :: = =I# 4.2.1. Realization<br /> <br /> of the conditional<br /> <br /> operator.<br /> <br /> The values of the expressions <expression-l> and <expression-2> are compared. If the Boolean expression is true the operator indicated by the mark mentioned is realized by what follows and in the opposite case the following operator is realized. 4.3.<br /> <br /> The block.<br /> <br /> The operator <block> inputs new definitions of the variables, metavariables, operations and marks whose descriptions are in this block. After realizing the input operators in the block the input definitions are no longer in force. 4.4.<br /> <br /> The empty operator.<br /> <br /> The operator <empty operator> is considered to be realized. 4.4.1.<br /> <br /> syntax.<br /> <br /> <empty operator> :: = 3. Example Let us consider a program which translates the description of an arithmetic expression from ALGOL 60 to the Polish inverse description. begin d= :: = ar. exnression # ar. expression :: = term 1 0~. + E - tee 1 term 9. + s - ar. exnression # term --- :: = factor1 factor op. x s I term # first expression 1 first expressionJ factor # factor :: = -first expression :: -- = ident Itar. expression) # ident :: =alblcldlelflg# --___--op.+o~-::++I-# Op.xorl::=x//# -&ccc%; F(D) begin ar. expression :: op. + E - Iterm, ar. expression, 01. + s ----= term ) 0. 0, term, #<br /> <br /> 254<br /> <br /> V. V. Chernyugov<br /> <br /> term :: = factor J factor, term, 9. x ok / # --factor :: = first expression 1 first expression, -first expression<br /> <br /> factor I#<br /> <br /> :: -- = ident / ar. expression #<br /> <br /> output (D) end procedure<br /> <br /> - end<br /> <br /> F(e x (a x b + c) b - f x g)<br /> <br /> In the block the variable D described has the structure ar. expression. descriptions<br /> <br /> of the metavariables.<br /> <br /> ident, op. + or -,<br /> <br /> ar. expression,<br /> <br /> The<br /> <br /> term. factor, first expression,<br /> <br /> op. x or/ define the set of permissible values of the variable<br /> <br /> D?he terminal symbols are a, b, c, d, e, f, g, +, -, x, /, T b,). The description of the procedure F defines the required transformation of the arithmetic expression. The procedure operator is As a result of the identification the structural description of this word. structure of the variable D is redefined<br /> <br /> f x g.<br /> <br /> the metavariables ar. expression,<br /> <br /> applied to the word e + (a x b + c) / b the variable D will have as its value In the body of the operation F the by means of a repeated description of<br /> <br /> term, factor, first expression.<br /> <br /> The operator<br /> <br /> output (D) outputs the value of the variable D. The value of the variable D, calculated in accordance with the new grammar, has the form e, a, b, x, c,+ , b, I, -k.<br /> <br /> f, g, x9--. Translated<br /> <br /> by H. F. Cleaves<br /> <br /> REFERENCES 1.<br /> <br /> 2.<br /> <br /> KHOMSKII, N. and MILLER, J. languages. Kibernetich. sb.<br /> <br /> Introduction<br /> <br /> 1, 227-290,<br /> <br /> to the formal analysis 1965.<br /> <br /> of natural<br /> <br /> TURCHIN. V. F. A metalanguage for the formal description of algorithmic languages, in: Tsifrovaya v$zhisZ. tekh. i. programmirovanie. Moscow, 124, 1966.<br /> <br /> 1, 116-<br /> <br /> </div> </div> </div> </div> </div> </div> </div> </div> <div class="modal fade" id="report" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <form role="form" method="post" action="https://c.coek.info/report/the-algorithmic-metalanguage-almet-" style="border: none;"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Report "The algorithmic metalanguage almet"</h4> </div> <div class="modal-body"> <div class="form-group"> <label>Your name</label> <input type="text" name="name" required="required" class="form-control" /> </div> <div class="form-group"> <label>Email</label> <input type="email" name="email" required="required" class="form-control" /> </div> <div class="form-group"> <label>Reason</label> <select name="reason" required="required" class="form-control"> <option value="">-Select Reason-</option> <option value="pornographic" selected="selected">Pornographic</option> <option value="defamatory">Defamatory</option> <option value="illegal">Illegal/Unlawful</option> <option value="spam">Spam</option> <option value="others">Other Terms Of Service Violation</option> <option value="copyright">File a copyright complaint</option> </select> </div> <div class="form-group"> <label>Description</label> <textarea name="description" required="required" rows="3" class="form-control" style="border: 1px solid #cccccc;"></textarea> </div> <div class="form-group"> <div style="display: inline-block;"> <div class="g-recaptcha" data-sitekey="6LciDjwUAAAAAMdLRL0FhiLgqyD9pO-Cr0MB-hVG"></div> </div> </div> <script src='https://www.google.com/recaptcha/api.js'></script> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Send</button> </div> </form> </div> </div> </div> </div> <!-- BEGIN FOOTER --> <footer id="footer"> <div id="footer-top" class="container"> <div class="row"> <div class="block col-sm-4"> <a href="https://c.coek.info/"><img style="width: 50%;" src="https://c.coek.info/assets/img/kundoc_logo.png" alt="c.coek.info" /></a> <br><br> <p></p> <hr /> <h3>Contact information</h3> <p> <strong>Joseph Rodriguez</strong><br /> <i class="fa fa-envelope-o"></i> <a href="mailto:info@c.coek.info">info@c.coek.info</a>.<br /><br /> <span><i class="fa fa-map-marker"></i> Address: </span> <address> Tiptrans, Ste #29578,<br /> Slevacska 476/2A,<br /> Rumburk,<br /> Ustecky / Usti nad Labem, 40801<br /> Czech Republic </address> </p> </div> <div class="block col-sm-4"> <h3>Helpful Links</h3> <ul class="footer-links"> <li><a href="https://c.coek.info/about">About Us</a></li> <li><a href="https://c.coek.info/contact">Contact Us</a></li> <li><a href="https://c.coek.info/copyright">Copyright</a></li> <li><a href="https://c.coek.info/privacy">Privacy Policy</a></li> <li><a href="https://c.coek.info/term">Terms and Service</a></li> <li><a href="https://c.coek.info/faq">FAQ</a></li> <li><a href="https://c.coek.info/cookie_policy">Cookie Policy</a></li> </ul> </div> <!-- BEGIN NEWSLETTER --> <div class="block col-sm-4" data-animation-direction="from-bottom" data-animation-delay="200"> <form action="https://c.coek.info/newsletter" method="post"> <div id="newsletter" class="col-sm-12"> <h2 class="section-title">Subscribe our weekly<br><span>Newsletter</span></h2> <div class="input-group"> <input type="text" placeholder="Enter your E-mail" name="newsletter_email" id="newsletter_email" class="form-control" /> <span class="input-group-btn"> <button class="btn btn-default" type="submit">Subscribe</button> </span> </div> </div> </form> </div> <!-- END NEWSLETTER --> </div> </div> <!-- BEGIN COPYRIGHT --> <div id="copyright"> <div class="container"> <div class="row"> <div class="col-sm-12"> Copyright © 2024 C.COEK.INFO. All rights reserved. <!-- BEGIN SOCIAL NETWORKS --> <ul class="social-networks"> <li><a href="#"><i class="fa fa-facebook"></i></a></li> <li><a href="#"><i class="fa fa-twitter"></i></a></li> <li><a href="#"><i class="fa fa-pinterest"></i></a></li> <li><a href="#"><i class="fa fa-youtube"></i></a></li> <li><a href="#"><i class="fa fa-rss"></i></a></li> </ul> <!-- END SOCIAL NETWORKS --> </div> </div> </div> </div> <!-- END COPYRIGHT --> </div> <!-- END WRAPPER --> </footer> <!-- END FOOTER --> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-Q76CSPQQQC"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-Q76CSPQQQC'); </script> <script src="https://c.coek.info/assets/js/jquery-3.2.1.min.js"></script> <script src="https://c.coek.info/assets/js/bootstrap.min.js"></script> <script src="https://c.coek.info/assets/js/scripts.js?v=1"></script> <script src="https://c.coek.info/assets/js/jquery-ui.min.js"></script> <script> $(function () { $("#pdf_search").autocomplete({ source: function (request, response) { $.ajax({ url: "https://c.coek.info/suggest", dataType: "json", data: { term: request.term }, success: function (data) { response(data); } }); }, autoFill: true, select: function (event, ui) { $(this).val(ui.item.value); $(this).parents("form").submit(); } }); }); </script> <!-- cookie policy --> <div id="CCOEKINFO_cookie_box" style="z-index:99999; border-top: 1px solid #fefefe; background: #FFC107; width: 100%; position: fixed; padding: 5px 15px; text-align: center; left:0; bottom: 0;"> Our partners will collect data and use cookies for ad personalization and measurement. <a href="https://c.coek.info/cookie_policy" target="_blank">Learn how we and our ad partner Google, collect and use data</a>. <a href="#" class="btn btn-success" onclick="accept_CCOEKINFO_cookie_box();return false;">Agree & close</a> </div> <script> function accept_CCOEKINFO_cookie_box() { document.cookie = "CCOEKINFO_cookie_box_viewed=1;max-age=15768000;path=/"; hide_CCOEKINFO_cookie_box(); } function hide_CCOEKINFO_cookie_box() { var cb = document.getElementById('CCOEKINFO_cookie_box'); if (cb) { cb.parentElement.removeChild(cb); } } (function () { var CCOEKINFO_cookie_box_viewed = (function (name) { var matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)")); return matches ? decodeURIComponent(matches[1]) : undefined; })('CCOEKINFO_cookie_box_viewed'); if (CCOEKINFO_cookie_box_viewed) { hide_CCOEKINFO_cookie_box(); } })(); </script> <!-- end cookie policy --> </body> </html>