semantics.txt 0.0.0 UTF-8 2024-01-29 *---|----1----|----2----|----3----|----4----|----5----|----6----|----7----|--* The Miser Project ================= FORMAL PHRASE-STRUCTURE SEMANTICS --------------------------------- BELOW IS ALL BOILERPLATE MATERIAL FOR REPURPOSING ================================================= Formalizations are employed to bridge from the structures of theoretical entities, particularly ‹ob›, to a corresponding formalization of the oFrugalese language to be processed and computationally-interpreted by oFrugal software. 1. FORMAL APPROACH For Miser, formal structures are used to express and reason about theoretical entities of different types, ‹ob› = 〈Ob,Of,Ot〉 at and ‹ba› = 〈Ba,Baf,Bat〉 ‹bp› = 〈Bp,Bpf,Bpt〉 at ‹ca› = 〈CA,{apply},CAt〉 at along with additional structures, such as ‹Z› that serve mathematical purposes and have computational interpretations via representation in structure ‹ob›. oFrugal provides a computational mechanism by which computational interpretations of ‹ob› formulations can be carried out using textual inputs, producing textual expressions of derived Obs. oFrugal text forms, oFrugalese scripts, are defined with a formal grammar. Formal rules for interpretation of oFrugalese are given as companions to the grammar rules, establishing oFrugalese semantics. The semantic are all in terms of ‹ob› constructions and application of the obaptheory.txt universal functions. Any canonical Ob determined in such interpretion is then presented as a textual result in CFob format, a subset of oFrugalese. (See .) In effect, oFrugal is an Ob calculator that evaluates applicative expressions written in oFrugalese and delivers simple expressions for any Obs that are determined as results. The oFrugalese grammar and interpretation of single applicative expressions is provided in file ob-exp.txt. The oFrugalese extensions for using the applicative expressions in computational scripts are defined in oFrugalese.txt. In this approach, the formal grammar and formal semantics (intepretation) do not specify any implementation in computer software. That is achieved for oFrugal by employing the approach defined in mindelay.txt. 2. BNF NOTATION FOR THE MISER PROJECT 3. MISER INTERPRETATION RULES FOR BNF GRAMMERS . **** CONTINUE REPURPOSING THE MATERIAL BELOW HERE **** Formal-grammar systems provide for precise specification of (usually-text) languages in terms of their syntactic structure. These can be used along with a formal semantics for all grammatically-valid statements, providing precise and rigorous determination of the intended meaning. This is part of nailing down computational models for precise realization in operational computer software. The derivation of a processor is specified in the file mindelay.txt. This note provides background and definitions that are exploited in establishing the formal grammar and interpretation of oFrugal texts. The specific grammar and interpretations are found in files ob-exp.txt and oFrugalese.txt in this folder. The scheme used by the parser is specifed in the file mindelay.txt. Together, taken along with the structure ‹ob› = 〈Ob,Of,Ot〉and the universal applicative functions, they provide a precise specification for an oFrugal reference implementation. 4. EXPRESSION INTERPRETATION ** Two things about choice of grammar. First, the desire to have a particular form that does not change the set of valid sentences but is more amenable to derivation of a syntax-oriented parser. The second is related to expedite the correspondence of phrase structures with the intended interpretations. These pragmatic and highly-practical maneuvers are unnecessary, in principle, but extremely valuable in practice. Interpretation of expressions as obs is accomplished using a special schema notation that specifies the Ot (‹ob› theory-language) expression interpretation of a given ob-exp text. The interpretation schemas have distinct form. ‼ category ⎾pattern⏋{parameter-list} =: interpretation where category is one of the syntactic categories, such as 〈ob-exp〉, 〈ae〉, and 〈term〉 pattern is one of the patterns for the particular category, such as 〈binary〉, 〈obap-form〉 〈ae-form〉, and 〈lindy〉 {parameter-list} is an optional form consisting of a list of one-or-more parameters interpretation is an obaptheory expression schema in which any parameter and "‼ category {parameter-list}" forms are in reference to category appearances in the pattern; parameters of the pattern {parameter-list} may occur as variables in the interpretation, including in further {parameter-list} forms. The obaptheory formulation in Ot, the theory language of structure ‹ob› = 〈Ob,Of,Ot〉, is available at . For example, ‼〈ae〉⎾〈obap-form〉 〈ae-form〉⏋{ℰ} =: obap.ap(‼〈obap-form〉{ℰ},‼〈ae-form〉{ℰ}) On the right-hand side of the "=:" the category names refer to those in the pattern on the left-hand side, and the interpretations of those occurrences is called for to determine the individual ob that is their evaluation. The parameter ℰ employed in many interpretations signifies the ob-exp environment, the means by which the current oFrugal set of bindings is used to resolve binding names and provide unknown-name forms otherwise. This is tied to interpretation of oFrugal statement-level syntax. Although the rules are tied directly to the forms of the grammar, the notation is relaxed to also describe interpretation of parsing stages. For example (cf. section 9), ‼〈ob-exp〉⎾ f g x ⏋{ℰ} =: ‼〈binary〉⎾ f g x ⏋{ℰ} =: ‼〈ae-form〉⎾ f g x ⏋{ℰ} =: obap.ap( ‼〈unary〉⎾ f ⏋{ℰ}, ‼〈ae-form〉⎾ g x ⏋{ℰ} ) =: obap.ap( ‼〈function-form〉⎾ f ⏋{ℰ}, ‼〈ae-form〉⎾ g x ⏋{ℰ} ) =: obap.ap( ‼〈term〉⎾ f ⏋{ℰ}, ‼〈ae-form〉⎾ g x ⏋{ℰ} ) =: obap.ap( f, ‼〈ae-form〉⎾ g x ⏋{ℰ} ) =: obap.ap( f, obap.ap(‼〈unary〉⎾ g ⏋{ℰ}, ‼〈ae-form〉⎾ x ⏋{ℰ} ) ) =: obap.ap( f, obap.ap( g, x) ) where lindies such as Ʃ'f', Ʃ'g', and Ʃ'x' are written as f, g, and x without ambiguity in these cases. We can also work out that ‼〈ob-exp〉⎾ f g x ⏋{ℰ} :=: ‼〈ob-exp〉⎾ f (g x) ⏋{ℰ} signifying that the interpretations are the same (i.e., equivalent), keeping in mind that the f, g, and x here are literals and not variables. While the equivalence doesn't hold under arbitrary substitutions for f, g, and x, the following can be established. ‼〈ob-exp〉⎾ 〈unary〉₁ 〈unary〉₂ 〈unary〉₃ ⏋{ℰ} :=: ‼〈ob-exp〉⎾ 〈unary〉₁ ( 〈unary〉₂ 〈unary〉₃ ) ⏋{ℰ} with the subscripts used to distinguish among 〈unary〉 occurrences, following [Knuth1968]. 10. NOTES AND REFERENCES [Knuth1968] Knuth, Donald E. Semantics of Context-Free Languages. Mathematical Systems Theory 2 (1968), 127-145. Errata Mathematical Systems Theory 5 (1971), 95-96. The semantic interpretations for oFrugalese are similar to those of Knuth's attribute grammars except that the arrangement remains context- free and cycles are generally not possible. In the oFrugal application, all well-formed inputs have semantics and there are no forward references, although there can be semantical context. In particular, binding names are always references to the nearest preceding bindings, if any, and the absence of a preceding binding is semantically acceptable. Pragmatically, there may be warning messages or even aborts of processing as an option. [Quine1981] Quine, Willard Van Orman. Mathematical Logic, Revised Edition. Harvard University Press (Cambridge, MA: 1940, 1981). ISBN 0-674-55451-5 pbk. Quasi-quotation is introduced in Section 6. Quine's devotion to the inspiration of [Whitehead1997], itself an outgrowth of Russell's inspiration in Euclid, foretells the further simplification of formal mathematical logic that has left behind the original notations and the hierarchies of types. In Chapter 7 on Syntax, the formal development of logic itself is undertaken. *---|----1----|----2----|----3----|----4----|----5----|----6----|----7----|--* Copyright 2018-2023 Dennis E. Hamilton Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *---|----1----|----2----|----3----|----4----|----5----|----6----|----7----|--* ATTRIBUTION Hamilton, Dennis E. Formal Phrase-Structure Semantics. Miser Project text file semantics.txt version 0.0.0 dated 2023-12-29, available on the Internet as a version of . TODO * Note that this is about grammar and the interpretation mechanism. It is not the grammar specification for oFrugal. That's a different matter. * Revealing examples are needed here. Grace Hopper favored that and I should heed it for that reason alone. [This applies more to ob-exp.txt and oFrugalese.txt though.] * Cite Quine for the quasi-quotation marks and also refer to the Wikipedia article, . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.0.0 2024-01-29T23:59Z Boilerplate from grammars.txt 0.1.0 *** end of cs/semantics.txt ***