transcend.xml
No OneTemporary

File Metadata

Created
Thu, Jul 9, 12:54 AM

transcend.xml

<?xml version="1.0" encoding="UTF-8"?>
<chapter version="5.1" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<?xxe-sn 2ajela3ur5s 7q?>
<title><?xxe-sn 2ajela3ur5s 7r?>Transcend</title>
<para><?xxe-sn 2ajela3ur5s 7s?>Transcend is a compilation phase and process
of reasoning about program in order to influence compilation.</para>
<para><?xxe-sn 2ajela3ur5s 7t?>First, compiler extracts <emphasis><?xxe-sn 2ajela3ur5s 7u?>annotations</emphasis>
from source code and other facts from number of sources to form a complete
<emphasis><?xxe-sn 2ajela3ur5s 7v?>logic program</emphasis>. Then, solver
processes logic program and outputs decisions that affect and control
compilation process in a number of ways.</para>
<section>
<?xxe-sn 2ajela3ur5s 7w?>
<title><?xxe-sn 2ajela3ur5s 7x?>Annotations' Syntax</title>
<para><?xxe-sn 2ajela3ur5s 7y?>Xreate's annotations comprise optional
supplementary information that is processed by compiler along with a
source code proper and able to affect compilation process. Annotations
have form of expressions that consist of following elements:</para>
<informaltable>
<?xxe-sn 2ajela3ur5s 7z?>
<tgroup cols="2">
<?xxe-sn 2ajela3ur5s 80?>
<colspec colwidth="183*"><?xxe-sn 2ajela3ur5s 81?></colspec>
<colspec colwidth="817*"><?xxe-sn 2ajela3ur5s 82?></colspec>
<tbody>
<?xxe-sn 2ajela3ur5s 83?>
<row>
<?xxe-sn 2ajela3ur5s 84?>
<entry><?xxe-sn 2ajela3ur5s 85?>Literals</entry>
<entry><?xxe-sn 2ajela3ur5s 86?>Strings, numbers. Example:
<code><?xxe-sn 2ajela3ur5s 87?>5, "success"</code></entry>
</row>
<row>
<?xxe-sn 2ajela3ur5s 88?>
<entry><?xxe-sn 2ajela3ur5s 89?>Predicates</entry>
<entry><?xxe-sn 2ajela3ur5s 8a?>Predicates have zero or more
arguments. Example: <code><?xxe-sn 2ajela3ur5s 8b?>final, status(broken), version("12.0.3", unstable)</code></entry>
</row>
<row>
<?xxe-sn 2ajela3ur5s 8c?>
<entry><?xxe-sn 2ajela3ur5s 8d?>Negation</entry>
<entry><?xxe-sn 2ajela3ur5s 8e?>Example: <code><?xxe-sn 2ajela3ur5s 8f?>-i12n, -access(allowed)</code></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para><?xxe-sn 2ajela3ur5s 8g?>Various Xreate's entities can be annotated.
At the time following entities are supported:</para>
<informaltable>
<?xxe-sn 2ajela3ur5s 8h?>
<tgroup cols="4">
<?xxe-sn 2ajela3ur5s 8i?>
<tbody>
<?xxe-sn 2ajela3ur5s 8j?>
<row>
<?xxe-sn 2ajela3ur5s 8k?>
<entry><?xxe-sn 2ajela3ur5s 8l?><link
xlink:href="#expression-and-identifiers"><?xxe-sn 2ajela3ur5s 8m?>Expressions
and Identifiers</link></entry>
<entry><?xxe-sn 2ajela3ur5s 8n?><link
xlink:href="#code-blocks-and-context"><?xxe-sn 2ajela3ur5s 8o?>Code
blocks and context</link></entry>
<entry><?xxe-sn 2ajela3ur5s 8p?><link
xlink:href="/w/syntax#functions"><?xxe-sn 2ajela3ur5s 8q?>Functions</link>
and <link xlink:href="/w/syntax#function-guards"><?xxe-sn 2ajela3ur5s 8r?>Function
Guards</link></entry>
<entry><?xxe-sn 2ajela3ur5s 8s?><link
xlink:href="/w/syntax/modules#module-annotations"><?xxe-sn 2ajela3ur5s 8t?>Modules</link></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<section>
<?xxe-sn 2ajela3ur5s 8u?>
<title><?xxe-sn 2ajela3ur5s 8v?>Expression and Identifiers</title>
<synopsis><?xxe-sn 2ajela3ur5s 8w?>SYNTAX:
//expression// **::** //type//**;** //annotation-list//.</synopsis>
<itemizedlist>
<?xxe-sn 2ajela3ur5s 8x?>
<listitem>
<?xxe-sn 2ajela3ur5s 8y?>
<para><?xxe-sn 2ajela3ur5s 8z?><emphasis><?xxe-sn 2ajela3ur5s 90?>type</emphasis>
expression's type</para>
</listitem>
<listitem>
<?xxe-sn 2ajela3ur5s 91?>
<para><?xxe-sn 2ajela3ur5s 92?><emphasis><?xxe-sn 2ajela3ur5s 93?>annotation-list</emphasis>
one or more annotation attached to the expression. Annotations are
delimited by semicolon</para>
</listitem>
</itemizedlist>
<para><?xxe-sn 2ajela3ur5s 94?>Example:</para>
<programlisting xml:id="Expressions1"><?xxe-sn 2ajela3ur5s 95?>name="tests/transcend.cpp: Transcend.Doc_Expressions1"
test = function:: int
{
x = 5:: int; arithmetic(fast). //annotation applied to an identifier
y = (x - 8:: int; arithm_optimization(off)) * 2:: float. //annotation applied to a nested expression
x+y
}</programlisting>
<note>
<?xxe-sn 2ajela3ur5s 96?>
<para><?xxe-sn 2ajela3ur5s 97?>For readability sake compound
statements(e.g. <link xlink:href="/w/syntax#loop-statements"><?xxe-sn 2ajela3ur5s 98?>loops</link>)
have different syntax for an annotations. See particular statement's
<link xlink:href="/w/syntax"><?xxe-sn 2ajela3ur5s 99?>syntax</link>
for details</para>
</note>
</section>
<section>
<?xxe-sn 2ajela3ur5s 9a?>
<title><?xxe-sn 2ajela3ur5s 9b?>Code Blocks and Context</title>
<synopsis><?xxe-sn 2ajela3ur5s 9c?>SYNTAX:
**context** :: //annotations-list//.</synopsis>
<itemizedlist>
<?xxe-sn 2ajela3ur5s 9d?>
<listitem>
<?xxe-sn 2ajela3ur5s 9e?>
<para><?xxe-sn 2ajela3ur5s 9f?><emphasis><?xxe-sn 2ajela3ur5s 9g?>annotations-list</emphasis>
List of annotation delimited by semicolon</para>
</listitem>
</itemizedlist>
<para><?xxe-sn 2ajela3ur5s 9h?>Code block annotations called
<emphasis><?xxe-sn 2ajela3ur5s 9i?>context</emphasis>. Keyword
<code><?xxe-sn 2ajela3ur5s 9j?>context</code> used to declare annotation
within enclosing code block.</para>
<para><?xxe-sn 2ajela3ur5s 9k?>Example:</para>
<programlisting xml:id="Codeblocks1"><?xxe-sn 2ajela3ur5s 9l?>name="tests/transcend.cpp: Transcend.Doc_Codeblocks1"
test = function:: int
{
context:: arithm_optimization(off).
x = 10 :: int.
2 * x - 16
}</programlisting>
</section>
<section>
<?xxe-sn 2ajela3ur5s 9m?>
<title><?xxe-sn 2ajela3ur5s 9n?>Special Annotations</title>
<para><?xxe-sn 2ajela3ur5s 9o?>There are some annotations in Xreate that
have special meaning</para>
<informaltable>
<?xxe-sn 2ajela3ur5s 9p?>
<tgroup cols="2">
<?xxe-sn 2ajela3ur5s 9q?>
<colspec colwidth="201*"><?xxe-sn 2ajela3ur5s 9r?></colspec>
<colspec colwidth="799*"><?xxe-sn 2ajela3ur5s 9s?></colspec>
<tbody>
<?xxe-sn 2ajela3ur5s 9t?>
<row>
<?xxe-sn 2ajela3ur5s 9u?>
<entry><?xxe-sn 2ajela3ur5s 9v?><code><?xxe-sn 2ajela3ur5s 9w?>entry</code></entry>
<entry><?xxe-sn 2ajela3ur5s 9x?>Specifies entry point of a
program. See <link xlink:href="/w/syntax#functions"><?xxe-sn 2ajela3ur5s 9y?>Function
Syntax</link></entry>
</row>
<row>
<?xxe-sn 2ajela3ur5s 9z?>
<entry><?xxe-sn 2ajela3ur5s a0?><code><?xxe-sn 2ajela3ur5s a1?>final</code></entry>
<entry><?xxe-sn 2ajela3ur5s a2?>Specifies fixed point of loop
statements. See <link
xlink:href="/w/syntax#loop-statement"><?xxe-sn 2ajela3ur5s a3?>Loop
Statement</link></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
<section>
<?xxe-sn 2ajela3ur5s a4?>
<title><?xxe-sn 2ajela3ur5s a5?>Annotations and Reasoning</title>
<para><?xxe-sn 2ajela3ur5s a6?>Annotations is a mechanism to express an
additional pieces of information and can occur in source code or
accompanying files. They are of declarative nature in a sense that they
express specific properties of and relations between different entities,
such as: identifiers, statements, code blocks, functions, modules or even
a whole program.</para>
<para><?xxe-sn 2ajela3ur5s a7?>Annotations are <emphasis><?xxe-sn 2ajela3ur5s a8?>facts</emphasis>
about source code provided by developer in explicit form. Beside
annotations there are other sources of information, e.g. implicit facts
that are automatically inferred by various analysis phases to express
useful insights regarding analysed code. Such pieces aren't exposed
directly to a developer but accessed and used internally at reasoning
phase along with annotations. All types of input are summed up
below:</para>
<informaltable>
<?xxe-sn 2ajela3ur5s a9?>
<tgroup cols="2">
<?xxe-sn 2ajela3ur5s aa?>
<colspec colwidth="287*"><?xxe-sn 2ajela3ur5s ab?></colspec>
<colspec colwidth="713*"><?xxe-sn 2ajela3ur5s ac?></colspec>
<tbody>
<?xxe-sn 2ajela3ur5s ad?>
<row>
<?xxe-sn 2ajela3ur5s ae?>
<entry><?xxe-sn 2ajela3ur5s af?>Explicit annotations in source
files</entry>
<entry><?xxe-sn 2ajela3ur5s ag?>Annotations provided by developer
in order to explicitly affect compilation</entry>
</row>
<row>
<?xxe-sn 2ajela3ur5s ah?>
<entry><?xxe-sn 2ajela3ur5s ai?>Code Analysis</entry>
<entry><?xxe-sn 2ajela3ur5s aj?>Different code analyses during
compilation provide information implicitly inferred from source
code</entry>
</row>
<row>
<?xxe-sn 2ajela3ur5s ak?>
<entry><?xxe-sn 2ajela3ur5s al?>Supervision</entry>
<entry><?xxe-sn 2ajela3ur5s am?>External facts that reflect
requirements, describe hardware and/or environment where
compilation takes place or program is supposed to work. There are
many supervision layers possible, from custom compiler's mode, to
OS- or computer- or even network-wide level. On other words,
supervision covers local or client supplied annotations</entry>
</row>
<row>
<?xxe-sn 2ajela3ur5s an?>
<entry><?xxe-sn 2ajela3ur5s ao?>Audit</entry>
<entry><?xxe-sn 2ajela3ur5s ap?>Third party supplied external
information that reflect additional software properties, e.g.
results of security audit</entry>
</row>
<row>
<?xxe-sn 2ajela3ur5s aq?>
<entry><?xxe-sn 2ajela3ur5s ar?>Reasoning rules</entry>
<entry><?xxe-sn 2ajela3ur5s as?>Reasoning infers additional facts
from pool of previously gathered information. It is done by using
<emphasis><?xxe-sn 2ajela3ur5s at?>resoning rules</emphasis> that
govern reasoning process</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<?xxe-sn 2ajela3ur5s au?>
<title><?xxe-sn 2ajela3ur5s av?>Why Annotations Matter</title>
<para><?xxe-sn 2ajela3ur5s aw?>This section goes through differences that
annotations have over traditional statements.</para>
<section>
<?xxe-sn 2ajela3ur5s ax?>
<title><?xxe-sn 2ajela3ur5s ay?>Extensible</title>
<para><?xxe-sn 2ajela3ur5s az?>Annotations are not a part of language
syntax and there is no predefined set of allowed annotations. Developer
is free to define and use custom annotations to express desired
properties without prior changes to compiler.</para>
<note>
<?xxe-sn 2ajela3ur5s b0?>
<para><?xxe-sn 2ajela3ur5s b1?>Yet there are several reserved
annotations that have specific meaning in Xreate. See <link
xlink:href="#special-annotations"><?xxe-sn 2ajela3ur5s b2?>special
annotations</link> for details.</para>
</note>
</section>
<section>
<?xxe-sn 2ajela3ur5s b3?>
<title><?xxe-sn 2ajela3ur5s b4?>Indicative Nature</title>
<para><?xxe-sn 2ajela3ur5s b5?>Unlike language statements that have well
defined compilation output, annotation do not. They are rather of
suggestive nature and actual impact depends on many factors. Annotations
comprise an input for a reasoning procedure that ultimately determines
how exactly influence compilation.</para>
</section>
<section>
<?xxe-sn 2ajela3ur5s b6?>
<title><?xxe-sn 2ajela3ur5s b7?>Cooperation</title>
<para><?xxe-sn 2ajela3ur5s b8?>Annotations are gathered from different
sources and this enables annotations to complement themselves. Compiler
blends in annotations originated from various sources seamlessly and
this allows to improve decisions quality.</para>
</section>
<section>
<?xxe-sn 2ajela3ur5s b9?>
<title><?xxe-sn 2ajela3ur5s ba?>External Sources and
Adaptability</title>
<para><?xxe-sn 2ajela3ur5s bb?>Annotations able to express not only
properties of program itself but also properties of local
environment(OS, computer, local network) where program is supposed to
run. Thus compiler operates information inaccessible during software
development and can't be reflected in the code otherwise. Compilation
can be adjusted to a particular environment and functioning mode.</para>
</section>
<section>
<?xxe-sn 2ajela3ur5s bc?>
<title><?xxe-sn 2ajela3ur5s bd?>Feedback</title>
<para><?xxe-sn 2ajela3ur5s be?>Traditionally software has a rigid
strictly defined hierarchical structure and interaction between
components. More precisely, let's look at client-service code model.
Service is done independently in order to work well with as wide as
possible set of different clients. Thus service is unaware of exact
characteristics of particular client code it works with. All burden of
complying with interaction specification lies on a client.</para>
<para><?xxe-sn 2ajela3ur5s bf?>However client may use only small subset
of service functionality or use it in specific and predictable order.
Generally speaking, service by having additional information on
particular client able to serve requests more efficiently in many
cases.</para>
<para><?xxe-sn 2ajela3ur5s bg?>It can be conceptualized as a
<emphasis><?xxe-sn 2ajela3ur5s bh?>feedback</emphasis> from a client.
Annotations is good candidate to express feedback to improve interaction
quality.</para>
</section>
<section>
<?xxe-sn 2ajela3ur5s bi?>
<title><?xxe-sn 2ajela3ur5s bj?>Resiliency</title>
<para><?xxe-sn 2ajela3ur5s bk?>As code grows and goes through multiple
reworks and rewrites many initial assumptions about the code and
relation between different parts change accordingly. Some implementation
details and approaches became outdated and code quality
deteriorates.</para>
<para><?xxe-sn 2ajela3ur5s bl?>DIfferent picture in case if code uses
annotations to express important properties. Any changes in underlying
code lead to a restart of reasoning procedure which adjust
implementation decisions to be still optimal in changed
environment.</para>
</section>
</section>
</chapter>

Event Timeline