]> matita.cs.unibo.it Git - helm.git/blob - helm/www/lambdadelta/web/home/osn.ldw.xml
- initial page for osn ...
[helm.git] / helm / www / lambdadelta / web / home / osn.ldw.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <page xmlns="http://lambdadelta.info/"
4       description = "\lambda\delta home page: Open Symbolic Notation"
5       title = "\lambda\delta home page: Open Symbolic Notation"
6       logo = "osn"
7       head = "Open Symbolic Notation"
8 >
9    <body>
10       Open Symbolic Notation, abbreviated OSN,
11       is an easy and flexible data-interchange text format
12       intended for the lightweight representation of
13       generic abstract syntax trees in the domain of formal languages.
14       In order to meet these design goals, OSN pursues the following features.
15    </body>
16    <list><style class="red-mark"><item><style class="alpha">
17       <link to="https://en.wikipedia.org/wiki/S-expression">Symbolic expressions</link>
18       based on widely accepted syntactical conventions
19       provide for a <notice text="lightweight"/> and <notice text="generic"/> grammar,
20       which is both <notice text="easy for machines to process"/>,
21       and <notice text="easy for humans to understand"/>.
22       As a mean to support <notice text="efficient"/> information processing,
23       OSN aims at an economic representation of data
24       contrary to <link to="http://www.w3.org/TR/2008/REC-xml-20081126/#sec-origin-goals">XML design goal 10</link>.
25       Compared to other data-interchange formats based on symbolic expressions,
26       like <link to="http://people.csail.mit.edu/rivest/Sexp.txt">canonical symbolic expressions</link>,
27       representing arbitrary data in binary format is a secondary concern in the design of OSN,
28       as well as the support for canonicalization.
29       Apparently, these features fall outside the scope of OSN,
30       which targets the data structures of <notice text="formal languages"/>. 
31    </style></item></style>
32    <newline/>
33    <style class="blue-mark"><item><style class="alpha">
34       Optionally <link to="https://en.wikipedia.org/wiki/Namespace">qualified</link> symbolic expressions 
35       allow OSN texts to mix data from different domains preserving their own semantics
36       because name conflicts can be avoided.
37       As a consequence OSN documents are <notice text="easy to extend"/> in that
38       domain-specific OSN applications can work as expected even if
39       data from different domains is added to the text they process.
40    </style></item></style>
41    <newline/>
42    <style class="green-mark"><item><style class="alpha">
43       The <link to="https://en.wikipedia.org/wiki/ASCII">US-ASCII</link> character set,
44       extended to <link to="http://www.utf-8.com/">UTF-8</link> in
45       free-form text strings for the convenience of human readers,
46       makes OSN documents <notice text="easy to visualize and transport"/> over communication media.
47       OSN design aims at supporting <notice text="application-independent"/> standard encodings.
48    </style></item></style></list>
49
50    <section6 name="grammar">Grammar</section6>
51
52    <body>
53       An OSN text uses the <link to="http://www.utf-8.com/">UTF-8</link> character set
54       and contains the next seven tokens that we define in a very common EBNF variant.
55       Characters not starting a token are not allowed.
56       The ones in the range U+0021 ... U+007E are ! # $ % &amp; * / ? @ \ ^ | ~
57       and are available for extensions of OSN.
58    </body>
59    <list><item>
60       This token can represent the identifiers and the numerical constants of most programming languages:
61       <newline/><ebnf>
62          <prod of="symbol"/> <def/> 
63             <plus/> <prod of="symbol-char"/>
64          <stop/> <newline/>
65          <prod of="symbol-char"/> <def/>
66             <str2 of="+"/> <or/> <str2 of="-"/> <or/> <str2 of="."/> <or/>
67             <str2 of="0"/> <etc/> <str2 of="9"/> <or/>
68             <str2 of="A"/> <etc/> <str2 of="Z"/> <or/>
69             <str2 of="_"/> <or/> <str2 of="`"/> <or/>
70             <str2 of="a"/> <etc/> <str2 of="z"/>
71          <stop/>
72       </ebnf>
73    </item><newline/><item>
74       This token contains free-form text with commonly accepted escape sequences:
75       <newline/><ebnf>
76          <prod of="string"/> <def/>
77             <str2 of="&quot;"/> <and/>
78             <star/> <open/>
79                <prod of="string-char"/> <or/>
80                <str1 of="'"/> <or/>
81                <str2 of="\"/> <prod of="escape"/>
82             <close/> <and/>
83             <str2 of="&quot;"/>
84          <stop/> <newline/>
85          <prod of="string-char"/> <def/>
86             <open/>
87                <xchr of="0"/> <etc/> <xchr of="10FFFF"/>
88             <close/> <but/> <open/>
89                <xchr of="0"/> <etc/> <xchr of="1F"/> <or/>
90                <str1 of="'"/> <or/> <str2 of="\"/> <or/>
91                <str2 of="&quot;"/> <or/> <xchr of="7F"/> 
92             <close/>
93          <stop/> <newline/>
94          <prod of="escape"/> <def/>
95             <plus/> <prod of="space"/> <or/>
96             <str2 of="&quot;"/> <or/> <str1 of="'"/> <or/>
97             <str2 of="("/> <or/> <str2 of=")"/> <or/>
98             <str2 of="0"/> <or/> <str2 of="\"/> <or/>
99             <str2 of="a"/> <or/> <str2 of="b"/> <or/>
100             <str2 of="e"/> <or/>
101             <str2 of="f"/> <or/> <str2 of="n"/> <or/>
102             <str2 of="r"/> <or/> <str2 of="t"/> <or/>
103             <open/>
104                <str2 of="u"/> <and/> <spec of="4"/> <prod of="hex"/>
105             <close/> <or/>
106             <str2 of="v"/> <or/>
107             <open/>
108                <str2 of="x"/> <and/> <spec of="2"/> <prod of="hex"/>
109             <close/>
110          <stop/> <newline/>
111          <prod of="space"/> <def/>
112             <xchr of="9"/> <etc/> <xchr of="D"/> <or/>
113             <xchr of="20"/>
114          <stop/> <newline/>            
115          <prod of="hex"/> <def/>
116             <str2 of="0"/> <etc/> <str2 of="9"/> <or/>
117             <str2 of="A"/> <etc/> <str2 of="F"/> <or/>
118             <str2 of="a"/> <etc/> <str2 of="f"/>
119          <stop/>
120       </ebnf>
121    </item><newline/><item>
122       This token is a widely used alternative of the former token:
123       <newline/><ebnf>
124          <prod of="string-alt"/> <def/>
125             <str1 of="'"/> <and/>
126             <star/> <open/>
127                <prod of="string-char"/> <or/>
128                <str2 of="&quot;"/> <or/>
129                <str2 of="\"/> <prod of="escape"/>
130             <close/> <and/>
131             <str1 of="'"/>
132          <stop/>
133       </ebnf>
134    </item><newline/><item>
135       This token separates the qualifiers of a symbolic expression:
136       <newline/><ebnf>
137          <prod of="sep"/> <def/> <str2 of=":"/> <stop/>
138       </ebnf>
139    </item><newline/><item>
140       This token starts a compound symbolic expression:
141       <newline/><ebnf>
142          <prod of="open"/> <def/>
143             <str2 of="("/> <or/> <str2 of="&lt;"/> <or/> <str2 of="["/> <or/> <str2 of="{"/>
144          <stop/>
145       </ebnf>
146    </item><newline/><item>
147       This token ends a compound symbolic expression:
148       <newline/><ebnf>
149          <prod of="close"/> <def/>
150             <str2 of=")"/> <or/> <str2 of="&gt;"/> <or/> <str2 of="]"/> <or/> <str2 of="}"/>
151          <stop/>
152       </ebnf>
153    </item><newline/><item>
154       This token is ignored and separates the other tokens:
155       <newline/><ebnf>
156          <prod of="gap"/> <def/>
157             <prod of="space"/> <or/>
158             <str2 of=","/> <or/> <str2 of=";"/> <or/> <str2 of="="/>
159          <stop/>
160       </ebnf>
161    </item></list>
162
163    <body>
164       The grammar of OSN is very liberal by design.
165       Spaces of the form <ebnf><plus/> <prod of="gap"/></ebnf> can appear between any pair of tokens.
166    </body>
167    <list><item>
168       An OSN text:
169       <newline/><ebnf>
170          <prod of="text"/> <def/>
171             <star/> <prod of="q-expr"/>
172          <stop/>
173       </ebnf>
174    </item><newline/><item>
175       A qualified symbolic expression:
176       <newline/><ebnf>
177          <prod of="q-expr"/> <def/>
178             <star/> <open/>
179                <prod of="symbol"/> <and/> <plus/> <prod of="sep"/>
180             <close/> <and/>
181             <prod of="expr"/>
182          <stop/>
183       </ebnf>
184    </item><newline/><item>
185       An unqualified symbolic expression:
186       <newline/><ebnf>
187          <prod of="expr"/> <def/>
188             <prod of="symbol"/> <or/>
189             <prod of="string"/> <or/>
190             <prod of="string-alt"/> <or/>
191             <open/>
192                <prod of="open"/> <and/>
193                <prod of="text"/> <and/>
194                <prod of="close"/> 
195             <close/>
196          <stop/>
197       </ebnf>
198    </item></list>
199
200    <section1 name="semantics">Semantics</section1>
201
202    <body>
203       Forthcoming ...
204    </body>
205 <!--
206       morover, the escape sequences \x &lt;two hexadecimal digits&gt; and \u &lt;four hexadecimal digits&gt;
207       allow to specify a character by its code point <newline/>
208       finally the escape sequences \( for U+0002 and \) for U+0003 are available
209 -->
210
211    <section5 name="implementation">Implementation</section5>
212
213    <body>
214       Forthcoming ...
215    </body>
216
217    <footer/>
218 </page>