No OneTemporary

File Metadata

Created
Mon, Feb 16, 1:18 AM
This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/config/default.json b/config/default.json
index 6cc02b4..90aa4c0 100644
--- a/config/default.json
+++ b/config/default.json
@@ -1,74 +1,74 @@
{
"containers": {
"id": {
"implementations": "containers_impl",
"linkedlist": "linkedlist"
},
"impl": {
"solid": "solid",
"onthefly": "on_the_fly"
}
},
"logging": {
"id": "logging"
},
"function-entry": "entry",
"transcend": {
"bindings" : {
"variable": "bind",
"function": "bind_func",
"scope": "bind_scope",
"function_demand" : "bind_function_demand",
"scope_decision": "bind_scope_decision"
},
"context" : {
"decisions":{
"dependent": "resolution_dependency"
}
},
"nonevalue": "nonevalue",
"ret": {
"symbol": "retv",
"tag": "ret"
}
},
"tests": {
"template": "documentation",
"templates": {
- "troubleshooting":"Loop.Doc_LoopLoopMap",
- "documentation":"Modules.Doc_*:Interpretation.Doc_*:AST.Doc_*:Loop.Doc_*",
+ "troubleshooting":"Transcend.Doc_*",
+ "documentation":"Modules.Doc_*:Interpretation.Doc_*:AST.Doc_*:Loop.Doc_*:LateReasoning.Doc_*:Latex.Doc_*:Polymorphs.Doc_*:Transcend.Doc_*",
"default": "*",
"ast": "AST.*",
"effects": "Effects.*",
"basic": "Attachments.*",
"compilation": "Compilation.*",
"communication": "Communication.*",
"cfa": "CFA.*",
"containers": "Containers.*",
"dfa": "DFA.*",
"diagnostic": "Diagnostic.*",
"dsl": "Association.*:Interpretation.*",
"exploitation": "Exploitation.*",
"ExpressionSerializer": "ExpressionSerializer.*",
"externc": "InterfaceExternC.*",
"loops": "Loop.*",
"latereasoning": "LateReasoning.*",
"latex": "Latex.*",
"modules": "Modules.*",
"polymorphs": "Polymorphs.*",
"intrinsic-query": "Types.SlaveTypes*:Association.TypedQuery*",
"types": "Types.*",
"virtualization": "Virtualization.*",
"vendorsAPI/clang": "ClangAPI.*",
- "vendorsAPI/xml2": "libxml2*"
+ "vendorsAPI/xml2": "libxml2.*"
}
}
}
diff --git a/cpp/src/analysis/DominatorsAnalysisProvider.cpp b/cpp/src/analysis/DominatorsAnalysisProvider.cpp
index 69f4b71..57b24f0 100644
--- a/cpp/src/analysis/DominatorsAnalysisProvider.cpp
+++ b/cpp/src/analysis/DominatorsAnalysisProvider.cpp
@@ -1,274 +1,284 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* File: DominatorsAnalysisProvider.cpp
* Author: pgess <v.melnychenko@xreate.org>
*
* Created on May 13, 2016, 11:39 AM
*/
/**
* \file DominatorsAnalysisProvider.h
* \brief Dominators Tree analysis
*/
#include "analysis/cfagraph.h"
#include "analysis/DominatorsAnalysisProvider.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/Support/GenericDomTreeConstruction.h"
#include "llvm/Support/GenericDomTree.h"
#include <list>
#include <iostream>
#include <boost/format.hpp>
using namespace std;
using namespace xreate;
using namespace boost;
using namespace boost::bimaps;
namespace xreate { namespace dominators {
struct CFAGraphAdapter;
struct ScopeNode {
ScopePacked id;
CFAGraphAdapter* parent;
std::list<ScopeNode*> nodesFrom;
std::list<ScopeNode*> nodesTo;
CFAGraphAdapter* getParent(){ return parent; }
void printAsOperand(llvm::raw_ostream&, bool) {}
ScopeNode(ScopePacked scope, CFAGraphAdapter* parentAdapter):
id(scope), parent(parentAdapter) {}
};
}
} //end of namespace xreate::dominators
namespace llvm {
using namespace xreate::dominators;
template<>
struct GraphTraits<ScopeNode*> {
typedef ScopeNode* NodeRef;
typedef std::list<ScopeNode*>::iterator ChildIteratorType;
static ChildIteratorType
child_begin(ScopeNode* node) {
return node->nodesTo.begin();
}
static ChildIteratorType
child_end(ScopeNode* node) {
return node->nodesTo.end();
}
};
template<>
struct GraphTraits<Inverse<ScopeNode*>>
{
typedef ScopeNode* NodeRef;
typedef std::list<ScopeNode*>::iterator ChildIteratorType;
static ChildIteratorType
child_begin(ScopeNode* node) {
return node->nodesFrom.begin();
}
static ChildIteratorType
child_end(ScopeNode* node) {
return node->nodesFrom.end();
}
};
template<>
struct GraphTraits<CFAGraphAdapter*> {
typedef std::list<ScopeNode*>::iterator nodes_iterator;
static nodes_iterator
nodes_begin(CFAGraphAdapter* graph) {
return graph->nodes.begin();
}
static nodes_iterator
nodes_end(CFAGraphAdapter* graph) {
return graph->nodes.end();
}
static ScopeNode*
getEntryNode(CFAGraphAdapter* F) {
return F->nodeRoot;
}
static unsigned int
size(CFAGraphAdapter* graph) {
return graph->nodes.size();
}
+
+ static nodes_iterator
+ child_begin(ScopeNode* node) {
+ return node->nodesTo.begin();
+ }
+
+ static nodes_iterator
+ child_end(ScopeNode* node) {
+ return node->nodesTo.end();
+ }
};
}
namespace xreate {
namespace dominators {
class DominatorTree : public llvm::DominatorTreeBase<ScopeNode, false> {
friend class DominatorsAnalysisProvider;
public:
DominatorTree() : llvm::DominatorTreeBase<ScopeNode, false>() {}
void
run(CFAGraphAdapter& program) {
recalculate(program);
updateDFSNumbers();
//extract dominators info
for(auto& entry : DomTreeNodes) {
if(!entry.getFirst()) continue;
dominators.emplace(entry.getFirst()->id, make_pair(entry.getSecond()->getDFSNumIn(), entry.getSecond()->getDFSNumOut()));
}
}
void
print(std::ostringstream& output, const std::string& atom) const {
boost::format formatAtom(atom+"(%1%, range(%2%, %3%)).");
for(auto entry : dominators) {
output<<formatAtom%(entry.first)%(entry.second.first)%(entry.second.second)
<<std::endl;
}
}
private:
DominatorsAnalysisProvider::Dominators dominators;
};
class PostDominatorTree : public llvm::DominatorTreeBase<ScopeNode, true> {
friend class DominatorsAnalysisProvider;
public:
PostDominatorTree() : llvm::DominatorTreeBase<ScopeNode, true>() {}
void
run(CFAGraphAdapter& program) {
recalculate(program);
updateDFSNumbers();
//extract dominators info
for(auto& entry : DomTreeNodes) {
if(!entry.getFirst()) continue;
dominators.emplace(entry.getFirst()->id, make_pair(entry.getSecond()->getDFSNumIn(), entry.getSecond()->getDFSNumOut()));
}
}
void
print(std::ostringstream& output, const std::string& atom) const {
boost::format formatAtom(atom+"(%1%, range(%2%, %3%)).");
for(auto entry : dominators) {
output<<formatAtom%(entry.first)%(entry.second.first)%(entry.second.second)
<<std::endl;
}
}
private:
DominatorsAnalysisProvider::Dominators dominators;
};
ScopeNode*
CFAGraphAdapter::registerScope(ScopePacked scope){
ScopeNode elemNew(scope, this);
auto fnComp = [](const ScopeNode* a, const ScopeNode* b){return a->id < b->id;};
auto posLowerBound = std::lower_bound(nodes.begin(), nodes.end(), &elemNew, fnComp);
if(posLowerBound==nodes.end()|| (*posLowerBound)->id > scope){
ScopeNode* elemNewP = new ScopeNode(elemNew);
*elemNewP = elemNew;
return *nodes.insert(posLowerBound, elemNewP);
}
return *posLowerBound;
}
CFAGraphAdapter*
CFAGraphAdapter::build(const cfa::CFAGraph* graph) {
return build(graph->__dependencyRelations);
}
CFAGraphAdapter*
CFAGraphAdapter::build(const std::multimap<ScopePacked, ScopePacked>& dataScopesOrder){
CFAGraphAdapter* tree=new CFAGraphAdapter();
enum NODE_MARK{NO_ROOT, POSSIBLE_ROOT};
std::unordered_map<unsigned int, NODE_MARK> nodeMarks;
for (const auto& edge: dataScopesOrder){
ScopeNode* nodeTo = tree->registerScope(edge.first);
ScopeNode* nodeFrom = tree->registerScope(edge.second);
nodeTo->nodesFrom.push_back(nodeFrom);
nodeFrom->nodesTo.push_back(nodeTo);
nodeMarks.emplace(edge.second, POSSIBLE_ROOT); //weak optional insert
auto result = nodeMarks.emplace(edge.first, NO_ROOT); //strong insert or update
if(!result.second){
result.first->second = NO_ROOT;
}
}
std::list<ScopePacked> nodeRoots;
for(auto nodeMark: nodeMarks){
if(nodeMark.second == POSSIBLE_ROOT) nodeRoots.push_back(nodeMark.first);
}
if(nodeRoots.size()>1){
ScopeNode* nodeGlobalRoot = tree->registerScope(SCOPE_ABSTRACT_GLOBAL);
for(auto rootLocal: nodeRoots){
ScopeNode* nodeLocalRoot = tree->registerScope(rootLocal);
nodeLocalRoot->nodesFrom.push_back(nodeGlobalRoot);
nodeGlobalRoot->nodesTo.push_back(nodeLocalRoot);
}
tree->nodeRoot = nodeGlobalRoot;
} else if (nodeRoots.size()==1){
tree->nodeRoot = tree->registerScope(nodeRoots.front());
} else {
ScopeNode* nodeGlobalRoot = tree->registerScope(SCOPE_ABSTRACT_GLOBAL);
tree->nodeRoot = nodeGlobalRoot;
}
return tree;
}
void
DominatorsAnalysisProvider::run(CFAGraphAdapter* program) {
treeForwardDominators.reset(new DominatorTree());
treePostDominators.reset(new PostDominatorTree());
treeForwardDominators->run(*program);
treePostDominators->run(*program);
}
void
DominatorsAnalysisProvider::print(std::ostringstream& output) const {
treeForwardDominators->print(output, "cfa_forwdom");
treePostDominators->print(output, "cfa_postdom");
}
const DominatorsAnalysisProvider::Dominators&
DominatorsAnalysisProvider::getForwardDominators() const {
return treeForwardDominators->dominators;
}
const DominatorsAnalysisProvider::Dominators&
DominatorsAnalysisProvider::getPostDominators() const {
return treePostDominators->dominators;
}
DominatorsAnalysisProvider::DominatorsAnalysisProvider() {}
DominatorsAnalysisProvider::~DominatorsAnalysisProvider() { }
}} //end of namespace xreate::dominators
diff --git a/cpp/src/analysis/dfagraph.cpp b/cpp/src/analysis/dfagraph.cpp
index ee076b6..aabc49a 100644
--- a/cpp/src/analysis/dfagraph.cpp
+++ b/cpp/src/analysis/dfagraph.cpp
@@ -1,244 +1,244 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* File: DFAGraph.h
* Author: pgess <v.melnychenko@xreate.org>
*
*/
/**
* \file dfagraph.h
* \brief Data Flow Analysis(DFA) graph data
*
*/
#include "analysis/dfagraph.h"
#include "analysis/utils.h"
using namespace std;
using namespace xreate::analysis;
namespace xreate { namespace dfa {
void
DFACallInstance::print(std::ostringstream& output) const{
boost::format formatArgs;
boost::format formatInstance("dfa_callfn(%1%, %2%).");
switch (type) {
case WEAK:
formatArgs = boost::format("weak(dfa_callargs(%1%, %2%, %3%)).");
break;
case STRONG:
formatArgs = boost::format("weak(dfa_callargs(%1%, %2%, %3%)).\ndfa_callargs(%1%, %2%, %3%).");
break;
}
output << formatInstance
% analysis::writeSymbolNode(retActual)
% fnName
<< endl;
for(std::pair<SymbolPacked, SymbolNode> rec: args) {
SymbolNode argFormal(rec.first);
output << formatArgs
% analysis::writeSymbolNode(retActual)
% analysis::writeSymbolNode(argFormal)
% analysis::writeSymbolNode(rec.second)
<< endl;
}
}
void
DFAGraph::addDependency(const SymbolNode& node, const SymbolNode& subnode){
__dependencies.emplace(node, subnode);
if (boost::get<SymbolPacked>(&node)){
__usedSymbols.insert(node);
}
if (boost::get<SymbolPacked>(&subnode)){
__usedSymbols.insert(node);
}
}
void
DFAGraph::printDependencies(std::ostringstream& output) const{
for(const SymbolNode& root: __roots){
printDependency(output, root, root);
}
}
void
DFAGraph::printDependency(std::ostringstream& output, const SymbolNode& nodeCurrent, const SymbolNode& nodeDependent) const {
auto range = __dependencies.equal_range(nodeCurrent);
for (auto it = range.first; it != range.second; ++it){
if (boost::get<SymbolAnonymous>(&it->second)){
if (!__usedSymbols.count(it->second)){
printDependency(output, it->second, nodeDependent);
continue;
}
}
boost::format formatDependency("dfa_depends(%1%, %2%).");
output << formatDependency
% analysis::writeSymbolNode(nodeDependent)
% analysis::writeSymbolNode(it->second)
<< endl;
printDependency(output, it->second, it->second);
}
}
void
DFAGraph::printInplaceAnnotation(const SymbolNode& node, const Expression& expression) {
// write down in-place expression tags:
boost::format formatBind("bind(%1%, %2%).");
__usedSymbols.insert(node);
for (const string& tag: xreate::analysis::compile(expression)) {
__output << formatBind
% analysis::writeSymbolNode(node)
% tag
<< endl;
}
}
void
DFAGraph::printLateAnnotation(const SymbolNode& node,
const Expression& expression,
- const std::list<latereasoning::LateSymbolRecognized>& symbols,
+ const std::list<latereasoning::LateParameter>& symbols,
const std::list<std::string>& domains){
boost::format formatLateAnnotation("late(%1%, (%2%), (%3%), %4%):- %5%.");
boost::format formatDom("%1%(%2%)");
std::list<std::string> exprSerialized = xreate::analysis::compile(expression);
assert(exprSerialized.size() == 1);
list<string> identSymbols, identNames, domainsSerialised;
auto domainI = domains.begin();
for(auto symbol: symbols){
identSymbols.push_back(analysis::writeSymbolNode(symbol.second).str());
identNames.push_back(symbol.first);
domainsSerialised.push_back((formatDom % *domainI % symbol.first).str());
++domainI;
}
__output << formatLateAnnotation
% analysis::writeSymbolNode(node)
% boost::algorithm::join(identSymbols, ", ")
% boost::algorithm::join(identNames, ", ")
% exprSerialized.front()
% boost::algorithm::join(domainsSerialised, "; ")
<< endl;
}
void
DFAGraph::printAlias(const SymbolNode& symbFormal, const SymbolNode& symbActual){
__usedSymbols.insert(symbFormal); __usedSymbols.insert(symbActual);
boost::format formatAlias("dfa_alias(%1%, %2%).");
__output << formatAlias
% analysis::writeSymbolNode(symbFormal)
% analysis::writeSymbolNode(symbActual)
<< endl;
}
void
DFAGraph::printWeakAlias(const SymbolNode& symbFormal, const SymbolNode& symbActual){
__usedSymbols.insert(symbFormal); __usedSymbols.insert(symbActual);
boost::format formatAlias("weak(dfa_alias(%1%, %2%)).");
__output << formatAlias
% analysis::writeSymbolNode(symbFormal)
% analysis::writeSymbolNode(symbActual)
<< endl;
}
void
DFAGraph::printFunctionRet(ManagedFnPtr function, const SymbolNode& symbolRet){
boost::format formatRet("dfa_fnret(%1%, %2%).");
__usedSymbols.insert(symbolRet);
__output << formatRet
% function->getName()
% analysis::writeSymbolNode(symbolRet)
<< endl;
__roots.insert(symbolRet);
}
void
DFAGraph::addCallInstance(DFACallInstance&& instance){
__usedSymbols.insert(instance.retActual);
for(const auto arg: instance.args){
__usedSymbols.insert(SymbolNode(arg.first));
__usedSymbols.insert(arg.second);
}
__callInstances.push_back(std::move(instance));
}
void
DFAGraph::print(std::ostringstream& output) const{
output << endl << "%\t\tStatic analysis: DFA" << endl;
//Dependencies
printDependencies(output);
//Add generated report
output << __output.str() << endl;
//Call instances
for(const DFACallInstance& instance: __callInstances){
instance.print(output);
}
output << endl;
}
void
DFAGraph::printSymbols(TranscendLayer* transcend){
boost::format formatHint("shint(%1%, \"%2%\").");
for (const SymbolNode& node : __usedSymbols) {
__output << "v(" << analysis::writeSymbolNode(node) << "). ";
if (const SymbolPacked* symbol = boost::get<SymbolPacked>(&node)){
__output << formatHint % analysis::writeSymbolNode(node) % transcend->getHintForPackedSymbol(*symbol);
}
__output << endl;
}
}
void
DFAGraph::printOperator(Operator op, std::list<SymbolNode>&& operands, int dataOpListSize){
std::string opStr;
switch(op){
case Operator::MAP: opStr = "map"; break;
case Operator::FOLD: opStr = "fold"; break;
case Operator::LIST: opStr = "list"; break;
case Operator::LIST_RANGE: opStr = "list_range"; break;
case Operator::INDEX: opStr = "index"; break;
default: assert(false);
}
std::ostringstream bufOperands;
for(const SymbolNode& operand: operands){
__usedSymbols.insert(operand);
bufOperands << analysis::writeSymbolNode(operand) << ", ";
}
if(op == Operator::LIST){
bufOperands << dataOpListSize << ", ";
}
boost::format formatOperator("ast_op_%1%(%2%).");
__output << (formatOperator % opStr % bufOperands.str().substr(0, bufOperands.str().size() - 2)) << endl;
}
}} //end of namespace xreate::dfa
diff --git a/cpp/src/analysis/dfagraph.h b/cpp/src/analysis/dfagraph.h
index dfe1859..d8817b0 100644
--- a/cpp/src/analysis/dfagraph.h
+++ b/cpp/src/analysis/dfagraph.h
@@ -1,66 +1,66 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* File: dfa.h
* Author: pgess <v.melnychenko@xreate.org>
*
* Created on June 27, 2016, 1:50 PM
*/
#ifndef DFA_H
#define DFA_H
#include "transcendlayer.h"
#include <unordered_set>
namespace xreate { namespace latereasoning {
- typedef std::pair<std::string, SymbolPacked> LateSymbolRecognized;
+ typedef std::pair<std::string, SymbolPacked> LateParameter;
}}
namespace xreate {namespace dfa {
enum DFACallInstanceType {
STRONG, WEAK
};
class DFACallInstance {
public:
std::string fnName;
std::vector<std::pair<SymbolPacked, SymbolNode>> args;
SymbolNode retActual;
DFACallInstanceType type;
void print(std::ostringstream& output) const;
};
/** \brief Holds DFA Analysis report produced by DFAPass */
class DFAGraph : public IAnalysisReport {
public:
// DFAGraph(TranscendLayer* engine): __transcend(engine){}
virtual void print(std::ostringstream& output) const override;
void addCallInstance(DFACallInstance && instance);
void addDependency(const SymbolNode& node, const SymbolNode& subnodeBlock);
void printInplaceAnnotation(const SymbolNode& node, const Expression& expression);
void printLateAnnotation(const SymbolNode& node, const Expression& expression,
- const std::list<latereasoning::LateSymbolRecognized>& symbols,
+ const std::list<latereasoning::LateParameter>& symbols,
const std::list<std::string>& domains);
void printAlias(const SymbolNode& symbFormal, const SymbolNode& symbActual);
void printWeakAlias(const SymbolNode& symbFormal, const SymbolNode& symbActual);
void printFunctionRet(ManagedFnPtr function, const SymbolNode& symbolRet);
void printDependencies(std::ostringstream& output) const;
void printSymbols(TranscendLayer* transcend);
void printOperator(Operator, std::list<SymbolNode>&& operands, int dataOpListSize = 0);
private:
mutable std::ostringstream __output;
std::list<DFACallInstance> __callInstances;
std::unordered_multimap<SymbolNode, SymbolNode> __dependencies;
std::unordered_set<SymbolNode> __usedSymbols;
std::unordered_set<SymbolNode> __roots;
void printDependency(std::ostringstream& output, const SymbolNode& nodeCurrent, const SymbolNode& nodeDependent) const;
};
}} // end of namespace xreate::dfa
#endif /* DFA_H */
diff --git a/cpp/src/pass/latereasoningpass.h b/cpp/src/pass/latereasoningpass.h
index 6a9cde0..3d293b1 100644
--- a/cpp/src/pass/latereasoningpass.h
+++ b/cpp/src/pass/latereasoningpass.h
@@ -1,182 +1,188 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/*
* Author: pgess <v.melnychenko@xreate.org>
* Created on June 7, 2018, 7:20 PM
*
* \file latereasoningpass.h
* \brief latereasoningpass
*/
#ifndef LATEREASONINGPASS_H
#define LATEREASONINGPASS_H
#include "pass/dfapass.h"
namespace xreate { namespace latereasoning {
class LateReasoningScope{
public:
LateReasoningScope(LateReasoningScope* parent): __parent(parent){ }
- boost::optional<LateSymbolRecognized>
+ boost::optional<LateParameter>
recognizeIdentifier(const std::string& identifier){
//Search identifier in the current scope
if(__identifiers.count(identifier)){
return make_pair(identifier, __identifiers.at(identifier));
}
//Search in the parent scope
if(__parent){
return __parent->recognizeIdentifier(identifier);
}
return boost::none;
}
void
addIdentifier(std::string idenName, const SymbolPacked& identSymbol){
__identifiers.emplace(idenName, identSymbol);
}
private:
std::map<std::string, SymbolPacked> __identifiers;
LateReasoningScope *__parent;
};
/**
* \note Limitation: Produces late annotation with target as a symbol to which annotation is attached
*/
template<class Parent>
class LateReasoningDFAPassDecorator: public Parent{
public:
LateReasoningDFAPassDecorator(PassManager* manager): Parent(manager){ }
void
registerLateScope(CodeScope* scope, LateReasoningScope* scopeLate){
__dictScopes.emplace(scope, scopeLate);
}
private:
LateReasoningScope*
liftScope(const CodeScope* scope){
while(scope){
if(__dictScopes.count(scope)) return __dictScopes.at(scope);
scope = scope->__parent;
}
return nullptr;
}
- std::list<LateSymbolRecognized>
- recognizeLateIdentifiers(const Expression& expression, LateReasoningScope* scope){
- std::list<LateSymbolRecognized> result;
+ std::list<LateParameter>
+ recognizeLateParameters(const Expression& expression, LateReasoningScope* scope){
+ std::list<LateParameter> result;
switch(expression.op){
case Operator::CALL:
{
for(const auto& op: expression.operands){
- std::list<LateSymbolRecognized> opResult = recognizeLateIdentifiers(op, scope);
+ std::list<LateParameter> opResult = recognizeLateParameters(op, scope);
result.insert(result.end(), opResult.begin(), opResult.end());
}
if(!expression.operands.size()){
if(auto symbolRecognized = scope->recognizeIdentifier(expression.getValueString())){
result.push_back(*symbolRecognized);
}
}
break;
}
case Operator::NEG:
{
assert(expression.operands.size() == 1);
const Expression &op = expression.operands.at(0);
- std::list<LateSymbolRecognized> opResult = recognizeLateIdentifiers(op, scope);
+ std::list<LateParameter> opResult = recognizeLateParameters(op, scope);
result.insert(result.end(), opResult.begin(), opResult.end());
};
case Operator::INVALID:
{
switch(expression.__state){
case Expression::NUMBER:
break;
default:
assert(true);
}
break;
}
default: break;
}
return result;
}
protected:
virtual SymbolNode process(const Expression& expression, PassContext context, const std::string& varDecl="") override{
if(expression.__state == Expression::COMPOUND && expression.op == Operator::SWITCH_LATE){
//Reserve late scope:
LateReasoningScope* scopeLate = new LateReasoningScope(liftScope(context.scope));
CodeScope* scopeBody = expression.blocks.front();
registerLateScope(scopeBody, scopeLate);
- //Assign late identifiers
for(const std::string& identLate: expression.bindings){
ScopedSymbol identLateS = scopeBody->getSymbol(identLate);
SymbolPacked identLateSP = Parent::man->transcend->pack(Symbol{identLateS, scopeBody});
+
+ scopeLate->addIdentifier(identLate, identLateSP); //Assign late identifiers
- scopeLate->addIdentifier(identLate, identLateSP);
+ //Assign type(if isn't provided by user)
+ Expression identE = scopeBody->getDefinition(identLateS);
+ if (!identE.type.isValid()){
+ Expression sourceE = expression.getOperands().at(0);
+ Attachments::put<TypeInferred>(Symbol{identLateS, scopeBody}, Parent::man->root->getType(sourceE));
+ }
}
}
return Parent::process(expression, context, varDecl);
}
virtual void
processAnnotations(const Expression& expression,
PassContext context,
const SymbolNode& ident){
LateReasoningScope* scopeLate = liftScope(context.scope);
- if(!expression.tags.size() || !scopeLate)
- return Parent::processAnnotations(expression, context, ident);
+ if(!expression.tags.size()) {return Parent::processAnnotations(expression, context, ident);}
+ if(!scopeLate) {return Parent::processAnnotations(expression, context, ident);}
for(const std::pair<std::string, Expression>& tag: expression.tags){
- std::list<LateSymbolRecognized> symbols = recognizeLateIdentifiers(tag.second, scopeLate);
- if(!symbols.size()){
+ std::list<LateParameter> argsLate = recognizeLateParameters(tag.second, scopeLate);
+ if(!argsLate.size()){
//Standard compilation
Parent::graph->printInplaceAnnotation(ident, tag.second);
} else{
//Late compilation
std::list<std::string> domains;
- for(const auto& symbol: symbols){
- Symbol symbolUnpacked = Parent::man->transcend->unpack(symbol.second);
+ for(const auto& arg: argsLate){
+ Symbol symbolUnpacked = Parent::man->transcend->unpack(arg.second);
ExpandedType typSymbol = Parent::man->root->getType(CodeScope::getDefinition(symbolUnpacked));
assert(typSymbol->__operator == TypeOperator::SLAVE);
domains.push_back(typSymbol->__valueCustom);
}
- Parent::graph->printLateAnnotation(ident, tag.second, symbols, domains);
+ Parent::graph->printLateAnnotation(ident, tag.second, argsLate, domains);
}
}
}
private:
std::unordered_map<const CodeScope*, LateReasoningScope*> __dictScopes;
};
}}
#endif /* LATEREASONINGPASS_H */
diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt
index 2d220d4..ee87e1a 100644
--- a/cpp/tests/CMakeLists.txt
+++ b/cpp/tests/CMakeLists.txt
@@ -1,56 +1,57 @@
cmake_minimum_required(VERSION 2.8.11)
project(xreate-tests)
find_package(GTest REQUIRED)
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
INCLUDE_DIRECTORIES("/usr/include/libxml2")
INCLUDE_DIRECTORIES($<TARGET_PROPERTY:xreate,INCLUDE_DIRECTORIES>)
# TESTS
#=========================
FIND_PACKAGE (LLVM REQUIRED)
message("LLVM_LIBRARY_DIRS: " ${LLVM_LIBRARY_DIRS})
link_directories(${LLVM_LIBRARY_DIRS})
set (LIBCLASP_PATH ${POTASSCO_PATH}/build/debug)
link_directories(${LIBCLASP_PATH})
#aux_source_directory(. TEST_FILES)
set(TEST_FILES
+ supplemental/docutils
+ latetranscend.cpp
cfa.cpp
latex.cpp
polymorph.cpp
transcend.cpp
-# latereasoning.cpp
virtualization.cpp
exploitation.cpp
effects-communication.cpp
association.cpp
main.cpp
modules.cpp
attachments.cpp
ast.cpp
dfa.cpp
compilation.cpp
ExpressionSerializer.cpp
externc.cpp
types.cpp
#vendorsAPI/clangAPI.cpp
- #vendorsAPI/xml2.cpp
+ vendorsAPI/xml2.cpp
#vendorsAPI/json.cpp
containers.cpp
interpretation.cpp
loops.cpp
#supplemental/versions-algorithm-data_dependency.cpp
effects-versions.cpp
)
add_executable(${PROJECT_NAME} ${TEST_FILES})
target_link_libraries(${PROJECT_NAME} xreate ${GTEST_LIBRARIES} pthread xml2 gcov)
add_custom_target (coverage
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/src/code-coverage.sh
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
diff --git a/cpp/tests/ast.cpp b/cpp/tests/ast.cpp
index 65f5c69..ab020ca 100644
--- a/cpp/tests/ast.cpp
+++ b/cpp/tests/ast.cpp
@@ -1,170 +1,205 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*
* ast.cpp
*
* Created on: Jun 11, 2015
* Author: pgess <v.melnychenko@xreate.org>
*/
-#include "gtest/gtest.h"
+
+#include "supplemental/docutils.h"
#include "xreatemanager.h"
#include "main/Parser.h"
+#include "gtest/gtest.h"
+
using namespace std;
using namespace xreate;
using namespace xreate::grammar::main;
-TEST(AST, Containers1){
- FILE* input = fopen("scripts/containers/Containers_Implementation_LinkedList1.xreate","r");
- Scanner scanner(input);
- Parser parser(&scanner);
- parser.Parse();
- assert(!parser.errors->count && "Parser errors");
+TEST(AST, Containers1) {
+ FILE* input = fopen("scripts/containers/Containers_Implementation_LinkedList1.xreate", "r");
+ Scanner scanner(input);
+ Parser parser(&scanner);
+ parser.Parse();
+ assert(!parser.errors->count && "Parser errors");
- fclose(input);
+ fclose(input);
}
TEST(AST, InterfacesDataCFA) {
- XreateManager* man = XreateManager::prepare
- ("interface(cfa){\n"
- " operator map :: annotation1.\n"
- "}");
+ XreateManager* man = XreateManager::prepare
+ ("interface(cfa){\n"
+ " operator map :: annotation1.\n"
+ "}");
- auto answer = man->root->__interfacesData.equal_range(CFA);
- EXPECT_EQ(1, std::distance(answer.first, answer.second));
+ auto answer = man->root->__interfacesData.equal_range(CFA);
+ EXPECT_EQ(1, std::distance(answer.first, answer.second));
- Expression&& scheme = move(answer.first->second);
+ Expression&& scheme = move(answer.first->second);
- EXPECT_EQ(Operator::MAP, scheme.op);
- EXPECT_EQ("annotation1", scheme.getOperands().at(0).getValueString());
+ EXPECT_EQ(Operator::MAP, scheme.op);
+ EXPECT_EQ("annotation1", scheme.getOperands().at(0).getValueString());
}
-TEST(AST, syntax_recognizeIdentifiers){
- XreateManager* man = XreateManager::prepare(R"Code(
+TEST(AST, syntax_recognizeIdentifiers) {
+ XreateManager* man = XreateManager::prepare(R"Code(
test= function(a:: num):: num; entry {
a = b:: int.
b = 8:: int.
a
}
)Code");
}
-TEST(AST, syntax_operatorIndex){
- XreateManager* man = XreateManager::prepare(R"Code(
+TEST(AST, syntax_operatorIndex) {
+ XreateManager* man = XreateManager::prepare(R"Code(
test= function(a:: num):: num; entry {
b = a[1].
b
}
)Code");
}
-TEST(AST, Variants_switch){
-XreateManager* man = XreateManager::prepare(R"Code(
+TEST(AST, Variants_switch) {
+ XreateManager* man = XreateManager::prepare(R"Code(
Color = type variant{Blue, White, Green}.
main = function:: int {
x = White()::Color.
switch variant(x)::int
case (Green) {0}
case (White) {1}
case (Blue){2}
}
)Code");
- Expression e= man->root->findFunction("main")->getEntryScope()->getBody();
- ASSERT_EQ(4, e.getOperands().size());
- ASSERT_EQ(3, e.blocks.size());
-}
-
-TEST(AST, DISABLED_InterfacesDataDFA){
-
+ Expression e = man->root->findFunction("main")->getEntryScope()->getBody();
+ ASSERT_EQ(4, e.getOperands().size());
+ ASSERT_EQ(3, e.blocks.size());
}
-TEST(AST, DISABLED_InterfacesDataExtern){
+TEST(AST, DISABLED_InterfacesDataDFA) { }
-}
+TEST(AST, DISABLED_InterfacesDataExtern) { }
-TEST(AST, Doc_LiteralsAndExpressions){
- XreateManager* man = XreateManager::prepare(
+TEST(AST, Doc_LiteralsAndExpressions) {
+ XreateManager* man = XreateManager::prepare(
R"Code(
Record1 = type {year:: int, month:: string}.
isOdd = function(x :: int) :: bool {true}
test = function:: bool; entry {
x1 = 5 :: int.
x2 = "Nimefurahi kukujua":: string.
x3 = {year = 1934, month = "april"}:: Record1.
x4 = {16, 8, 3} :: [int].
x5 = 8>=3:: bool.
x6 = "Blue" <> "Green" :: bool.
colors = {"Green", "Blue"} :: [string].
color = colors[0] :: string.
date = {year = 1934, month = "april"}:: Record1. year = date["year"] :: int.
a = 0::int. b = 0 :: int.
x7 = a - b:: int.
result = isOdd(6) :: bool.
true
}
)Code");
- ASSERT_TRUE(true);
+ ASSERT_TRUE(true);
}
-TEST(AST, Doc_CodeBlocks){
- XreateManager* man = XreateManager::prepare(
- R"Code(
- test = function:: int; entry {
- a = 10:: int.
- b = 2:: int.
-
- a + b:: int
- }
+TEST(AST, Doc_CodeBlocks1) {
+ XreateManager* man = XreateManager::prepare(
+ getDocumentationExampleById("documentation/Syntax/syntax.xml", "CodeBlocks1"));
- )Code");
-
- ASSERT_TRUE(true);
+ ASSERT_TRUE(true);
}
-TEST(AST, Doc_Functions){
- XreateManager* man = XreateManager::prepare(
- R"Code(
+TEST(AST, Doc_Functions1) {
+ XreateManager* man = XreateManager::prepare(
+ getDocumentationExampleById("documentation/Syntax/syntax.xml", "Functions1"));
- sum = function(x:: int, y:: int):: int; entry; status(needs_review)
- {
- x+y
- }
+ ASSERT_TRUE(true);
+}
- )Code");
+TEST(AST, Doc_FunctionSpecializations1) {
+ XreateManager* man = XreateManager::prepare(
+ getDocumentationExampleById("documentation/Syntax/syntax.xml", "FunctionSpecialization1"));
- ASSERT_TRUE(true);
+ ASSERT_TRUE(true);
}
-TEST(AST, Doc_BranchStatements){
- XreateManager* man = XreateManager::prepare(
+TEST(AST, Doc_BranchStatements) {
+ string code_IfStatement1 = getDocumentationExampleById("documentation/Syntax/syntax.xml", "IfStatement1");
+ string code_SwitchStatement1 = getDocumentationExampleById("documentation/Syntax/syntax.xml", "SwitchStatement1");
+
+ string code =
R"Code(
+test = function:: int; entry
+{
+ question = "Favorite color?":: string.
+ monthNum = 2:: int.
- test = function:: int; entry
- {
- question = "Favorite color?":: string.
- answer = if (question == "Favorite color?"):: string
- {"Yellow"} else {"Don't know"}.
+ %IfStatement1
+ %SwitchStatement1
- monthNum = 2 :: int.
- monthName = switch(monthNum) :: string
- case (1) {"Jan"}
- case (2) {"Feb"}
- case default {"Strange.. Don't know this month"}.
+ monthName
+}
+ )Code";
+ replace(code, "%IfStatement1", code_IfStatement1);
+ replace(code, "%SwitchStatement1", code_SwitchStatement1);
- {answer, monthName}
- }
+ XreateManager* man = XreateManager::prepare(move(code));
- )Code");
+ ASSERT_TRUE(true);
+}
+
+TEST(AST, Doc_LoopStatements) {
+ string code_LoopStatement1 = getDocumentationExampleById("documentation/Syntax/syntax.xml", "LoopStatement1");
+ string code_LoopStatement2 = getDocumentationExampleById("documentation/Syntax/syntax.xml", "LoopStatement2");
+ string code_FoldStatement1 = getDocumentationExampleById("documentation/Syntax/syntax.xml", "FoldStatement1");
+ string code_MapStatement1 = getDocumentationExampleById("documentation/Syntax/syntax.xml", "MapStatement1");
+
+ string code =
+ R"Code(
+test = function:: int; entry
+{
+ %LoopStatement1
+ %LoopStatement2
+ %FoldStatement1
+ %MapStatement1
+
+ min
+}
+ )Code";
+
+ replace(code, "%LoopStatement1", code_LoopStatement1);
+ replace(code, "%LoopStatement2", code_LoopStatement2);
+ replace(code, "%FoldStatement1", code_FoldStatement1);
+ replace(code, "%MapStatement1", code_MapStatement1);
+ replace(code, "COUNTEREXAMPLE", "");
+ XreateManager::prepare(move(code));
+
+ ASSERT_TRUE(true);
+}
- ASSERT_TRUE(true);
+TEST(AST, Doc_Types){
+ string code = getDocumentationExampleById("documentation/Syntax/syntax.xml", "Types1");
+ XreateManager::prepare(move(code));
+
+ ASSERT_TRUE(true);
}
+
+TEST(AST, Doc_Variants){
+ string code_Variants1 = getDocumentationExampleById("documentation/Syntax/syntax.xml", "Variants1");
+ XreateManager::prepare(move(code_Variants1));
+
+ ASSERT_TRUE(true);
+}
\ No newline at end of file
diff --git a/cpp/tests/cfa.cpp b/cpp/tests/cfa.cpp
index fff0a97..472e186 100644
--- a/cpp/tests/cfa.cpp
+++ b/cpp/tests/cfa.cpp
@@ -1,248 +1,223 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*
* cfa.cpp
*
* Created on: Jul 17, 2015
* Author: pgess <v.melnychenko@xreate.org>
*/
#include "xreatemanager.h"
#include "pass/dfapass.h"
#include "pass/cfapass.h"
#include "analysis/DominatorsAnalysisProvider.h"
#include "analysis/cfagraph.h"
#include "pass/compilepass.h"
#include "compilation/scopedecorators.h"
#include "gtest/gtest.h"
#include "aux/xreatemanager-decorators.h"
#include <boost/scoped_ptr.hpp>
#include <boost/smart_ptr/scoped_array.hpp>
#include <boost/format.hpp>
using namespace xreate;
using namespace xreate::cfa;
using namespace std;
TEST(CFA, testFunctionAnnotations) {
string&& program =
"f2 = function::int; annotationF2 {\n"
" 0\n"
"}\n"
"\n"
"f1 = function:: int; entry; annotationF1 {\n"
" f2() + 10\n"
"}";
details::tier1::XreateManager* man = details::tier1::XreateManager::prepare(move(program));
man->analyse();
StaticModel answer = man->transcend->query("annotationF1");
EXPECT_EQ(1, answer.size());
answer = man->transcend->query("annotationF2");
EXPECT_EQ(1, answer.size());
}
TEST(CFA, testLoopContextExists) {
details::tier1::XreateManager* man = details::tier1::XreateManager::prepare (
"interface(cfa){\n"
" operator fold:: annotation1.\n"
"}\n"
"\n"
"main = function:: int; entry {\n"
" x = [1..10]:: [int].\n"
" sum = loop fold (x->el:: int, 0->sum):: int {\n"
" el + sum + f1()\n"
" }. \n"
" sum\n"
"}"
"guard:: annotation1 {"
" f1 = function::int {\n"
" x = 0:: int. "
" x\n"
" }"
"}"
);
man->analyse();
StaticModel model = man->transcend->query("annotation1");
ScopePacked scopeIdActual = std::get<0>(TranscendLayer::parse<ScopePacked>(model.begin()->second));
CodeScope* scopeEntry = man->root->findFunction("main")->getEntryScope();
const Expression& exprSum = scopeEntry->getDefinition(scopeEntry->getSymbol("sum"));
CodeScope* scopeExpected = exprSum.blocks.front();
ScopePacked scopeIdExpected = man->transcend->pack(scopeExpected);
ASSERT_EQ(scopeIdExpected, scopeIdActual);
}
TEST(CFA, DependenciesFnCall) {
details::tier2::XreateManager* man = details::tier2::XreateManager::prepare(
R"Code(
a = function::int{
seq
{x = 0:: int. x}
{x = b():: int. x}::int
}
b = function::int {y = 0. y}
)Code");
CodeScope* scopeSeq1 = man->root->findFunction("a")->getEntryScope()->getBody().blocks.front();
CodeScope* scopeSeq2 = *(++man->root->findFunction("a")->getEntryScope()->getBody().blocks.begin());
CodeScope* scopeB = man->root->findFunction("b")->getEntryScope();
ScopePacked psSeq1 = man->transcend->pack(scopeSeq1);
ScopePacked psSeq2 = man->transcend->pack(scopeSeq2);
ScopePacked psB = man->transcend->pack(scopeB);
CFAPass* pass = new CFAPass(man);
man->registerPass(pass, PassId::CFAPass);
man->executePasses();
const CFAGraph* report = dynamic_cast<CFAPassBasic*> (man->getPassById(PassId::CFAPass))->getReport();
auto dependencies = report->__dependencyRelations;
delete pass;
ASSERT_EQ(1, dependencies.count(psSeq2));
ASSERT_EQ(1, dependencies.count(psB));
}
TEST(CFA, DependenciesChildScope) {
details::tier2::XreateManager* man = details::tier2::XreateManager::prepare(
R"Code(
a = function::int{
seq
{x = 0:: int. x}
{x=0::int. if(x>0)::int{1} else {0}}::int
}
)Code");
CodeScope* scopeSeq1 = man->root->findFunction("a")->getEntryScope()->getBody().blocks.front();
CodeScope* scopeSeq2 = *(++man->root->findFunction("a")->getEntryScope()->getBody().blocks.begin());
CodeScope* scopeIf1 = scopeSeq2->getBody().blocks.front();
CodeScope* scopeIf2 = *(++scopeSeq2->getBody().blocks.begin());
ScopePacked psSeq1 = man->transcend->pack(scopeSeq1);
ScopePacked psSeq2 = man->transcend->pack(scopeSeq2);
ScopePacked psIf1 = man->transcend->pack(scopeIf1);
ScopePacked psIf2 = man->transcend->pack(scopeIf2);
CFAPass* pass = new CFAPass(man);
man->registerPass(pass, PassId::CFAPass);
man->executePasses();
const CFAGraph* report = dynamic_cast<CFAPassBasic*> (man->getPassById(PassId::CFAPass))->getReport();
auto dependencies = report->__dependencyRelations;
delete pass;
ASSERT_EQ(0, dependencies.count(psSeq1));
ASSERT_EQ(1, dependencies.count(psSeq2));
ASSERT_EQ(1, dependencies.count(psIf1));
ASSERT_EQ(1, dependencies.count(psIf2));
for(auto rec : dependencies) {
std::cout << rec.first << " " << rec.second << std::endl;
}
}
TEST(CFA, Dominators1){
std::multimap<ScopePacked, ScopePacked> dataScopes = {
{1, 0}, {2, 0}, {3, 1}, {4, 1}, {4, 2}
};
dominators::DominatorsAnalysisProvider domProvider;
boost::scoped_ptr<dominators::CFAGraphAdapter> adapter(dominators::CFAGraphAdapter::build(dataScopes));
domProvider.run(adapter.get());
dominators::DominatorsAnalysisProvider::Dominators expectedFDom= {
{0, {0, 9}}
,{1, {1, 4}}
,{2, {7, 8}}
,{3, {2, 3}}
,{4, {5, 6}}
};
dominators::DominatorsAnalysisProvider::Dominators expectedPostDom= {
{0, {5, 6}}
,{1, {3, 4}}
,{2, {8, 9}}
,{3, {1, 2}}
,{4, {7, 10}}
};
ASSERT_EQ(expectedFDom, domProvider.getForwardDominators());
ASSERT_EQ(expectedPostDom, domProvider.getPostDominators());
}
TEST(CFA, Dominators2) {
std::string program =
R"CODE(
a = function:: int; entry{
seq
{x = 0:: int. x}
{x = 1:: int. x}::int
}
)CODE";
std::unique_ptr<details::tier2::XreateManager> man(details::tier2::XreateManager::prepare(move(program)));
CFAPass* pass = new CFAPass(man.get());
man->registerPass(pass, PassId::CFAPass);
pass->run();
ScopePacked scope1 = man->transcend->pack(man->root->findFunction("a")->getEntryScope()->getBody().blocks.front());
ScopePacked scope2 = man->transcend->pack(*++man->root->findFunction("a")->getEntryScope()->getBody().blocks.begin());
dominators::DominatorsAnalysisProvider* providerDomAnalysis = new dominators::DominatorsAnalysisProvider();
boost::scoped_ptr<dominators::CFAGraphAdapter> adapter(dominators::CFAGraphAdapter::build(pass->getReport()));
providerDomAnalysis->run(adapter.get());
dominators::DominatorsAnalysisProvider::Dominators expectedFDom = {
{1, {0, 3}},
{2, {1, 2}}
};
dominators::DominatorsAnalysisProvider::Dominators expectedPostDom = {
{2, {1, 4}},
{1, {2, 3}}
};
auto actualFDom = providerDomAnalysis->getForwardDominators();
auto actualPostDom = providerDomAnalysis->getPostDominators();
ASSERT_EQ(expectedFDom, actualFDom);
ASSERT_EQ(expectedPostDom, actualPostDom);
delete providerDomAnalysis;
delete pass;
}
-
-TEST(CFA, ASTCorrespondence_Scope_Bindings_1){
- std::string program =
-R"CODE(
- test = function(x::int, y::int):: int; entry{
- x + y
- }
-)CODE";
-
- std::unique_ptr<details::tier2::XreateManager> man(details::tier2::XreateManager::prepare(move(program)));
- CFAPass* pass = new CFAPass(man.get());
- man->registerPass(pass, PassId::CFAPass);
- man->executePasses();
-
- testing::internal::CaptureStdout();
- man->analyse();
- std::string outputActual = testing::internal::GetCapturedStdout();
- cout << outputActual << endl;
-
- string outputExpected = "ast_scope_binding(0,0,\"x\")";
- ASSERT_NE(std::string::npos, outputActual.find(outputExpected));
-
- outputExpected = "ast_scope_binding(0,1,\"y\")";
- ASSERT_NE(std::string::npos, outputActual.find(outputExpected));
-}
diff --git a/cpp/tests/latereasoning.cpp b/cpp/tests/latereasoning.cpp
deleted file mode 100644
index fbe8b45..0000000
--- a/cpp/tests/latereasoning.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- *
- * latereasoning.cpp
- *
- * Author: pgess <v.melnychenko@xreate.org>
- * Created on April 21, 2018, 5:10 PM
- */
-
-#include "xreatemanager.h"
-#include "transcendlayer.h"
-#include "pass/latereasoningpass.h"
-#include "aux/latereasoning.h"
-#include "pass/dfapass.h"
-#include <boost/format.hpp>
-#include "gtest/gtest.h"
-
-using namespace std;
-using namespace xreate;
-using namespace xreate::latereasoning;
-
-TEST(LateReasoning, Syntax1) {
- XreateManager* man = XreateManager::prepare(R"Code(
-test = function:: int {
- x = 0::int.
- y1= switch late (x)::int{0}.
- y2= switch late(x+y1->a::int)::int{1}.
- y1+y2
-}
-)Code");
-
- CodeScope* scope = man->root->findFunction("test")->getEntryScope();
- Expression y1 = scope->getDefinition(scope->getSymbol("y1"));
- Expression y2 = scope->getDefinition(scope->getSymbol("y2"));
-
- ASSERT_EQ(1, y1.bindings.size());
- ASSERT_STRCASEEQ("x", y1.bindings.at(0).c_str());
-
- ASSERT_EQ(1, y2.bindings.size());
- ASSERT_STRCASEEQ("a", y2.bindings.at(0).c_str());
-}
-
-TEST(LateReasoning, Pass_DFAPassDec_1){
- typedef LateReasoningTranscendDecorator<TranscendLayer> LRTranscend;
-
- auto man = details::tier2::XreateManager::prepare(R"Code(
-Dom = type slave dom.
-
-test = function:: int; entry
-{
- LateIdent = 0:: Dom.
- 0:: int; ann1(LateIdent)
-}
-)Code");
-
- CodeScope* scopeEntry = man->root->findFunction("test")->getEntryScope();
- ScopedSymbol keyS = scopeEntry->getSymbol("LateIdent");
- SymbolPacked keySP = man->transcend->pack(Symbol{keyS, scopeEntry});
-
- std::shared_ptr<LateReasoningScope> scopeLateEntry(new LateReasoningScope(nullptr));
- scopeLateEntry->addIdentifier("LateIdent", keySP);
-
- typedef LateReasoningDFAPassDecorator<dfa::DFAPass> LRDFAPass;
- LRDFAPass* dfaPass = new LRDFAPass(man);
- dfaPass->registerLateScope(scopeEntry, scopeLateEntry.get());
-
- man->transcend->addRawScript("dom(guard1; guard2).\n");
-
- man->registerPass(dfaPass, PassId::DFAPass, nullptr);
- man->executePasses();
-
- testing::internal::CaptureStdout();
- man->analyse();
- std::string outputActual = testing::internal::GetCapturedStdout();
- cout << outputActual << endl;
-
- string outputExpected = "late(s(0,-2,0), (s(1,-2,0)), (LateIdent), ann1(LateIdent)):- dom(LateIdent).";
- ASSERT_NE(std::string::npos, outputActual.find(outputExpected));
-}
-
-TEST(LateReasoning, Transcend_LRTransDec_1) {
- Attachments::init<versions::VariableVersion>();
- typedef LateReasoningTranscendDecorator<TranscendLayer> LRTranscend;
- std::unique_ptr<LRTranscend> transcend(new LRTranscend());
-
- std::unique_ptr<CodeScope> scope(new CodeScope(nullptr));
- Symbol symbA = scope->addDefinition(Atom<Identifier_t>("a"), Expression());
- Symbol symbB = scope->addDefinition(Atom<Identifier_t>("b"), Expression());
- Symbol symbC = scope->addDefinition(Atom<Identifier_t>("c"), Expression());
- Symbol symbTarget1 = scope->addDefinition(Atom<Identifier_t>("target1"), Expression());
- Symbol symbTarget2 = scope->addDefinition(Atom<Identifier_t>("target2"), Expression());
-
- SymbolPacked symbpA = transcend->pack(symbA, "a");
- SymbolPacked symbpB = transcend->pack(symbB, "b");
- SymbolPacked symbpC = transcend->pack(symbC, "c");
- SymbolPacked symbTarget1P = transcend->pack(symbTarget1, "target1");
- SymbolPacked symbTarget2P = transcend->pack(symbTarget2, "target2");
-
- boost::format formatSymb("s(%1%,%2%,%3%)");
- boost::format formatLateAnnotation1("late(%1%, (%2%, %3%, %4%), (%5%, %6%, %7%), %8%).");
- boost::format formatLateAnnotation2("late(%1%, (%2%, %3%), (%4%, %5%), %6%).");
- #define FORMATSYMBOL(s) (formatSymb % s.identifier % s.version % s.scope).str()
-
- // Ann1, `variant1`
- transcend->addRawScript((formatLateAnnotation1
- % FORMATSYMBOL(symbTarget1P)
- % FORMATSYMBOL(symbpA) % FORMATSYMBOL(symbpB) % FORMATSYMBOL(symbpC)
- % "guard1" % "guard1" % "guard1"
- % "result(variant1)"
- ). str());
-
- //Ann1 `result2` variant
- transcend->addRawScript((formatLateAnnotation1
- % FORMATSYMBOL(symbTarget1P)
- % FORMATSYMBOL(symbpA) % FORMATSYMBOL(symbpB) % FORMATSYMBOL(symbpC)
- % "guard2" % "guard2" % "guard2"
- % "result(variant2)"
- ). str());
-
- //Ann2 `result3` variant
- transcend->addRawScript((formatLateAnnotation2
- % FORMATSYMBOL(symbTarget2P)
- % FORMATSYMBOL(symbpA) % FORMATSYMBOL(symbpB)
- % "guard3" % "guard3"
- % "result(variant3)"
- ). str());
-
- transcend->run();
- LateAnnotationsGroup group = transcend->queryLate("result");
- ASSERT_EQ(2, group.annotations.size());
-
- for(const auto& annEntry: group.annotations){
- annEntry.first.print(cout);
- cout <<endl;
-
- Gringo::SymSpan symbsTuple;
- symbsTuple.first = &annEntry.first;
- symbsTuple.size = 1;
- Gringo::Symbol targetWrapped = Gringo::Symbol::createTuple(symbsTuple);
- SymbolPacked targetSP = get<0>(transcend->parse<SymbolPacked>(targetWrapped));
- if (targetSP == symbTarget1P){
- LateAnnotation ann = annEntry.second;
- ASSERT_EQ(2, ann.guardedContent.size());
-
- Expression selector(Operator::CALL, {Atom<Identifier_t>("guard2")});
- auto answer = ann.select({selector, selector, selector}man->root, man->transcend);
- ASSERT_TRUE(answer);
- string answerS = get<0>(transcend->parse<string>(*answer));
- ASSERT_STREQ("variant2", answerS.c_str());
-
- } else if (targetSP == symbTarget2P) {
- LateAnnotation ann = annEntry.second;
- ASSERT_EQ(1, ann.guardedContent.size());
-
- Expression selector(Operator::CALL, {Atom<Identifier_t>("guard3")});
- auto answer = ann.select({selector, selector, selector});
- ASSERT_TRUE(answer);
- ASSERT_STREQ("variant3", get<0>(transcend->parse<string>(*answer)).c_str());
-
- } else {
- ASSERT_TRUE(false);
- }
- }
-}
-
-TEST(LateReasoning, Compilation1){
- XreateManager* man = XreateManager::prepare(R"Code(
-Color = type variant{RED, BLUE, GREEN}.
-
-test = function:: int; entry {
- x = RED():: Color.
- y1= switch late (x):: int
- {0}.
- y1
-}
-)Code");
-
- int (*program)() = (int (*)())man->run();
- int result = program();
-
- ASSERT_EQ(0, result);
-}
-
-
diff --git a/cpp/tests/latetranscend.cpp b/cpp/tests/latetranscend.cpp
new file mode 100644
index 0000000..51d3666
--- /dev/null
+++ b/cpp/tests/latetranscend.cpp
@@ -0,0 +1,208 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ *
+ * latereasoning.cpp
+ *
+ * Author: pgess <v.melnychenko@xreate.org>
+ * Created on April 21, 2018, 5:10 PM
+ */
+
+#include "xreatemanager.h"
+#include "transcendlayer.h"
+#include "pass/latereasoningpass.h"
+#include "aux/latereasoning.h"
+#include "pass/dfapass.h"
+#include <boost/format.hpp>
+#include "gtest/gtest.h"
+
+using namespace std;
+using namespace xreate;
+using namespace xreate::latereasoning;
+
+TEST(LateReasoning, Syntax1) {
+ XreateManager* man = XreateManager::prepare(R"Code(
+test = function:: int {
+ x = 0::int.
+ y1= switch late (x)::int{0}.
+ y2= switch late(x+y1->a::int)::int{1}.
+ y1+y2
+}
+)Code");
+
+ CodeScope* scope = man->root->findFunction("test")->getEntryScope();
+ Expression y1 = scope->getDefinition(scope->getSymbol("y1"));
+ Expression y2 = scope->getDefinition(scope->getSymbol("y2"));
+
+ ASSERT_EQ(1, y1.bindings.size());
+ ASSERT_STRCASEEQ("x", y1.bindings.at(0).c_str());
+
+ ASSERT_EQ(1, y2.bindings.size());
+ ASSERT_STRCASEEQ("a", y2.bindings.at(0).c_str());
+}
+
+TEST(LateReasoning, Pass_DFAPassDec_1){
+ typedef LateReasoningTranscendDecorator<TranscendLayer> LRTranscend;
+
+ auto man = details::tier2::XreateManager::prepare(R"Code(
+Dom = type slave dom.
+
+test = function:: int; entry
+{
+ LateIdent = 0:: Dom.
+ 0:: int; ann1(LateIdent)
+}
+)Code");
+
+ CodeScope* scopeEntry = man->root->findFunction("test")->getEntryScope();
+ ScopedSymbol keyS = scopeEntry->getSymbol("LateIdent");
+ SymbolPacked keySP = man->transcend->pack(Symbol{keyS, scopeEntry});
+
+ std::shared_ptr<LateReasoningScope> scopeLateEntry(new LateReasoningScope(nullptr));
+ scopeLateEntry->addIdentifier("LateIdent", keySP);
+
+ typedef LateReasoningDFAPassDecorator<dfa::DFAPass> LRDFAPass;
+ LRDFAPass* dfaPass = new LRDFAPass(man);
+ dfaPass->registerLateScope(scopeEntry, scopeLateEntry.get());
+
+ man->transcend->addRawScript("dom(guard1; guard2).\n");
+
+ man->registerPass(dfaPass, PassId::DFAPass, nullptr);
+ man->executePasses();
+
+ testing::internal::CaptureStdout();
+ man->analyse();
+ std::string outputActual = testing::internal::GetCapturedStdout();
+ cout << outputActual << endl;
+
+ string outputExpected = "late(s(0,-2,0), (s(1,-2,0)), (LateIdent), ann1(LateIdent)):- dom(LateIdent).";
+ ASSERT_NE(std::string::npos, outputActual.find(outputExpected));
+}
+
+//TEST(LateReasoning, Transcend_LRTransDec_1) {
+// Attachments::init<versions::VariableVersion>();
+// typedef LateReasoningTranscendDecorator<TranscendLayer> LRTranscend;
+// std::unique_ptr<LRTranscend> transcend(new LRTranscend());
+
+// std::unique_ptr<CodeScope> scope(new CodeScope(nullptr));
+// Symbol symbA = scope->addDefinition(Atom<Identifier_t>("a"), Expression());
+// Symbol symbB = scope->addDefinition(Atom<Identifier_t>("b"), Expression());
+// Symbol symbC = scope->addDefinition(Atom<Identifier_t>("c"), Expression());
+// Symbol symbTarget1 = scope->addDefinition(Atom<Identifier_t>("target1"), Expression());
+// Symbol symbTarget2 = scope->addDefinition(Atom<Identifier_t>("target2"), Expression());
+
+// SymbolPacked symbpA = transcend->pack(symbA, "a");
+// SymbolPacked symbpB = transcend->pack(symbB, "b");
+// SymbolPacked symbpC = transcend->pack(symbC, "c");
+// SymbolPacked symbTarget1P = transcend->pack(symbTarget1, "target1");
+// SymbolPacked symbTarget2P = transcend->pack(symbTarget2, "target2");
+
+// boost::format formatSymb("s(%1%,%2%,%3%)");
+// boost::format formatLateAnnotation1("late(%1%, (%2%, %3%, %4%), (%5%, %6%, %7%), %8%).");
+// boost::format formatLateAnnotation2("late(%1%, (%2%, %3%), (%4%, %5%), %6%).");
+// #define FORMATSYMBOL(s) (formatSymb % s.identifier % s.version % s.scope).str()
+
+// // Ann1, `variant1`
+// transcend->addRawScript((formatLateAnnotation1
+// % FORMATSYMBOL(symbTarget1P)
+// % FORMATSYMBOL(symbpA) % FORMATSYMBOL(symbpB) % FORMATSYMBOL(symbpC)
+// % "guard1" % "guard1" % "guard1"
+// % "result(variant1)"
+// ). str());
+
+// //Ann1 `result2` variant
+// transcend->addRawScript((formatLateAnnotation1
+// % FORMATSYMBOL(symbTarget1P)
+// % FORMATSYMBOL(symbpA) % FORMATSYMBOL(symbpB) % FORMATSYMBOL(symbpC)
+// % "guard2" % "guard2" % "guard2"
+// % "result(variant2)"
+// ). str());
+
+// //Ann2 `result3` variant
+// transcend->addRawScript((formatLateAnnotation2
+// % FORMATSYMBOL(symbTarget2P)
+// % FORMATSYMBOL(symbpA) % FORMATSYMBOL(symbpB)
+// % "guard3" % "guard3"
+// % "result(variant3)"
+// ). str());
+
+// transcend->run();
+// LateAnnotationsGroup group = transcend->queryLate("result");
+// ASSERT_EQ(2, group.annotations.size());
+
+// for(const auto& annEntry: group.annotations){
+// annEntry.first.print(cout);
+// cout <<endl;
+
+// Gringo::SymSpan symbsTuple;
+// symbsTuple.first = &annEntry.first;
+// symbsTuple.size = 1;
+// Gringo::Symbol targetWrapped = Gringo::Symbol::createTuple(symbsTuple);
+// SymbolPacked targetSP = get<0>(transcend->parse<SymbolPacked>(targetWrapped));
+// if (targetSP == symbTarget1P){
+// LateAnnotation ann = annEntry.second;
+// ASSERT_EQ(2, ann.guardedContent.size());
+
+// Expression selector(Operator::CALL, {Atom<Identifier_t>("guard2")});
+// auto answer = ann.select({selector, selector, selector}, man->root, man->transcend);
+// ASSERT_TRUE(answer);
+// string answerS = get<0>(transcend->parse<string>(*answer));
+// ASSERT_STREQ("variant2", answerS.c_str());
+
+// } else if (targetSP == symbTarget2P) {
+// LateAnnotation ann = annEntry.second;
+// ASSERT_EQ(1, ann.guardedContent.size());
+
+// Expression selector(Operator::CALL, {Atom<Identifier_t>("guard3")});
+// auto answer = ann.select({selector, selector, selector});
+// ASSERT_TRUE(answer);
+// ASSERT_STREQ("variant3", get<0>(transcend->parse<string>(*answer)).c_str());
+
+// } else {
+// ASSERT_TRUE(false);
+// }
+// }
+//}
+
+TEST(LateReasoning, Doc_SwitchLateOperation){
+ auto man = details::tier2::XreateManager::prepare(
+R"Code(
+
+mul = function(x::float, y::float):: float
+{
+ x * y
+}
+
+ArithmeticT = type slave arithmetic.
+
+test = function(a::float, b::float, ArithmX::ArithmeticT):: float; entry
+{
+ switch late (ArithmX):: float
+ {
+ mul(a, b)::float; arithmetic(ArithmX)
+ }
+}
+
+)Code");
+
+ string codeTranscend =
+R"Code(
+ arithmetic(fast; accurate).
+)Code";
+
+ typedef LateReasoningTranscendDecorator<TranscendLayer> LateTranscend;
+ typedef LateReasoningDFAPassDecorator<dfa::DFAPass> LTDFAPass;
+
+ std::unique_ptr<LateTranscend> transcend(new LateTranscend());
+ man->transcend = transcend.get();
+ man->transcend->addRawScript(move(codeTranscend));
+ LTDFAPass* pass = new LTDFAPass(man);
+
+ man->registerPass(pass, PassId::DFAPass, nullptr);
+ man->executePasses();
+ man->analyse();
+
+ auto result = transcend->queryLate("arithmetic");
+ ASSERT_EQ(1, result.annotations.size());
+ ASSERT_EQ(2, result.annotations.begin()->second.guardedContent.size());
+ //man->run();
+}
diff --git a/cpp/tests/latex.cpp b/cpp/tests/latex.cpp
index 54ceff8..a8d3cec 100644
--- a/cpp/tests/latex.cpp
+++ b/cpp/tests/latex.cpp
@@ -1,298 +1,334 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*
* Author: pgess <v.melnychenko@xreate.org>
* Created on June 25, 2018, 5:42 PM
*
* \file latex.cpp
* \brief Testing of latex
*/
#include "xreatemanager.h"
#include "pass/compilepass.h"
#include "transcendlayer.h"
#include "query/latex.h"
#include "compilation/latex.h"
#include "aux/xreatemanager-decorators.h"
#include "compilation/scopedecorators.h"
#include "llvmlayer.h"
+#include "supplemental/docutils.h"
#include <boost/format.hpp>
#include <gtest/gtest.h>
using namespace xreate::latex;
using namespace xreate::latereasoning;
using namespace xreate::compilation;
using namespace xreate;
using namespace std;
TEST(Latex, Script_NestedScopePropagation_1) {
std::string program =
R"CODE(
import raw("scripts/cfa/context.lp").
fn = function:: int; entry
{
context:: test1.
if(1==11)::int {2} else {3}
}
)CODE";
std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
CodeScope* blockTrue = man->root->findFunction("fn")->getEntryScope()->getBody().blocks.front();
auto blockTrueP = man->transcend->pack(blockTrue);
boost::format formatAlias("alias(%1%, %2%).");
man->transcend->addRawScript((formatAlias % blockTrueP % "block1").str());
man->transcend->addRawScript(
R"SCRIPT(
success1:- bind_scope(Block1, test1, strong); alias(Block1, block1).
)SCRIPT");
man->analyse();
ASSERT_EQ(1, man->transcend->query("success1").size());
}
TEST(Latex, Script_DemAndDecision_1) {
std::string program =
R"CODE(
import raw("scripts/cfa/context.lp").
a = function:: int
{
context:: forC(a).
c()
}
b = function:: int
{
context:: forC(b).
c()
}
c = function:: int {0}
main = function:: int; entry
{
a() + b()
}
)CODE";
std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
CodeScope* blockC = man->root->findFunction("c")->getEntryScope();
auto blockCP = man->transcend->pack(blockC);
boost::format formatAlias("alias(%1%, %2%).");
man->transcend->addRawScript((formatAlias % blockCP % "blockC").str());
man->transcend->addRawScript(
R"SCRIPT(
latex_scope_demand(BlockC, forC):- alias(BlockC, blockC).
latex_registered_subjects(forC, Variant):- bind_scope(_, Variant, strong); Variant = forC(_).
)SCRIPT");
man->analyse();
ASSERT_EQ(1, man->transcend->query("latex_fn_demand").size());
ASSERT_EQ(2, man->transcend->query("latex_decision").size());
}
TEST(Latex, LatexQuery_getFnDemand_1){
std::string program =
R"CODE(
import raw("scripts/cfa/context.lp").
main = function:: int; entry
{
context:: alias(blockMain).
0
}
)CODE";
std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
man->transcend->addRawScript(
R"SCRIPT(
latex_scope_demand(BlockC, forC):- bind_scope(BlockC, alias(blockMain), strong).
latex_registered_subjects(forC, decisionSome).
)SCRIPT");
LatexQuery* query = new LatexQuery();
man->transcend->registerQuery(query, QueryId::LatexQuery);
man->analyse();
Demand demand = query->getFnDemand("main");
ASSERT_EQ(1, demand.size());
ASSERT_STREQ("forC", demand.front().c_str());
}
TEST(Latex, LatexQuery_getDecision_static_1){
std::string program =
R"CODE(
import raw("scripts/cfa/context.lp").
a = function:: int {context::decisionSome. c()}
b = function:: int {c()}
c = function:: int {context:: alias(blockC). 0}
)CODE";
std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
man->transcend->addRawScript(
R"SCRIPT(
latex_scope_demand(BlockC, forC):- bind_scope(BlockC, alias(blockC), strong).
latex_registered_subjects(forC, decisionSome).
)SCRIPT");
LatexQuery* query = new LatexQuery();
man->transcend->registerQuery(query, QueryId::LatexQuery);
man->analyse();
LateAnnotation decisionLA = query->getDecision("forC", man->root->findFunction("a")->getEntryScope());
auto decisionGS = decisionLA.select({}, man->root, man->transcend);
ASSERT_TRUE(decisionGS);
decisionGS->print(cout);
cout << endl;
auto decisionTuple = man->transcend->parse<Gringo::Symbol, Gringo::Symbol, string>(*decisionGS);
string decision = get<2>(decisionTuple);
ASSERT_STREQ("decisionSome", decision.c_str());
}
TEST(Latex, Compilation_1) {
std::string program =
R"CODE(
a = function:: int
{0}
main = function:: int; entry
{
a()
}
)CODE";
string script =
R"SCRIPT(
latex_fn_demand(%1%, subject1).
latex_decision(%2%, subject1, 5).
latex_registered_subjects(subject1, 1).
latex_registered_subjects(subject1, 5).
)SCRIPT";
typedef LatexBruteFunctionDecorator<compilation::BasicFunctionUnit> FnImpl;
typedef LatexBruteScopeDecorator<compilation::CachedScopeDecorator<compilation::BasicCodeScopeUnit>> ScopeImpl;
std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
ScopePacked scopeMainP = man->transcend->pack(man->root->findFunction("main")->getEntryScope());
boost::format format(script);
man->transcend->addRawScript((format % "a" % scopeMainP).str());
man->transcend->registerQuery(new LatexQuery(), QueryId::LatexQuery);
man->analyse();
std::unique_ptr<CompilePass> compiler(new compilation::CompilePassCustomDecorators<FnImpl, ScopeImpl>(man.get()));
compiler->run();
man->llvm->initJit();
int(*fnMain)() = (int(*)())man->llvm->getFunctionPointer(compiler->getEntryFunction());
ASSERT_EQ(0, fnMain());
}
//
//TEST(Latex, Full1) {
// std::string program =
// R"CODE(
// import raw("scripts/cfa/context.lp").
//
// a = function:: int
// {
// context:: forC(a).
// c()
// }
//
// b = function:: int
// {
// context:: forC(b).
// c()
// }
//
// c = function:: int {0}
//
// main = function:: int; entry
// {
// a() + b()
// }
// )CODE";
//
// string script =
// R"SCRIPT(
// alias(%1%, scopeC).
// latex_scope_demand(ScopeC, forC) :- alias(ScopeC, scopeC).
// latex_registered_subjects(forC, forC(a)).
// latex_registered_subjects(forC, forC(b)).
// )SCRIPT";
//
// typedef LatexBruteFunctionDecorator<compilation::BasicFunctionUnit> FnImpl;
// typedef LatexBruteScopeDecorator<compilation::CachedScopeDecorator<compilation::BasicCodeScopeUnit>> ScopeImpl;
//
// std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
// ScopePacked scopeMainP = man->transcend->pack(man->root->findFunction("main")->getEntryScope());
// auto scopeCP = man->transcend->pack(man->root->findFunction("c")->getEntryScope());
// boost::format format(script);
// man->transcend->addRawScript((format %scopeCP).str());
// man->transcend->registerQuery(new LatexQuery(), QueryId::LatexQuery);
// man->analyse();
//
// std::unique_ptr<CompilePass> compiler(new compilation::CompilePassCustomDecorators<FnImpl, ScopeImpl>(man.get()));
// compiler->run();
// man->llvm->print();
//}
//
TEST(Latex, Compilation_TransitFn1){
std::string program =
R"CODE(
import raw("scripts/cfa/context.lp").
branchA = function:: int
{
context:: sink_a.
fnTransit()
}
branchB = function:: int
{
context:: sink_b.
fnTransit()
}
fnSink = function:: int {0}
fnTransit = function:: int {fnSink()}
main = function:: int; entry
{
branchA() + branchB()
}
)CODE";
string script =
R"SCRIPT(
alias(scopeSink, %1%).
latex_scope_demand(ScopeSink, sink):- alias(scopeSink, ScopeSink).
latex_registered_subjects(sink, sink_a).
latex_registered_subjects(sink, sink_b).
)SCRIPT";
typedef LatexBruteFunctionDecorator<compilation::BasicFunctionUnit> FnImpl;
typedef LatexBruteScopeDecorator<compilation::CachedScopeDecorator<compilation::BasicCodeScopeUnit>> ScopeImpl;
std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
CodeScope* scopeSink = man->root->findFunction("fnSink")->getEntryScope();
auto scopeSinkP = man->transcend->pack(scopeSink);
ScopedSymbol argLatexSS{1, -1};
Symbol argLatexS{argLatexSS, scopeSink};
man->transcend->pack(argLatexS);
boost::format format(script);
man->transcend->addRawScript((format %scopeSinkP).str());
man->transcend->registerQuery(new LatexQuery(), QueryId::LatexQuery);
man->analyse();
std::unique_ptr<CompilePass> compiler(new compilation::CompilePassCustomDecorators<FnImpl, ScopeImpl>(man.get()));
compiler->run();
man->llvm->print();
man->llvm->initJit();
int(*fnMain)() = (int(*)()) man->llvm->getFunctionPointer(compiler->getEntryFunction());
int valueActual = fnMain();
ASSERT_EQ(0, valueActual);
+}
+
+TEST(Latex, Doc_Examples1){
+ std::string program = getDocumentationExampleById("documentation/Concepts/context.xml", "Examples_1");
+ std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
+}
+
+TEST(Latex, Doc_Examples2){
+ std::string program = getDocumentationExampleById("documentation/Concepts/context.xml", "Examples_2");
+
+ std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
+}
+
+TEST(Latex, Doc_ContextPropagation1){
+ std::string program =getDocumentationExampleById("documentation/Concepts/context.xml", "ContextPropagation1");
+
+ std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
+}
+
+TEST(Latex, Doc_ContextPropagation2){
+ std::string program = getDocumentationExampleById("documentation/Concepts/context.xml", "ContextPropagation2");
+
+ std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
+}
+
+TEST(Latex, Doc_ContextPropagation3){
+ std::string program = getDocumentationExampleById("documentation/Concepts/context.xml", "ContextPropagation3");
+
+ std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
+}
+
+TEST(Latex, Doc_Latex1){
+ std::string program = getDocumentationExampleById("documentation/Concepts/context.xml", "Latex1");
+
+ std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(move(program)));
}
\ No newline at end of file
diff --git a/cpp/tests/modules.cpp b/cpp/tests/modules.cpp
index 602e096..e9820aa 100644
--- a/cpp/tests/modules.cpp
+++ b/cpp/tests/modules.cpp
@@ -1,407 +1,371 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*
* modules.cpp
*
* Author: pgess <v.melnychenko@xreate.org>
* Created on June 18, 2017, 8:25 PM
*/
class Modules_AST2_Test;
class Modules_Discovery1_Test;
class Modules_Solve1_Test;
#define FRIENDS_MODULES_TESTS \
friend class ::Modules_AST2_Test; \
friend class ::Modules_Discovery1_Test; \
friend class ::Modules_Solve1_Test;
#include "modules.h"
#include "aux/xreatemanager-decorators.h"
#include "aux/xreatemanager-modules.h"
#include "xreatemanager.h"
#include "modules/Parser.h"
+#include "supplemental/docutils.h"
#include "gtest/gtest.h"
#include <boost/filesystem.hpp>
#include <regex>
#include <clingo/clingocontrol.hh>
namespace fs = boost::filesystem;
using namespace std;
using namespace xreate;
using namespace xreate::modules;
TEST(Modules, AST1) {
FILE* input = fopen("scripts/dsl/regexp.xreate","r");
assert(input != nullptr);
Scanner scanner(input);
Parser parser(&scanner);
parser.Parse();
ASSERT_EQ(parser.errors->count, 0);
}
TEST(Modules, AST2){
string code = R"Code(
module:: name(test1); status(untested)
{
require(provides(logging)).
controller("/tmp/test-controller.ls").
discover("/tmp/root/").
}
)Code";
Scanner scanner(reinterpret_cast<const unsigned char*>(code.c_str()), code.size());
Parser parser(&scanner);
parser.Parse();
ModuleRecord module = parser.module;
ASSERT_EQ(2, module.__properties.size());
ASSERT_EQ("name", module.__properties.front().getValueString());
ASSERT_EQ("status", module.__properties.back().getValueString());
ASSERT_EQ(1, module.__requests.size());
ASSERT_EQ("provides", module.__requests.front().getValueString());
ASSERT_EQ(1, module.__controllers.size());
ASSERT_EQ("/tmp/test-controller.ls", module.__controllers.front());
ASSERT_EQ(1, module.__discoveryPaths.size());
ASSERT_EQ("/tmp/root/", module.__discoveryPaths.front());
}
TEST(Modules, Discovery1){
const std::string dirModulesRoot = "/tmp/testModulesDiscovery1_t54723/";
string codeA =
R"Code(
module::name(testA); status(needToTestMore).
)Code";
string codeB =
R"Code(
module:: name(testB); status(needToTestEvenMore).
)Code";
string codeMain = string("module{discover (\"") + dirModulesRoot + "\").}";
fs::create_directories(dirModulesRoot);
fs::ofstream fileA(dirModulesRoot + "a.xreate");
fileA << codeA;
fileA.close();
fs::ofstream fileB(dirModulesRoot + "b.xreate");
fileB << codeB;
fileB.close();
Scanner scanner(reinterpret_cast<const unsigned char*>(codeMain.c_str()), codeMain.size());
Parser parser(&scanner);
parser.Parse();
ModulesSolver solver;
solver.discoverModules(parser.module);
fs::remove_all(dirModulesRoot);
std::string output = solver.__program.str();
cout << output << endl;
ASSERT_NE(string::npos, output.find("bind_module(\"/tmp/testModulesDiscovery1_t54723/a.xreate\", name(testA))."));
ASSERT_NE(string::npos, output.find("bind_module(\"/tmp/testModulesDiscovery1_t54723/b.xreate\", status(needToTestEvenMore))."));
}
TEST(Modules, Requests1){
}
-TEST(Modules, Doc_AdvModRes_1){
- string codeA =
- R"Code(
- //First Module
- module::
- name(testA);
- provide(superService);
- status(needToTestEvenMore).
- )Code";
-
- string codeB =
- R"Code(
- //Second Module
- module::
- name(testB);
- provide(superService);
- status(needToTest).
- )Code";
-
- string codeMain =
-R"Code(
- //Third Module
- module {
- require (superService).
-
- discover("/tmp/testModulesDiscovery1_t54724/").
- controller("/tmp/testModulesDiscovery1_t54724/controller").
- }
-)Code";
-
- const std::string dirModulesRoot = "/tmp/testModulesDiscovery1_t54724/";
-
- string codeController =
-R"Code(
-status_score(0, needToTestEvenMore).
-status_score(1, needToTest).
-
-module_include_candidate(Request, Y):-
- bind_module(Y, provide(Request)).
-
-module_include_winner(Request, MaxScore) :-
- MaxScore = #max{Score: module_include_candidate(Request, Y), bind_module(Y, status(Status)), status_score(Score, Status)};
- modules_require(_, Request).
-
-modules_resolution(Request, Y) :-
- module_include_winner(Request, MaxScore);
- bind_module(Y, provide(Request));
- bind_module(Y, status(Status));
- status_score(MaxScore, Status).
-)Code";
-
- fs::create_directories(dirModulesRoot);
- fs::ofstream fileA(dirModulesRoot + "a.xreate");
- fileA << codeA;
- fileA.close();
-
- fs::ofstream fileB(dirModulesRoot + "b.xreate");
- fileB << codeB;
- fileB.close();
-
- fs::ofstream fileController(dirModulesRoot + "controller");
- fileController << codeController;
- fileController.close();
-
- Scanner scanner(reinterpret_cast<const unsigned char*>(codeMain.c_str()), codeMain.size());
- Parser parser(&scanner);
- parser.Parse();
-
- ModulesSolver solver;
- solver.init("", parser.module);
- fs::remove_all(dirModulesRoot);
-
- cout << solver.__program.str() << endl;
- std::list<std::string> modulesRequired = solver.run(parser.module);
-
- ASSERT_EQ(1, modulesRequired.size());
- string moduleActualRequired = modulesRequired.front();
-
- string moduleExpected = dirModulesRoot + "b.xreate";
- ASSERT_EQ(moduleExpected, moduleActualRequired);
-}
-
TEST(Modules, Compilation1){
const std::string dirModulesRoot = "/tmp/testModulesDiscovery1_t54726/";
string codeMain =
R"Code(
module {
discover("/tmp/testModulesDiscovery1_t54726/").
controller("/tmp/testModulesDiscovery1_t54726/controller").
require (superService).
}
test = function:: int; entry {
getYourNumber()
}
)Code";
string codeA =
R"Code(
module:: name(testA); provide(superService); status(needToTestEvenMore).
getYourNumber= function:: int {0}
)Code";
string codeB =
R"Code(
module :: name(testB); provide(superService); status(needToTestMore).
getYourNumber= function:: int {1}
)Code";
string codeController =
R"Code(
status_score(0, needToTestEvenMore).
status_score(1, needToTestMore).
module_include_candidate(Request, Y):-
bind_module(Y, provide(Request)).
module_include_winner(Request, MaxScore) :-
MaxScore = #max{Score: module_include_candidate(Request, Y), bind_module(Y, status(Status)), status_score(Score, Status)};
modules_require(_, Request).
modules_resolution(Request, Y) :-
module_include_winner(Request, MaxScore);
bind_module(Y, provide(Request));
bind_module(Y, status(Status));
status_score(MaxScore, Status).
)Code";
fs::create_directories(dirModulesRoot);
fs::ofstream fileA(dirModulesRoot + "a.xreate");
fileA << codeA;
fileA.close();
fs::ofstream fileB(dirModulesRoot + "b.xreate");
fileB << codeB;
fileB.close();
fs::ofstream fileController(dirModulesRoot + "controller");
fileController << codeController;
fileController.close();
auto man = new XreateManagerImpl<XreateManagerDecoratorModules<XreateManagerDecoratorFull>>();
man->prepareCode(std::move(codeMain));
fs::remove_all(dirModulesRoot);
int (*funcMain)() = (int (*)()) man->run();
int result = funcMain();
ASSERT_EQ(1, result);
}
TEST(Modules, Compilation_AssignModulePath1){
const std::string dirModulesRoot = "/tmp/testModulesDiscovery1_t54725/";
string codeMain =
R"Code(
module {
discover("/tmp/testModulesDiscovery1_t54725/").
controller("/tmp/testModulesDiscovery1_t54725/controller").
require (superService).
}
test = function:: int; entry {
getYourNumber()
}
)Code";
string codeA =
R"Code(
module:: name(testA); provide(superService); status(needToTestEvenMore).
getYourNumber= function:: int {0}
)Code";
string codeController =
R"Code(
modules_resolution(superService, "/tmp/testModulesDiscovery1_t54725/a.xreate").
)Code";
fs::create_directories(dirModulesRoot);
fs::ofstream fileA(dirModulesRoot + "a.xreate");
fileA << codeA;
fileA.close();
fs::ofstream fileController(dirModulesRoot + "controller");
fileController << codeController;
fileController.close();
auto man = new XreateManagerImpl<XreateManagerDecoratorModules<XreateManagerDecoratorFull>>();
man->prepareCode(std::move(codeMain));
fs::remove_all(dirModulesRoot);
int (*funcMain)() = (int (*)()) man->run();
int result = funcMain();
ASSERT_EQ(0, result);
}
TEST(Modules, Doc_Requesting_Modules_1){
- string codeExcerpt = R"Code(
- module {
- require(logger).
- }
- )Code";
+ string codeExcerpt = getDocumentationExampleById("documentation/Syntax/modules.xml", "Requesting_Modules_1");
- string codeController = R"Code(
- modules_resolution(logger, "/tmp/logger").
- )Code";
+ string codeController = R"Code(
+ modules_resolution(logger, "/tmp/logger").
+ )Code";
- Scanner scanner(reinterpret_cast<const unsigned char*>(codeExcerpt.c_str()), codeExcerpt.size());
- Parser parser(&scanner);
- parser.Parse();
+ Scanner scanner(reinterpret_cast<const unsigned char*>(codeExcerpt.c_str()), codeExcerpt.size());
+ Parser parser(&scanner);
+ parser.Parse();
- ModulesSolver solver;
- solver.init(move(codeController), parser.module);
- std::list<string> result = solver.run(parser.module);
- ASSERT_EQ(1, result.size());
- ASSERT_STREQ("/tmp/logger", result.front().c_str());
+ ModulesSolver solver;
+ solver.init(move(codeController), parser.module);
+ std::list<string> result = solver.run(parser.module);
+ ASSERT_EQ(1, result.size());
+ ASSERT_STREQ("/tmp/logger", result.front().c_str());
}
TEST(Modules, Doc_Requesting_Modules_2){
- string codeExcerpt = R"Code(
- module{require(stringslib).}
- processString = function(a:: string):: string
- {
- someStrFunc(a)
- }
-
- module{require(mathlib).}
- processNumber = function(a:: num):: num
- {
- someMathFunc(a)
- }
- )Code";
-
- string codeController = R"Code(
- modules_resolution(stringslib, "/tmp/stringslib").
- modules_resolution(mathlib, "/tmp/mathlib").
- )Code";
-
- Scanner scanner(reinterpret_cast<const unsigned char*>(codeExcerpt.c_str()), codeExcerpt.size());
- Parser parser(&scanner);
- parser.Parse();
-
- ModulesSolver solver;
- solver.init(move(codeController), parser.module);
- std::list<string> result = solver.run(parser.module);
- ASSERT_EQ(2, result.size());
- ASSERT_STREQ("/tmp/stringslib", result.front().c_str());
- ASSERT_STREQ("/tmp/mathlib", result.back().c_str());
+ string codeExcerpt = getDocumentationExampleById("documentation/Syntax/modules.xml", "Requesting_Modules_2");
+
+ string codeController = R"Code(
+ modules_resolution(stringslib, "/tmp/stringslib").
+ modules_resolution(mathlib, "/tmp/mathlib").
+ )Code";
+
+ Scanner scanner(reinterpret_cast<const unsigned char*>(codeExcerpt.c_str()), codeExcerpt.size());
+ Parser parser(&scanner);
+ parser.Parse();
+
+ ModulesSolver solver;
+ solver.init(move(codeController), parser.module);
+ std::list<string> result = solver.run(parser.module);
+ ASSERT_EQ(2, result.size());
+ ASSERT_STREQ("/tmp/stringslib", result.front().c_str());
+ ASSERT_STREQ("/tmp/mathlib", result.back().c_str());
}
TEST(Modules, Doc_ModuleAnnotations_1){
- string codeExcerpt = R"Code(
- module:: status(obsolete).
- )Code";
+ string codeExcerpt = getDocumentationExampleById("documentation/Syntax/modules.xml", "ModuleAnnotations_1");
- Scanner scanner(reinterpret_cast<const unsigned char*>(codeExcerpt.c_str()), codeExcerpt.size());
- Parser parser(&scanner);
- parser.Parse();
+ Scanner scanner(reinterpret_cast<const unsigned char*>(codeExcerpt.c_str()), codeExcerpt.size());
+ Parser parser(&scanner);
+ parser.Parse();
- ModulesSolver solver;
- solver.init("", parser.module);
+ ModulesSolver solver;
+ solver.init("", parser.module);
- string program = solver.__program.str();
- ASSERT_NE(string::npos, program.find("bind_module(\"\", status(obsolete))."));
+ string program = solver.__program.str();
+ ASSERT_NE(string::npos, program.find("bind_module(\"\", status(obsolete))."));
}
TEST(Modules, Doc_ModulesResolution_1){
- string codeExcerpt = R"Code(
- modules_resolution(numlib, "/path/to/numlib").
- modules_resolution(strings, "/path/to/ansi-lib", "").
- modules_resolution(strings, "/path/to/utf8-lib", "moduleB").
- )Code";
+ string codeExcerpt = getDocumentationExampleById("documentation/Syntax/modules.xml", "ModulesResolution_1");
string codeModule = R"Code(
module {require(numlib). require(strings)}
)Code";
+ //use ModuleA as a current module
+ codeExcerpt.replace(codeExcerpt.find("moduleA"), 7, "");
+
Scanner scanner(reinterpret_cast<const unsigned char*>(codeModule.c_str()), codeModule.size());
Parser parser(&scanner);
parser.Parse();
ModulesSolver solver;
solver.init(codeExcerpt, parser.module);
std::list<string> result = solver.run(parser.module);
ASSERT_EQ(2, result.size());
ASSERT_STREQ("/path/to/numlib", result.front().c_str());
ASSERT_STREQ("/path/to/ansi-lib", result.back().c_str());
}
+
+TEST(Modules, Doc_AdvModRes_1){
+ string code = getDocumentationExampleById("documentation/Syntax/modules.xml", "AdvModRes_1");
+ size_t posCodeA = code.find("//First Module");
+ size_t posCodeB = code.find("//Second Module");
+ size_t posCodeMain = code.find("//Third Module");
+ string codeA = code.substr(posCodeA, posCodeB - posCodeA);
+ string codeB = code.substr(posCodeB, posCodeMain - posCodeB);
+ string codeMain = code.substr(posCodeMain);
+
+ const std::string dirModulesRoot = "/tmp/testModulesDiscovery1_t54724/";
+ replace(codeMain, string("/modules/path/"), dirModulesRoot);
+ replace(codeMain, string("/path/to/controller"), dirModulesRoot + "controller");
+ cout << codeMain << endl;
+
+ string codeController =
+R"Code(
+status_score(0, needToTestEvenMore).
+status_score(1, needToTest).
+
+module_include_candidate(Request, Y):-
+ bind_module(Y, provide(Request)).
+
+module_include_winner(Request, MaxScore) :-
+ MaxScore = #max{Score: module_include_candidate(Request, Y), bind_module(Y, status(Status)), status_score(Score, Status)};
+ modules_require(_, Request).
+
+modules_resolution(Request, Y) :-
+ module_include_winner(Request, MaxScore);
+ bind_module(Y, provide(Request));
+ bind_module(Y, status(Status));
+ status_score(MaxScore, Status).
+)Code";
+
+ fs::create_directories(dirModulesRoot);
+ fs::ofstream fileA(dirModulesRoot + "a.xreate");
+ fileA << codeA;
+ fileA.close();
+
+ fs::ofstream fileB(dirModulesRoot + "b.xreate");
+ fileB << codeB;
+ fileB.close();
+
+ fs::ofstream fileController(dirModulesRoot + "controller");
+ fileController << codeController;
+ fileController.close();
+
+ Scanner scanner(reinterpret_cast<const unsigned char*>(codeMain.c_str()), codeMain.size());
+ Parser parser(&scanner);
+ parser.Parse();
+
+ ModulesSolver solver;
+ solver.init("", parser.module);
+ fs::remove_all(dirModulesRoot);
+
+ cout << solver.__program.str() << endl;
+ std::list<std::string> modulesRequired = solver.run(parser.module);
+
+ ASSERT_EQ(1, modulesRequired.size());
+ string moduleActualRequired = modulesRequired.front();
+
+ string moduleExpected = dirModulesRoot + "b.xreate";
+ ASSERT_EQ(moduleExpected, moduleActualRequired);
+}
\ No newline at end of file
diff --git a/cpp/tests/polymorph.cpp b/cpp/tests/polymorph.cpp
index 9835ac1..5a930bc 100644
--- a/cpp/tests/polymorph.cpp
+++ b/cpp/tests/polymorph.cpp
@@ -1,147 +1,160 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*
* polymorph.cpp
*
* Author: pgess <v.melnychenko@xreate.org>
* Created on October 11, 2017, 8:37 PM
*/
#include "xreatemanager.h"
#include "ast.h"
#include "transcendlayer.h"
#include "aux/latereasoning.h"
#include <list>
#include "gtest/gtest.h"
#include "query/polymorph.h"
+#include "supplemental/docutils.h"
using namespace xreate;
using namespace xreate::latereasoning;
using namespace xreate::polymorph;
using namespace std;
TEST(Polymorphs, ast1) {
xreate::XreateManager* man = xreate::XreateManager::prepare(
R"CODE(
guard:: a {
test = function:: int {0}
}
guard:: b {
test = function:: int {1}
}
main = function:: int; entry { test() }
)CODE");
const std::list<ManagedFnPtr>& specs = man->root->getFunctionSpecializations("test");
ASSERT_EQ(2, specs.size());
auto itSpecs = specs.begin();
ASSERT_EQ("a", (*itSpecs)->guard.getValueString());
itSpecs++;
ASSERT_EQ("b", (*itSpecs)->guard.getValueString());
}
TEST(Polymorphs, PolymorphQuery_Static_1) {
xreate::details::tier1::XreateManager* man = xreate::details::tier1::XreateManager::prepare(
R"CODE(
import raw("scripts/dfa/polymorphism.lp").
guard:: a {
test = function:: int {0}
}
guard:: b {
test = function:: int {1}
}
main = function:: int; entry { test()::int; callguard(b); dfa_polym(ret)}
)CODE");
man->analyse();
PolymorphQuery* query = dynamic_cast<PolymorphQuery*> (man->transcend->getQuery(QueryId::PolymorphQuery));
const Expression& bodyE = man->root->findFunction("main")->getEntryScope()->getBody();
LateAnnotation decisionLA = query->get(bodyE);
ASSERT_EQ(1, decisionLA.guardedContent.size());
auto decisionOptSymb = decisionLA.select({}, man->root, man->transcend);
ASSERT_TRUE(decisionOptSymb);
decisionOptSymb->print(cout);
cout << endl;
string guard = query->getValue(*decisionOptSymb).getValueString();
ASSERT_STREQ("b", guard.c_str());
}
TEST(Polymorphs, PolymorphQuery_Late_1){
xreate::details::tier1::XreateManager* man = xreate::details::tier1::XreateManager::prepare(
R"CODE(
Late = type variant{a, b}.
main = function:: int; entry{key= a():: Late; test. key::int}
)CODE");
man->transcend->addRawScript(
R"RULE(
late(S, S, a, dfa_callguard(S, a)):-
bind(S, test).
late(S, S, b, dfa_callguard(S, b)):-
bind(S, test).
)RULE");
man->analyse();
PolymorphQuery* query = dynamic_cast<PolymorphQuery*> (man->transcend->getQuery(QueryId::PolymorphQuery));
CodeScope* scopeMain = man->root->findFunction("main")->getEntryScope();
Symbol keyS = Symbol{scopeMain->getSymbol("key"), scopeMain};
Expression keyE = scopeMain->getDefinition(keyS);
latereasoning::LateAnnotation answerLA = query->get(keyE);
Expression valueB(Operator::VARIANT, {}); valueB.setValueDouble(1);
auto answerRaw = answerLA.select({valueB}, man->root, man->transcend);
ASSERT_TRUE(answerRaw);
Expression answerE = query->getValue(*answerRaw);
ASSERT_STREQ("b", answerE.getValueString().c_str());
}
TEST(Polymorphs, PSCU_1){
auto man = details::tier1::XreateManager::prepare(R"Code(
Dom = type variant {guard1, guard2}.
guard:: guard1 {
compute = function :: int
{0}
}
guard:: guard2 {
compute = function :: int
{1}
}
test = function:: int; entry
{
xLate = guard2():: Dom.
y1= switch late (xLate:: Dom; alias(xLate)):: int
{
compute():: int; guardkey(xLate)
}.
y1
}
)Code");
man->transcend->addRawScript(R"RAW(
dom(guard1; guard2).
late(Target, Key, Variant, dfa_callguard(Target, Variant)):-
bind(Target, guardkey(Alias));
bind(Key, alias(Alias));
dom(Variant).
)RAW");
man->analyse();
int (*program)() = (int (*)())man->run();
int result = program();
ASSERT_EQ(1, result);
}
+
+TEST(Polymorphs, Doc_FnLvlPoly_1){
+ string example = getDocumentationExampleById("documentation/Concepts/polymorphism.xml", "FnLvlPoly_1");
+ auto man = XreateManager::prepare(move(example));
+ ASSERT_TRUE(true);
+}
+
+TEST(Polymorphs, Doc_LatePoly_1){
+ string example = getDocumentationExampleById("documentation/Concepts/polymorphism.xml", "LatePoly_1");
+ auto man = XreateManager::prepare(move(example));
+ ASSERT_TRUE(true);
+}
\ No newline at end of file
diff --git a/cpp/tests/supplemental/docutils.cpp b/cpp/tests/supplemental/docutils.cpp
new file mode 100644
index 0000000..627daf4
--- /dev/null
+++ b/cpp/tests/supplemental/docutils.cpp
@@ -0,0 +1,54 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ *
+ * \file docutils.cpp
+ * \brief Documentation processing
+ *
+ */
+
+#include "docutils.h"
+
+#include <iostream>
+#include <assert.h>
+#include <libxml/parser.h>
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+
+using namespace std;
+
+std::string
+getDocumentationExampleById(std::string filename, std::string id) {
+ string query = string("(//db:programlisting | //db:code)[@xml:id='") + id + "']";
+ xmlDocPtr doc = xmlParseFile(filename.c_str());
+ if (!doc) {
+ cout << "Can't find documentation file: " << filename << endl;
+ assert(false);
+ return "";
+ }
+
+ xmlXPathContextPtr context = xmlXPathNewContext(doc);
+ xmlXPathRegisterNs(context, BAD_CAST "db", BAD_CAST "http://docbook.org/ns/docbook");
+
+ xmlXPathObjectPtr response = xmlXPathEvalExpression((xmlChar*) query.c_str(), context);
+ xmlXPathFreeContext(context);
+ xmlNodeSetPtr nodeset = response->nodesetval;
+
+ if (nodeset->nodeNr != 1) {
+ cout << "Can't find specified example " << id << endl;
+ assert(false);
+ return "";
+ }
+
+ xmlChar* contentC = xmlNodeListGetString(doc, nodeset->nodeTab[0]->xmlChildrenNode, 1);
+ string content = (char*) contentC;
+ xmlFree(contentC);
+ xmlXPathFreeObject (response);
+
+ assert(content.size() && "Empty example");
+ return content;
+}
+
+void
+replace(std::string& str, const std::string& subA, const std::string& subB) {
+ str.replace(str.find(subA), subA.size(), subB);
+}
\ No newline at end of file
diff --git a/cpp/tests/supplemental/docutils.h b/cpp/tests/supplemental/docutils.h
new file mode 100644
index 0000000..c6c50f4
--- /dev/null
+++ b/cpp/tests/supplemental/docutils.h
@@ -0,0 +1,21 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ *
+ * File: docuils.h
+ * Author: pgess
+ *
+ * Created on November 29, 2018, 3:58 PM
+ *
+ * \brief Documentation processing\
+ */
+
+#ifndef DOC_H
+#define DOC_H
+
+#include <string>
+
+std::string getDocumentationExampleById(std::string filename, std::string id);
+void replace(std::string& str, const std::string& subA, const std::string& subB);
+
+#endif /* DOC_H */
+
diff --git a/cpp/tests/transcend.cpp b/cpp/tests/transcend.cpp
index 5ad0ef3..7795d83 100644
--- a/cpp/tests/transcend.cpp
+++ b/cpp/tests/transcend.cpp
@@ -1,43 +1,58 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*
* Author: pgess <v.melnychenko@xreate.org>
* Created on June 7, 2018, 3:35 PM
*
* \file transcend.cpp
* \brief Transcend's tests
*/
#include "xreatemanager.h"
#include "transcendlayer.h"
+#include "supplemental/docutils.h"
#include <gtest/gtest.h>
using namespace xreate;
using namespace std;
TEST(Transcend, Parse1) {
- std::string script =
-R"Code(
+ std::string script =
+ R"Code(
)Code";
- std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(std::move(script)));
+ std::unique_ptr<details::tier1::XreateManager> man(details::tier1::XreateManager::prepare(std::move(script)));
- std::string scriptTranscend =
-R"Code(
+ std::string scriptTranscend =
+ R"Code(
test1((1)).
test2((1, 2)).
)Code";
- man->transcend->addRawScript(move(scriptTranscend));
- man->analyse();
+ man->transcend->addRawScript(move(scriptTranscend));
+ man->analyse();
- StaticModel solution = man->transcend->query("test1");
- Gringo::Symbol symbTest1 = solution.begin()->second;
- auto answer1 = man->transcend->parse<list<int>>(symbTest1);
- ASSERT_EQ(1, get<0>(answer1).size());
+ StaticModel solution = man->transcend->query("test1");
+ Gringo::Symbol symbTest1 = solution.begin()->second;
+ auto answer1 = man->transcend->parse<list<int>>(symbTest1);
+ ASSERT_EQ(1, get<0>(answer1).size());
- solution = man->transcend->query("test2");
- Gringo::Symbol symbTest2 = solution.begin()->second;
- auto answer2 = get<0>(man->transcend->parse<list<int>>(symbTest2));
- ASSERT_EQ(2, answer2.size());
+ solution = man->transcend->query("test2");
+ Gringo::Symbol symbTest2 = solution.begin()->second;
+ auto answer2 = get<0>(man->transcend->parse<list<int>>(symbTest2));
+ ASSERT_EQ(2, answer2.size());
+}
+
+TEST(Transcend, Doc_Expressions1) {
+ string code = getDocumentationExampleById("documentation/Transcend/transcend.xml", "Expressions1");
+ XreateManager::prepare(move(code));
+
+ ASSERT_TRUE(true);
+}
+
+TEST(Transcend, Doc_Codeblocks1) {
+ string code = getDocumentationExampleById("documentation/Transcend/transcend.xml", "Codeblocks1");
+ XreateManager::prepare(move(code));
+
+ ASSERT_TRUE(true);
}
\ No newline at end of file
diff --git a/documentation-api/latereasoning.graphml b/documentation-api/latetranscend.graphml
similarity index 74%
rename from documentation-api/latereasoning.graphml
rename to documentation-api/latetranscend.graphml
index 25c65a6..808e3a4 100644
--- a/documentation-api/latereasoning.graphml
+++ b/documentation-api/latetranscend.graphml
@@ -1,552 +1,550 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
<!--Created by yEd 3.18.1-->
<key attr.name="Description" attr.type="string" for="graph" id="d0"/>
<key for="port" id="d1" yfiles.type="portgraphics"/>
<key for="port" id="d2" yfiles.type="portgeometry"/>
<key for="port" id="d3" yfiles.type="portuserdata"/>
<key attr.name="Property 1" attr.type="string" for="node" id="d4">
<default xml:space="preserve"/>
</key>
<key attr.name="url" attr.type="string" for="node" id="d5"/>
<key attr.name="description" attr.type="string" for="node" id="d6"/>
<key for="node" id="d7" yfiles.type="nodegraphics"/>
<key for="graphml" id="d8" yfiles.type="resources"/>
<key attr.name="url" attr.type="string" for="edge" id="d9"/>
<key attr.name="description" attr.type="string" for="edge" id="d10"/>
<key for="edge" id="d11" yfiles.type="edgegraphics"/>
<graph edgedefault="directed" id="G">
<data key="d0" xml:space="preserve"/>
<node id="n0" yfiles.foldertype="group">
<data key="d7">
<y:TableNode configuration="YED_TABLE_NODE">
- <y:Geometry height="493.14999999999986" width="1170.1863671874994" x="160.62499999999994" y="-344.2918182373043"/>
+ <y:Geometry height="500.24892252285287" width="1181.2763671875" x="150.0" y="-350.5"/>
<y:Fill color="#ECF5FF" color2="#0042F440" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="21.578125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="163.6533203125" x="503.26652343749976" xml:space="preserve" y="4.0">Late Reasonng Diagram</y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="30.484375" x="143.7578125" xml:space="preserve" y="33.0">Pass<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_0" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="76.181640625" x="507.92236328124983" xml:space="preserve" y="33.0">Interpretation<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_1" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" hasText="false" height="4.0" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="4.0" x="583.0931835937497" y="244.57499999999993">
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="20.7578125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="169.08056640625" x="506.097900390625" xml:space="preserve" y="4.0">Late Transcend Diagram</y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="30.677734375" x="149.2061328125003" xml:space="preserve" y="33.0">Pass<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_0" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="74.7109375" x="519.7477148437504" xml:space="preserve" y="33.0">Interpretation<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_1" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" hasText="false" height="4.0" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="4.0" x="588.63818359375" y="248.12446126142643">
<y:LabelModel>
<y:SmartNodeLabelModel distance="4.0"/>
</y:LabelModel>
<y:ModelParameter>
<y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
</y:ModelParameter>
</y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="60.61328125" x="941.7997265624995" xml:space="preserve" y="33.0">Transcend<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_2" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="60.6953125" x="952.8487109375001" xml:space="preserve" y="33.0">Transcend<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_2" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="yed.table.section.color" value="#7192b2"/>
<y:Property class="java.lang.Double" name="yed.table.header.height" value="24.0"/>
<y:Property class="java.awt.Color" name="yed.table.lane.color.main" value="#c4d7ed"/>
<y:Property class="java.awt.Color" name="yed.table.lane.color.alternating" value="#abc8e2"/>
<y:Property class="java.awt.Color" name="yed.table.header.color.alternating" value="#abc8e2"/>
<y:Property class="java.lang.String" name="yed.table.lane.style" value="lane.style.columns"/>
<y:Property class="java.awt.Color" name="yed.table.header.color.main" value="#c4d7ed"/>
</y:StyleProperties>
<y:State autoResize="true" closed="false" closedHeight="80.0" closedWidth="100.0"/>
<y:Insets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
- <y:BorderInsets bottom="71" bottomF="71.11204177848737" left="0" leftF="0.0" right="48" rightF="48.0" top="0" topF="0.0"/>
+ <y:BorderInsets bottom="67" bottomF="66.74892252285287" left="0" leftF="0.0" right="48" rightF="48.0" top="0" topF="0.0"/>
<y:Table autoResizeTable="true" defaultColumnWidth="120.0" defaultMinimumColumnWidth="80.0" defaultMinimumRowHeight="50.0" defaultRowHeight="80.0">
<y:DefaultColumnInsets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
<y:DefaultRowInsets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
<y:Insets bottom="0.0" left="0.0" right="0.0" top="30.0"/>
<y:Columns>
- <y:Column id="column_0" minimumWidth="80.0" width="318.0">
+ <y:Column id="column_0" minimumWidth="80.0" width="329.0900000000006">
<y:Insets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
</y:Column>
<y:Column id="column_1" minimumWidth="80.0" width="456.02636718749966">
<y:Insets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
</y:Column>
<y:Column id="column_2" minimumWidth="80.0" width="396.15999999999974">
<y:Insets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
</y:Column>
</y:Columns>
<y:Rows>
- <y:Row height="439.14999999999986" id="row_0" minimumHeight="50.0">
+ <y:Row height="446.24892252285287" id="row_0" minimumHeight="50.0">
<y:Insets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
</y:Row>
</y:Rows>
</y:Table>
</y:TableNode>
</data>
<graph edgedefault="directed" id="n0:">
<node id="n0::n0">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="75.0" width="111.0" x="183.12499999999994" y="-162.89181823730445"/>
+ <y:Geometry height="75.0" width="111.0" x="169.5" y="-137.5"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.46875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="91.19775390625" x="9.901123046875" xml:space="preserve" y="26.0625">LateReasoning
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="33.046875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="97.18359375" x="6.908203125" xml:space="preserve" y="25.40625">LateReasoning
Scope<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="40.03515625" x="35.482421875" xml:space="preserve" y="28.46875">fvffdfd<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="32.125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="54.501953125" x="28.2490234375" xml:space="preserve" y="21.4375">vdffldkjfd
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="36.68359375" x="37.158203125" xml:space="preserve" y="28.796875">fvffdfd<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="30.8125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="51.35546875" x="29.822265625" xml:space="preserve" y="22.09375">vdffldkjfd
fdfdfd<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="pass" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n1">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="145.7890625" width="119.3984375" x="350.92578124999994" y="-183.78634948730445"/>
+ <y:Geometry height="145.7890625" width="119.3984375" x="340.30078125" y="-172.89453125"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="49.703125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="91.19775390625" x="14.100341796875" xml:space="preserve" y="26.0625">LateReasoning
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="47.5703125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="97.18359375" x="11.107421875" xml:space="preserve" y="25.40625">LateReasoning
DFAPass
Decorator<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="40.03515625" x="39.681640625" xml:space="preserve" y="63.86328125">fvffdfd<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="32.125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="54.501953125" x="32.4482421875" xml:space="preserve" y="56.83203125">vdffldkjfd
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="36.68359375" x="41.357421875" xml:space="preserve" y="64.19140625">fvffdfd<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="30.8125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="51.35546875" x="34.021484375" xml:space="preserve" y="57.48828125">vdffldkjfd
fdfdfd<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="pass" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve">registerLateScope
processAnnotations</y:MethodLabel>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n2">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="34.0" width="100.0" x="360.62499999999994" y="-267.39181823730434"/>
+ <y:Geometry height="34.0" width="100.0" x="350.0" y="-267.0"/>
<y:Fill color="#CCCCCC" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="57.0791015625" x="21.46044921875" xml:space="preserve" y="3.0">DFAPass<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="18.5234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="61.078125" x="19.4609375" xml:space="preserve" y="3.0">DFAPass<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n3">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="28.0" width="100.0" x="160.62499999999994" y="-62.64181823730439"/>
+ <y:Geometry height="28.0" width="100.0" x="150.0" y="-39.0"/>
<y:Fill color="#CCCCCC" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="74.49072265625" x="12.754638671875" xml:space="preserve" y="3.0">ICodeScope<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="18.5234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="79.12451171875" x="10.437744140625" xml:space="preserve" y="3.0">ICodeScope<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n4">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="66.0" width="100.0" x="180.62499999999994" y="-12.641818237304335"/>
+ <y:Geometry height="66.0" width="100.0" x="175.0" y="17.0"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.46875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="73.32275390625" x="13.338623046875" xml:space="preserve" y="26.0625">LateSymbol
-Recognized<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="18.5234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="94.3271484375" x="2.83642578125" xml:space="preserve" y="25.40625">LateParameter<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="analysis" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n5">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="28.0" width="100.0" x="355.52692893401" y="-7.124275090096319"/>
+ <y:Geometry height="28.0" width="100.0" x="350.0" y="11.0"/>
<y:Fill color="#CCCCCC" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="63.50927734375" x="18.245361328125" xml:space="preserve" y="3.0">DFAGraph<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="18.5234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="69.0" x="15.5" xml:space="preserve" y="3.0">DFAGraph<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n6">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="131.671875" width="169.4140625" x="618.825" y="-187.6180682373045"/>
+ <y:Geometry height="131.671875" width="169.4140625" x="615.29296875" y="-190.8359375"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.46875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="91.19775390625" x="39.108154296875" xml:space="preserve" y="26.0625">LateReasoning
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="33.046875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="97.18359375" x="36.115234375" xml:space="preserve" y="25.40625">LateReasoning
Compiler<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="compilation" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve">processSwitchLateStatement
compileAutoExpand
findKeys</y:MethodLabel>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n7">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="130.3828125" width="107.18359375" x="1020.4432031249999" y="-193.78322448730432"/>
+ <y:Geometry height="130.3828125" width="107.18359375" x="1021.408203125" y="-190.19140625"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="49.703125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="91.19775390625" x="7.992919921875" xml:space="preserve" y="26.0625">LateReasoning
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="47.5703125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="97.18359375" x="5.0" xml:space="preserve" y="25.40625">LateReasoning
Transcend
Decorator<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="aux" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve">queryLate
processSolution</y:MethodLabel>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n8">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="43.0" width="100.0" x="1023.8349999999996" y="-290.2918182373043"/>
+ <y:Geometry height="43.0" width="100.0" x="1025.0" y="-296.5"/>
<y:Fill color="#CCCCCC" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.46875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="66.15625" x="16.921875" xml:space="preserve" y="3.0">Transcend
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="33.046875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="69.74267578125" x="15.128662109375" xml:space="preserve" y="3.0">Transcend
Layer<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n9">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="95.859375" width="116.552734375" x="1166.2586328124994" y="-184.52150573730432"/>
+ <y:Geometry height="95.859375" width="116.552734375" x="1166.7236328125" y="-172.9296875"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.46875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="100.61767578125" x="7.967529296875" xml:space="preserve" y="26.0625">LateAnnotations
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="33.046875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="106.552734375" x="5.0" xml:space="preserve" y="25.40625">LateAnnotations
Group<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="aux" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve">select()</y:MethodLabel>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n10">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="61.0" width="100.0" x="1174.5349999999999" y="-27.841818237304324"/>
+ <y:Geometry height="61.0" width="100.0" x="1175.0" y="-30.5"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.46875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="68.49853515625" x="15.750732421875" xml:space="preserve" y="26.0625">Late
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="33.046875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="72.5927734375" x="13.70361328125" xml:space="preserve" y="25.40625">Late
Annotation<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="aux" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n11">
<data key="d7">
<y:GenericNode configuration="com.yworks.flowchart.cloud">
- <y:Geometry height="40.8125" width="70.6953125" x="1042.7898074036061" y="36.933639984208185"/>
+ <y:Geometry height="40.8125" width="70.6953125" x="1039.65234375" y="29.59375"/>
<y:Fill color="#E8EEF7" color2="#B7C9E3" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="32.125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="60.61328125" x="5.041015625" xml:space="preserve" y="4.34375">Transcend
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="30.8125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="60.6953125" x="5.0" xml:space="preserve" y="5.0">Transcend
program<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="n0::n12">
<data key="d7">
<y:ShapeNode>
- <y:Geometry height="46.57249999999999" width="61.377578124999985" x="279.5392109375001" y="-250.9342499999999"/>
+ <y:Geometry height="46.57249999999999" width="61.377578124999985" x="269.3112109375" y="-248.28625"/>
<y:Fill color="#00FFFF" transparent="false"/>
<y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="32.125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="51.00390625" x="5.186835937500007" xml:space="preserve" y="7.2237499999999955">DFA
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="30.8125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="52.017578125" x="4.680000000000007" xml:space="preserve" y="7.8799999999999955">DFA
PassDec<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:Shape type="star8"/>
</y:ShapeNode>
</data>
</node>
<node id="n0::n13">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="43.046875" width="97.78271484375" x="652.5486425781247" y="-267.2114374999999"/>
+ <y:Geometry height="43.046875" width="97.78271484375" x="651.108642578125" y="-271.5234375"/>
<y:Fill color="#C0C0C0" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.46875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="84.1708984375" x="6.805908203125" xml:space="preserve" y="3.0">Interpretation
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="33.046875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="87.78271484375" x="5.0" xml:space="preserve" y="3.0">Interpretation
Scope<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n14">
<data key="d7">
<y:ShapeNode>
- <y:Geometry height="53.00758629441623" width="53.52207177982234" x="956.9023549730332" y="-244.3871637055837"/>
+ <y:Geometry height="53.00758629441623" width="53.52207177982234" x="948.2389641100888" y="-251.5037931472081"/>
<y:Fill color="#00FFFF" transparent="false"/>
<y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="46.1875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.57421875" x="9.473926514911227" xml:space="preserve" y="3.410043147208114">LR
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="44.21875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.673828125" x="9.424121827411227" xml:space="preserve" y="4.394418147208114">LR
Trans
Dec<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:Shape type="star8"/>
</y:ShapeNode>
</data>
</node>
</graph>
</node>
<node id="n1">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="34.24520648967541" width="63.841796875" x="1270.3964872557149" y="197.92477876106204"/>
+ <y:Geometry height="46.57249999999999" width="63.841796875" x="1268.0791015625" y="201.71375"/>
<y:Fill color="#C0C0C0" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.46875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="51.76611328125" x="6.037841796875" xml:space="preserve" y="3.0">AST
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="33.046875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="53.841796875" x="5.0" xml:space="preserve" y="3.0">AST
getType<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="40.03515625" x="11.9033203125" xml:space="preserve" y="8.091353244837705">fvffdfd<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="32.125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="54.501953125" x="4.669921875" xml:space="preserve" y="1.0601032448377055">vdffldkjfd
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="36.68359375" x="13.5791015625" xml:space="preserve" y="14.583124999999995">fvffdfd<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="30.8125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="51.35546875" x="6.2431640625" xml:space="preserve" y="7.8799999999999955">vdffldkjfd
fdfdfd<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n2">
<data key="d5" xml:space="preserve"/>
<data key="d7">
<y:UMLClassNode>
- <y:Geometry height="28.0" width="152.0234375" x="1113.5850178316282" y="162.5569180494092"/>
+ <y:Geometry height="28.0" width="152.0234375" x="1116.0556640625" y="161.0"/>
<y:Fill color="#C0C0C0" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="135.61865234375" x="8.202392578125" xml:space="preserve" y="3.0">dereferenceSlaveType<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="18.5234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="142.0234375" x="5.0" xml:space="preserve" y="3.0">dereferenceSlaveType<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<edge id="n0::e0" source="n0::n5" target="n0::n4">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
- <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
+ <y:Path sx="-32.4930059982301" sy="-0.8679073476494636" tx="0.0" ty="0.0">
+ <y:Point x="375.0" y="50.0"/>
+ </y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e1" source="n0::n0" target="n0::n4">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="-8.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e2" source="n0::n0" target="n0::n3">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="-28.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="none"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e3" source="n0::n1" target="n0::n0">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
- <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
- <y:Point x="324.62499999999994" y="-110.89181823730445"/>
- <y:Point x="324.62499999999994" y="-125.39181823730445"/>
- </y:Path>
+ <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="diamond" target="none"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e4" source="n0::n1" target="n0::n2">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="white_delta"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e5" source="n0::n7" target="n0::n9">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
- <y:Point x="1149.2849999999996" y="-128.59181823730432"/>
- <y:Point x="1149.2849999999996" y="-136.59181823730432"/>
+ <y:Point x="1150.0" y="-125.0"/>
+ <y:Point x="1150.0" y="-125.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="diamond" target="none"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e6" source="n0::n9" target="n0::n10">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
- <y:Point x="1224.5349999999994" y="-59.216818237304324"/>
- <y:Point x="1224.5349999999999" y="-59.216818237304324"/>
+ <y:Point x="1225.0" y="-50.0"/>
+ <y:Point x="1225.0" y="-50.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="diamond" target="none"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e7" source="n0::n7" target="n0::n8">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
- <y:Point x="1074.0349999999999" y="-193.34181823730432"/>
- <y:Point x="1073.8349999999996" y="-193.34181823730432"/>
+ <y:Point x="1075.0" y="-200.0"/>
+ <y:Point x="1075.0" y="-200.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="white_delta"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e8" source="n0::n5" target="n0::n11">
<data key="d11">
<y:GenericEdge configuration="com.yworks.edge.framed">
<y:Path sx="0.055000000000063665" sy="3.253818237304529" tx="0.0" ty="0.0">
- <y:Point x="405.5819289340101" y="57.33988998420841"/>
+ <y:Point x="400.05500000000006" y="50.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="3.0"/>
<y:Arrows source="none" target="standard"/>
</y:GenericEdge>
</data>
</edge>
<edge id="n0::e9" source="n0::n11" target="n0::n7">
<data key="d11">
<y:GenericEdge configuration="com.yworks.edge.framed">
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="line" width="3.0"/>
<y:Arrows source="none" target="standard"/>
</y:GenericEdge>
</data>
</edge>
<edge id="n0::e10" source="n0::n6" target="n0::n10">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
- <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
+ <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
+ <y:Point x="700.0" y="0.0"/>
+ </y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e11" source="n0::n6" target="n0::n13">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="white_diamond" target="none"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e12" source="n0::n1" target="n0::n5">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e13" source="n0::n12" target="n0::n1">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e14" source="n0::n14" target="n0::n7">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e0" source="n0::n10" target="n1">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
- <y:Point x="1224.5349999999999" y="215.04738200589975"/>
+ <y:Point x="1225.0" y="225.0"/>
</y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e1" source="n0::n10" target="n2">
<data key="d9" xml:space="preserve"/>
<data key="d11">
<y:PolyLineEdge>
- <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
- <y:Point x="1189.5967365816282" y="2.6581817626956763"/>
- </y:Path>
+ <y:Path sx="-34.93826341837166" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
</graph>
<data key="d8">
<y:Resources/>
</data>
</graphml>
diff --git a/documentation-api/latex.graphml b/documentation-api/latex.graphml
index 818a882..96adb5a 100644
--- a/documentation-api/latex.graphml
+++ b/documentation-api/latex.graphml
@@ -1,819 +1,819 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
<!--Created by yEd 3.18.1-->
<key attr.name="Description" attr.type="string" for="graph" id="d0"/>
<key for="port" id="d1" yfiles.type="portgraphics"/>
<key for="port" id="d2" yfiles.type="portgeometry"/>
<key for="port" id="d3" yfiles.type="portuserdata"/>
<key attr.name="url" attr.type="string" for="node" id="d4"/>
<key attr.name="description" attr.type="string" for="node" id="d5"/>
<key for="node" id="d6" yfiles.type="nodegraphics"/>
<key for="graphml" id="d7" yfiles.type="resources"/>
<key attr.name="url" attr.type="string" for="edge" id="d8"/>
<key attr.name="description" attr.type="string" for="edge" id="d9"/>
<key for="edge" id="d10" yfiles.type="edgegraphics"/>
<graph edgedefault="directed" id="G">
<data key="d0" xml:space="preserve"/>
<node id="n0" yfiles.foldertype="group">
<data key="d6">
<y:TableNode configuration="YED_TABLE_NODE">
<y:Geometry height="301.2117579823405" width="799.186140432126" x="180.6552734375001" y="-192.46513398234035"/>
<y:Fill color="#ECF5FF" color2="#0042F440" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="21.578125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="40.54052734375" x="379.322806544188" xml:space="preserve" y="4.0">Latex</y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="68.59375" x="136.27219521606293" xml:space="preserve" y="33.0">Compilation<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_0" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="60.61328125" x="652.3354998071259" xml:space="preserve" y="33.0">Transcend<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_1" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="76.181640625" x="415.52732011962587" xml:space="preserve" y="33.0">Interpretation<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_2" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="20.7578125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="40.6943359375" x="379.245902247313" xml:space="preserve" y="4.0">Latex</y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="67.36328125" x="136.88742959106293" xml:space="preserve" y="33.0">Compilation<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_0" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="60.6953125" x="652.2944841821259" xml:space="preserve" y="33.0">Transcend<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_1" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="74.7109375" x="416.26267168212587" xml:space="preserve" y="33.0">Interpretation<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_2" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="yed.table.section.color" value="#7192b2"/>
<y:Property class="java.lang.Double" name="yed.table.header.height" value="24.0"/>
<y:Property class="java.awt.Color" name="yed.table.lane.color.main" value="#c4d7ed"/>
<y:Property class="java.awt.Color" name="yed.table.lane.color.alternating" value="#abc8e2"/>
<y:Property class="java.awt.Color" name="yed.table.header.color.alternating" value="#abc8e2"/>
<y:Property class="java.lang.String" name="yed.table.lane.style" value="lane.style.columns"/>
<y:Property class="java.awt.Color" name="yed.table.header.color.main" value="#c4d7ed"/>
</y:StyleProperties>
<y:State autoResize="true" closed="false" closedHeight="80.0" closedWidth="100.0"/>
<y:Insets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
<y:BorderInsets bottom="33" bottomF="33.42941839334418" left="0" leftF="0.0" right="106" rightF="106.4960000000001" top="0" topF="0.0"/>
<y:Table autoResizeTable="true" defaultColumnWidth="120.0" defaultMinimumColumnWidth="80.0" defaultMinimumRowHeight="50.0" defaultRowHeight="80.0">
<y:DefaultColumnInsets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
<y:DefaultRowInsets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
<y:Insets bottom="0.0" left="0.0" right="0.0" top="30.0"/>
<y:Columns>
<y:Column id="column_0" minimumWidth="80.0" width="341.13814043212585">
<y:Insets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
</y:Column>
<y:Column id="column_2" minimumWidth="80.0" width="224.95999999999992">
<y:Insets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
</y:Column>
<y:Column id="column_1" minimumWidth="80.0" width="233.0880000000002">
<y:Insets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
</y:Column>
</y:Columns>
<y:Rows>
<y:Row height="247.2117579823405" id="row_0" minimumHeight="50.0">
<y:Insets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
</y:Row>
</y:Rows>
</y:Table>
</y:TableNode>
</data>
<graph edgedefault="directed" id="n0:">
<node id="n0::n0">
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="43.046875" width="94.88818359375" x="189.2599082031249" y="25.265718750000076"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.46875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="79.638671875" x="7.624755859375" xml:space="preserve" y="3.0">ExtraArgs
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="33.046875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="84.88818359375" x="5.0" xml:space="preserve" y="3.0">ExtraArgs
FnInvocation<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n1">
<data key="d4" xml:space="preserve"/>
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="57.5703125" width="86.9599609375" x="193.20801953124987" y="-76.87315624999997"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="49.703125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="72.21826171875" x="7.370849609375" xml:space="preserve" y="3.0">Latex
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="47.5703125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="76.9599609375" x="5.0" xml:space="preserve" y="3.0">Latex
BruteScope
Dec<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n2">
<data key="d4" xml:space="preserve"/>
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="30.0" width="114.39453125" x="180.6552734375001" y="-138.46513398234035"/>
<y:Fill color="#CCCCCC" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="98.16748046875" x="8.113525390625" xml:space="preserve" y="3.0">ICodeScopeUnit<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="18.5234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="104.39453125" x="5.0" xml:space="preserve" y="3.0">ICodeScopeUnit<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n3">
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="57.5703125" width="102.82275390625" x="334.36462304687484" y="-77.20915624999992"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="49.703125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="86.69091796875" x="8.06591796875" xml:space="preserve" y="3.0">Latex
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="47.5703125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="92.82275390625" x="5.0" xml:space="preserve" y="3.0">Latex
BruteFunction
Dec<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n4">
<data key="d4" xml:space="preserve"/>
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="28.0" width="97.75732421875" x="335.14147744262544" y="-137.1598241279998"/>
<y:Fill color="#C0C0C0" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="82.4189453125" x="7.669189453125" xml:space="preserve" y="3.0">IFunctionUnit<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="18.5234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="87.75732421875" x="5.0" xml:space="preserve" y="3.0">IFunctionUnit<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n5">
<data key="d4" xml:space="preserve"/>
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="30.0" width="128.12451171875" x="570.5217441406251" y="-126.27999999999997"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="111.783203125" x="8.170654296875" xml:space="preserve" y="3.0">getSubjectDomain<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="18.5234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="118.12451171875" x="5.0" xml:space="preserve" y="3.0">getSubjectDomain<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n6">
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="43.046875" width="51.57177734375" x="820.4941113281249" y="-76.30628124999996"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.46875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="38.56298828125" x="6.50439453125" xml:space="preserve" y="3.0">Latex
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="33.046875" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="41.57177734375" x="5.0" xml:space="preserve" y="3.0">Latex
Query<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n7">
<data key="d4" xml:space="preserve"/>
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="28.0" width="55.18359375" x="818.161820119626" y="-135.99964825599963"/>
<y:Fill color="#C0C0C0" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="42.35888671875" x="6.412353515625" xml:space="preserve" y="3.0">IQuery<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="18.5234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="45.18359375" x="5.0" xml:space="preserve" y="3.0">IQuery<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n8">
<data key="d4" xml:space="preserve"/>
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="30.0" width="114.4072265625" x="580.2603867187496" y="-59.25599999999994"/>
<y:Fill color="#C0C0C0" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="98.1611328125" x="8.123046875" xml:space="preserve" y="3.0">collapseColumn<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="18.5234375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="104.4072265625" x="5.0" xml:space="preserve" y="3.0">collapseColumn<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
<node id="n0::n9">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="46.677734375" x="756.9171328125" y="-116.655824128"/>
<y:Fill color="#00FFFF" transparent="false"/>
<y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="32.125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.978515625" x="5.849609375" xml:space="preserve" y="-1.0625">Latex
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="30.8125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="36.677734375" x="5.0" xml:space="preserve" y="-0.40625">Latex
Query<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:Shape type="star6"/>
</y:ShapeNode>
</data>
</node>
<node id="n0::n10">
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="57.5703125" width="86.48447265624998" x="592.3191508036989" y="17.74689310665596"/>
<y:Fill color="#C0C0C0" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="49.703125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="68.48583984375" x="8.999316406249989" xml:space="preserve" y="3.0">represent
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="47.5703125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="74.08447265625" x="6.199999999999989" xml:space="preserve" y="3.0">represent
Trans
Expression<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
</y:UML>
</y:UMLClassNode>
</data>
</node>
</graph>
</node>
<node id="n1" yfiles.foldertype="group">
<data key="d4" xml:space="preserve"/>
<data key="d6">
<y:ProxyAutoBoundsNode>
<y:Realizers active="0">
<y:GroupNode>
- <y:Geometry height="630.4203124999996" width="839.7171093750001" x="181.1570562500006" y="171.51831875000016"/>
+ <y:Geometry height="629.5999999999996" width="839.7171093750001" x="181.1570562500006" y="172.33863125000016"/>
<y:Fill color="#CAECFF80" transparent="false"/>
<y:BorderStyle color="#666699" type="dotted" width="1.0"/>
- <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.578125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="839.7171093750001" x="0.0" xml:space="preserve" y="0.0">Latex script</y:NodeLabel>
+ <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="20.7578125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="839.7171093750001" x="0.0" xml:space="preserve" y="0.0">Latex script</y:NodeLabel>
<y:Shape type="roundrectangle"/>
<y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
<y:NodeBounds considerNodeLabelSize="true"/>
<y:Insets bottom="5" bottomF="5.0" left="5" leftF="5.0" right="5" rightF="5.0" top="5" topF="5.0"/>
- <y:BorderInsets bottom="30" bottomF="30.0" left="152" leftF="152.3701171875" right="85" rightF="85.42316406250006" top="61" topF="60.842187499999795"/>
+ <y:BorderInsets bottom="30" bottomF="30.0" left="143" leftF="143.02587890625" right="85" rightF="85.42316406250006" top="61" topF="60.842187499999795"/>
</y:GroupNode>
<y:GroupNode>
<y:Geometry height="50.0" width="102.0" x="181.1570562500006" y="172.33863125000016"/>
<y:Fill color="#CAECFF80" transparent="false"/>
<y:BorderStyle color="#666699" type="dotted" width="1.0"/>
- <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.578125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="102.0" x="0.0" xml:space="preserve" y="0.0">Latex script</y:NodeLabel>
+ <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="20.7578125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="102.0" x="0.0" xml:space="preserve" y="0.0">Latex script</y:NodeLabel>
<y:Shape type="roundrectangle"/>
<y:State closed="true" closedHeight="50.0" closedWidth="102.0" innerGraphDisplayEnabled="false"/>
<y:NodeBounds considerNodeLabelSize="true"/>
<y:Insets bottom="5" bottomF="5.0" left="5" leftF="5.0" right="5" rightF="5.0" top="5" topF="5.0"/>
<y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
</y:GroupNode>
</y:Realizers>
</y:ProxyAutoBoundsNode>
</data>
<graph edgedefault="directed" id="n1:">
<node id="n1::n0" yfiles.foldertype="group">
<data key="d6">
<y:TableNode configuration="com.yworks.bpmn.Pool">
- <y:Geometry height="507.9999999999998" width="591.923828125" x="338.5271734375006" y="258.93863124999996"/>
+ <y:Geometry height="507.9999999999998" width="601.26806640625" x="329.1829351562506" y="258.93863124999996"/>
<y:Fill color="#FFF2BC" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="21.578125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="l" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="40.54052734375" x="4.0" xml:space="preserve" y="233.7297363281249">Latex</y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="40.076171875" x="33.0" xml:space="preserve" y="89.48278808593773">Output<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_0" inside="true"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="63.794921875" x="33.0" xml:space="preserve" y="266.29272460937545">Processing<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_1" inside="true"/></y:ModelParameter></y:NodeLabel>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="31.169921875" x="33.0" xml:space="preserve" y="435.5843505859376">Input<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_2" inside="true"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="20.7578125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="l" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="40.6943359375" x="4.0" xml:space="preserve" y="233.6528320312499">Latex</y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="40.0234375" x="33.0" xml:space="preserve" y="89.50915527343773">Output<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_0" inside="true"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="63.361328125" x="33.0" xml:space="preserve" y="266.50952148437545">Processing<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_1" inside="true"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="30.689453125" x="33.0" xml:space="preserve" y="435.8245849609376">Input<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_2" inside="true"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property name="y.view.tabular.TableNodePainter.ALTERNATE_ROW_STYLE">
<y:SimpleStyle fillColor="#474A4340" lineColor="#000000" lineType="line" lineWidth="1.0"/>
</y:Property>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property name="y.view.tabular.TableNodePainter.ALTERNATE_COLUMN_SELECTION_STYLE">
<y:SimpleStyle fillColor="#474A4380" lineColor="#000000" lineType="line" lineWidth="3.0"/>
</y:Property>
<y:Property name="y.view.tabular.TableNodePainter.ALTERNATE_ROW_SELECTION_STYLE">
<y:SimpleStyle fillColor="#474A4380" lineColor="#000000" lineType="line" lineWidth="3.0"/>
</y:Property>
<y:Property class="java.awt.Color" name="POOL_LANE_COLOR_ALTERNATING" value="#ffffff"/>
<y:Property class="java.awt.Color" name="POOL_LANE_COLOR_MAIN" value="#ffffcc"/>
<y:Property class="java.lang.String" name="POOL_LANE_STYLE" value="LANE_STYLE_ROWS"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="POOL_TYPE_LANE"/>
<y:Property name="y.view.tabular.TableNodePainter.ALTERNATE_COLUMN_STYLE">
<y:SimpleStyle fillColor="#474A4340" lineColor="#000000" lineType="line" lineWidth="1.0"/>
</y:Property>
</y:StyleProperties>
<y:State autoResize="true" closed="false" closedHeight="80.0" closedWidth="100.0"/>
<y:Insets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
- <y:BorderInsets bottom="25" bottomF="25.499999999999886" left="0" leftF="0.0" right="24" rightF="23.56306093749936" top="5" topF="4.938631249999958"/>
+ <y:BorderInsets bottom="25" bottomF="25.499999999999886" left="9" leftF="9.34423828125" right="24" rightF="23.56306093749936" top="5" topF="4.938631249999958"/>
<y:Table autoResizeTable="true" defaultColumnWidth="360.0" defaultMinimumColumnWidth="30.0" defaultMinimumRowHeight="30.0" defaultRowHeight="107.0">
<y:DefaultColumnInsets bottom="3.0" left="3.0" right="3.0" top="20.0"/>
<y:DefaultRowInsets bottom="3.0" left="20.0" right="3.0" top="3.0"/>
<y:Insets bottom="0.0" left="30.0" right="0.0" top="0.0"/>
<y:Columns>
- <y:Column id="column_0" minimumWidth="30.0" width="538.923828125">
+ <y:Column id="column_0" minimumWidth="30.0" width="548.26806640625">
<y:Insets bottom="3.0" left="3.0" right="3.0" top="20.0"/>
</y:Column>
</y:Columns>
<y:Rows>
<y:Row height="179.04174804687545" id="row_0" minimumHeight="50.703125">
<y:Insets bottom="3.0" left="20.0" right="3.0" top="3.0"/>
</y:Row>
<y:Row height="198.296875" id="row_1" minimumHeight="50.703125">
<y:Insets bottom="3.0" left="20.0" right="3.0" top="3.0"/>
</y:Row>
<y:Row height="107.66137695312432" id="row_2" minimumHeight="50.703125">
<y:Insets bottom="3.0" left="20.0" right="3.0" top="3.0"/>
</y:Row>
</y:Rows>
</y:Table>
</y:TableNode>
</data>
<graph edgedefault="directed" id="n1::n0:">
<node id="n1::n0::n0">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Artifact.withShadow">
- <y:Geometry height="30.0" width="64.021484375" x="520.9099859375006" y="695.9386312499998"/>
+ <y:Geometry height="30.0" width="64.021484375" x="543.7902309604715" y="695.9386312499998"/>
<y:Fill color="#FFFFFFE6" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="32.125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="54.953125" x="4.5341796875" xml:space="preserve" y="-1.0625">Demand
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="30.8125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="54.021484375" x="5.0" xml:space="preserve" y="-0.40625">Demand
upstream<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ARTIFACT_TYPE_ANNOTATION"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
<node id="n1::n0::n1">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Activity.withShadow">
- <y:Geometry height="55.0" width="96.060546875" x="401.5379156250006" y="683.4386312499998"/>
+ <y:Geometry height="55.0" width="122.08203125" x="388.5271734375006" y="683.4386312499998"/>
<y:Fill color="#FFFFFFE6" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#123EA2" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="85.41015625" x="5.3251953125" xml:space="preserve" y="18.46875">scope_demand<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="118.08203125" x="2.0" xml:space="preserve" y="18.796875">latex_scope_demand<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="com.yworks.yfiles.bpmn.view.TaskTypeEnum" name="com.yworks.bpmn.taskType" value="TASK_TYPE_ABSTRACT"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ACTIVITY_TYPE"/>
<y:Property class="com.yworks.yfiles.bpmn.view.ActivityTypeEnum" name="com.yworks.bpmn.activityType" value="ACTIVITY_TYPE_TASK"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
<node id="n1::n0::n2">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Activity.withShadow">
<y:Geometry height="30.0" width="150.078125" x="620.8816656250006" y="695.9386312499998"/>
<y:Fill color="#FFFFFFE6" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#123EA2" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="139.462890625" x="5.3076171875" xml:space="preserve" y="5.96875">latex_registered_subjects<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="140.078125" x="5.0" xml:space="preserve" y="6.296875">latex_registered_subjects<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="com.yworks.yfiles.bpmn.view.TaskTypeEnum" name="com.yworks.bpmn.taskType" value="TASK_TYPE_ABSTRACT"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ACTIVITY_TYPE"/>
<y:Property class="com.yworks.yfiles.bpmn.view.ActivityTypeEnum" name="com.yworks.bpmn.activityType" value="ACTIVITY_TYPE_TASK"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
<node id="n1::n0::n3">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Activity.withShadow">
<y:Geometry height="55.0" width="110.7265625" x="394.2049078125006" y="526.9386312499997"/>
<y:Fill color="#FFFFFFE6" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#123EA2" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="100.439453125" x="5.1435546875" xml:space="preserve" y="18.46875">scope_demand(1)<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="100.7265625" x="5.0" xml:space="preserve" y="18.796875">scope_demand(1)<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="com.yworks.yfiles.bpmn.view.TaskTypeEnum" name="com.yworks.bpmn.taskType" value="TASK_TYPE_ABSTRACT"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ACTIVITY_TYPE"/>
<y:Property class="com.yworks.yfiles.bpmn.view.ActivityTypeEnum" name="com.yworks.bpmn.activityType" value="ACTIVITY_TYPE_TASK"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
<node id="n1::n0::n4">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Activity.withShadow">
<y:Geometry height="30.0" width="74.046875" x="412.5447515625006" y="395.93863124999996"/>
<y:Fill color="#FFFFFFE6" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#123EA2" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="63.7890625" x="5.12890625" xml:space="preserve" y="5.96875">fn_demand<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="64.046875" x="5.0" xml:space="preserve" y="6.296875">fn_demand<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="com.yworks.yfiles.bpmn.view.TaskTypeEnum" name="com.yworks.bpmn.taskType" value="TASK_TYPE_ABSTRACT"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ACTIVITY_TYPE"/>
<y:Property class="com.yworks.yfiles.bpmn.view.ActivityTypeEnum" name="com.yworks.bpmn.activityType" value="ACTIVITY_TYPE_TASK"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
<node id="n1::n0::n5">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Activity.withShadow">
<y:Geometry height="30.0" width="58.02734375" x="556.4070562500006" y="395.93863124999996"/>
<y:Fill color="#FFFFFFE6" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#123EA2" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="48.912109375" x="4.5576171875" xml:space="preserve" y="5.96875">decision<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="48.02734375" x="5.0" xml:space="preserve" y="6.296875">decision<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="com.yworks.yfiles.bpmn.view.TaskTypeEnum" name="com.yworks.bpmn.taskType" value="TASK_TYPE_ABSTRACT"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ACTIVITY_TYPE"/>
<y:Property class="com.yworks.yfiles.bpmn.view.ActivityTypeEnum" name="com.yworks.bpmn.activityType" value="ACTIVITY_TYPE_TASK"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
<node id="n1::n0::n6">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Activity.withShadow">
<y:Geometry height="30.0" width="110.7265625" x="530.0574468750006" y="539.4386312499997"/>
<y:Fill color="#FFFFFFE6" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#123EA2" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="100.439453125" x="5.1435546875" xml:space="preserve" y="5.96875">scope_demand(2)<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="100.7265625" x="5.0" xml:space="preserve" y="6.296875">scope_demand(2)<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="com.yworks.yfiles.bpmn.view.TaskTypeEnum" name="com.yworks.bpmn.taskType" value="TASK_TYPE_ABSTRACT"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ACTIVITY_TYPE"/>
<y:Property class="com.yworks.yfiles.bpmn.view.ActivityTypeEnum" name="com.yworks.bpmn.activityType" value="ACTIVITY_TYPE_TASK"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
<node id="n1::n0::n7">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Activity.withShadow">
<y:Geometry height="30.0" width="85.3671875" x="725.9371343750006" y="396.33863124999993"/>
<y:Fill color="#FFFFFFE6" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#FF0000" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="76.931640625" x="4.2177734375" xml:space="preserve" y="5.96875">late(decision)<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="75.3671875" x="5.0" xml:space="preserve" y="6.296875">late(decision)<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="com.yworks.yfiles.bpmn.view.TaskTypeEnum" name="com.yworks.bpmn.taskType" value="TASK_TYPE_ABSTRACT"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ACTIVITY_TYPE"/>
<y:Property class="com.yworks.yfiles.bpmn.view.ActivityTypeEnum" name="com.yworks.bpmn.activityType" value="ACTIVITY_TYPE_TASK"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
<node id="n1::n0::n8">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Activity.withShadow">
<y:Geometry height="30.0" width="62.703125" x="737.2691656250006" y="539.4386312499997"/>
<y:Fill color="#FFFFFFE6" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#123EA2" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="52.6328125" x="5.03515625" xml:space="preserve" y="5.96875">scope_fn<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="52.703125" x="5.0" xml:space="preserve" y="6.296875">scope_fn<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="com.yworks.yfiles.bpmn.view.TaskTypeEnum" name="com.yworks.bpmn.taskType" value="TASK_TYPE_ABSTRACT"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ACTIVITY_TYPE"/>
<y:Property class="com.yworks.yfiles.bpmn.view.ActivityTypeEnum" name="com.yworks.bpmn.activityType" value="ACTIVITY_TYPE_TASK"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
<node id="n1::n0::n9">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Activity.withShadow">
<y:Geometry height="30.0" width="122.08203125" x="388.5271734375006" y="283.8772624999999"/>
<y:Fill color="#FFFFFFE6" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#123EA2" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="110.44140625" x="5.8203125" xml:space="preserve" y="5.96875">fn_demand_ordered<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="112.08203125" x="5.0" xml:space="preserve" y="6.296875">fn_demand_ordered<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="com.yworks.yfiles.bpmn.view.TaskTypeEnum" name="com.yworks.bpmn.taskType" value="TASK_TYPE_ABSTRACT"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ACTIVITY_TYPE"/>
<y:Property class="com.yworks.yfiles.bpmn.view.ActivityTypeEnum" name="com.yworks.bpmn.activityType" value="ACTIVITY_TYPE_TASK"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
<node id="n1::n0::n10">
<data key="d6">
<y:GenericNode configuration="com.yworks.bpmn.Activity.withShadow">
<y:Geometry height="30.0" width="83.99609375" x="819.8918468750012" y="539.8772624999995"/>
<y:Fill color="#FFFFFFE6" color2="#D4D4D4CC" transparent="false"/>
<y:BorderStyle color="#123EA2" type="line" width="1.0"/>
- <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.0625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="73.99609375" x="5.0" xml:space="preserve" y="5.96875">latex_symbol<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.40625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="74.03125" x="4.982421875" xml:space="preserve" y="6.296875">latex_symbol<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:StyleProperties>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
<y:Property class="com.yworks.yfiles.bpmn.view.TaskTypeEnum" name="com.yworks.bpmn.taskType" value="TASK_TYPE_ABSTRACT"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
<y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
<y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="ACTIVITY_TYPE"/>
<y:Property class="com.yworks.yfiles.bpmn.view.ActivityTypeEnum" name="com.yworks.bpmn.activityType" value="ACTIVITY_TYPE_TASK"/>
</y:StyleProperties>
</y:GenericNode>
</data>
</node>
</graph>
</node>
</graph>
</node>
<edge id="n0::e0" source="n0::n1" target="n0::n0">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e1" source="n0::n1" target="n0::n6">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
<y:Point x="574.9961395520005" y="48.36017587200024"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="white_diamond" target="none"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e2" source="n0::n3" target="n0::n6">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
<y:Point x="647.1881395520005" y="-6.167824127999808"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="white_diamond" target="none"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e3" source="n0::n3" target="n0::n5">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e4" source="n0::n1" target="n0::n5">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e5" source="n0::n5" target="n0::n8">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e6" source="n0::n1" target="n0::n2">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="white_delta"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e7" source="n0::n3" target="n0::n4">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="white_delta"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e8" source="n0::n6" target="n0::n7">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="white_delta"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e9" source="n0::n9" target="n0::n6">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n0::e10" source="n0::n1" target="n0::n10">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="29.599999999999966" sy="0.0" tx="0.0" ty="17.599999999999994">
<y:Point x="307.961387131824" y="-46.26795064334408"/>
<y:Point x="308.6879999999999" y="63.33204935665589"/>
</y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::e0" source="n1::n0" target="n1::n0::n5">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="-13.01307826711736" sy="-170.1693115234376" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e0" source="n1::n0::n0" target="n1::n0::n1">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e1" source="n1::n0::n3" target="n1::n0::n1">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e2" source="n1::n0::n4" target="n1::n0::n3">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e3" source="n1::n0::n5" target="n1::n0::n4">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e4" source="n1::n0::n5" target="n1::n0::n2">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
<y:Point x="695.9207281250006" y="411.93863124999996"/>
</y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e5" source="n1::n0::n6" target="n1::n0::n4">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e6" source="n1::n0::n6" target="n1::n0::n5">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="crows_foot_one_mandatory" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e7" source="n1::n0::n7" target="n1::n0::n8">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::e1" source="n1::n0::n7" target="n1::n0">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="-139.5127241750008" ty="-154.9999999999999">
<y:Point x="768.6207281250006" y="357.93863124999996"/>
</y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e8" source="n1::n0::n7" target="n1::n0::n2">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="13.0" ty="0.0">
<y:Point x="708.9207281250006" y="411.33863124999993"/>
</y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e9" source="n1::n0::n9" target="n1::n0::n4">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="-19.0" sy="0.0" tx="-19.0" ty="0.0"/>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e10" source="n1::n0::n9" target="n1::n0::n7">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="19.0" ty="0.0">
<y:Point x="787.6207281250006" y="298.8772624999999"/>
</y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="n1::n0::e11" source="n1::n0::n4" target="n1::n0::n7">
<data key="d8" xml:space="preserve"/>
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="0.0" tx="-20.0" ty="0.0">
<y:Point x="460.0" y="410.93863124999996"/>
<y:Point x="460.0" y="357.0"/>
<y:Point x="748.6207281250006" y="357.0"/>
</y:Path>
<y:LineStyle color="#000000" type="dashed" width="1.0"/>
<y:Arrows source="none" target="plain"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
</graph>
<data key="d7">
<y:Resources/>
</data>
</graphml>
diff --git a/documentation/Concepts/context.xml b/documentation/Concepts/context.xml
new file mode 100644
index 0000000..8f9fc49
--- /dev/null
+++ b/documentation/Concepts/context.xml
@@ -0,0 +1,311 @@
+<?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">
+ <title>Context</title>
+
+ <para>Computer program and its internal states and transitions between them
+ can be looked at from two different points of view: control flow and data
+ flow. Any information that can be derived from control flow is called
+ <emphasis>context</emphasis> in Xreate.</para>
+
+ <para>Data that can be captured from analysing control flow consists of two
+ parts as follows:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Instantaneous state or current place within the code. It's fully
+ determined by current code block as well as hierarchy of all its
+ respective parents</para>
+ </listitem>
+
+ <listitem>
+ <para>Historical data determined by all previous visited code
+ blocks</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Xreate allows to express Context and reason about it by employing
+ block level annotations. See <link
+ xlink:href="/w/transcend#code-blocks-and-context">syntax</link>.</para>
+
+ <section>
+ <title>Examples of Context Usage: Suggestions and Requirements</title>
+
+ <programlisting xml:id="Examples_1">//someStringFn = function:: string {...}
+
+main = function:: string; entry
+{
+ context:: env(utf8).
+ someStringFn()
+}</programlisting>
+
+ <para>Example shows annotation <code>env(utf8)</code> which conveys some
+ information about the block thus distinguishing it from the others. It
+ allows compiler to apply specific compilation rules for this block.
+ Suppose <code>someStringFn</code> has different specializations for
+ different environments. Now it's possible to invoke specialization
+ tailored for UTF8 environment.</para>
+
+ <para>Different story with the next example. Here we want to stipulate
+ context properties:</para>
+
+ <programlisting xml:id="Examples_2">guard:: safe
+{
+ crucialOperation = function:: int
+ {0}
+}
+
+main = function:: int; entry
+{
+ context:: env(safe).
+ crucialOperation()
+}</programlisting>
+
+ <para>Function <code>crucialOperation</code> has only one specialization
+ <code>safe</code> in the example. If context does not provide required
+ environment <code>env(safe)</code>compiler can't find appropriate
+ specialization and halts with compilation error. This is a way for
+ function to express requirements or <emphasis>contract</emphasis> to a
+ context it works within.</para>
+ </section>
+
+ <section>
+ <title>Context Propagation</title>
+
+ <para>Context of a particular code block contains not only its own
+ annotations but also reflects parent blocks as well as previously executed
+ blocks. It's achieved by <emphasis>context propagation</emphasis>.</para>
+
+ <para>Context propagation means that nested blocks
+ <emphasis>inherit</emphasis> context of parents. Moreover callee
+ function's context inherits caller's one. Example:</para>
+
+ <programlisting xml:id="ContextPropagation1">//requires 'safe' context
+guard:: safe
+{
+ crucialOperation = function(a:: int, b::int):: int
+ { 0 }
+}
+
+test = function:: int; entry {
+ //blockA
+ context:: env(safe).
+
+ range = [1..10]:: [int].
+ loop fold(range-&gt;x::int, 0-&gt;acc):: int {
+ //blockB
+ crucialOperation(x, acc) // In the nested scope env(safe) context still accessible
+ }
+} </programlisting>
+
+ <para>This is example of <emphasis>nested scope context
+ propagation</emphasis>. It demonstrates availability of a
+ <code>env(safe)</code> annotation in the context of the nested block
+ <code>blockB</code> despite being declared in <code>blockA</code>.</para>
+
+ <para>More complicated case is <emphasis>inter-function context
+ propagation</emphasis>. It means context propagates through
+ "caller/callee" relation: callee inherits caller context. The example
+ below demonstrates this:</para>
+
+ <programlisting xml:id="ContextPropagation2">toSI = function(x:: int):: int
+ { 0 }
+
+calculate = function(x:: int):: int
+{
+ y = toSI(x):: int.
+ y
+}
+
+test = function:: int; entry
+{
+ context:: units(millimeters).
+ calculate(10)
+} </programlisting>
+
+ <para>Suppose <code>calculate()</code>works with values measured in
+ different units. It normalizes each value by invoking <code>toSI()</code>
+ conversion. One approach is to keep unit information for each variable
+ independently. But if we know that entire program or a part of it works
+ only with specific unit we can register it in a context,
+ <code>units(millimeters)</code>in this example, and
+ <code>calculate()</code> and its callees inherit context allowing compiler
+ to generate code tailored for specific units only.</para>
+
+ <para>Context is determined by reasoning over control flow graph of a
+ program during compilation. Let's consider example:</para>
+
+ <programlisting xml:id="ContextPropagation3">calcInches = function:: int
+{
+ context:: precision(accurate); units(inches).
+ calculate()
+}
+
+calcMillis = function:: int
+{
+ context:: precision(accurate); units(millimeters).
+ calculate()
+}
+
+calculate = function:: int
+ { 0 }</programlisting>
+
+ <para>Client functions <code>calcInches()</code> and
+ <code>calcMillis()</code> each define context with a configuration options
+ for a main routine <code>calculate()</code>. Unlike in previous example,
+ there are several callers with different context here.</para>
+
+ <para>In case with several possible control flow paths each introducing
+ different context, only path invariant context annotations could be
+ determined at compile time. Obviously, annotations that are the same for
+ each possible alternative are part of context in any case. It's
+ <code>precision(accurate)</code> in the example above, since both client
+ function define it. More formally, statically determined context is a
+ conjunction of all possible contexts of a given code block.</para>
+
+ <para>However the other annotation <code>units(...)</code> differs from
+ path to path and can be determined only during runtime. Late Transcend
+ functionality is used for this. Context reasoning employing Late Transcend
+ called <emphasis>Late Context</emphasis> or <emphasis>Latex</emphasis> for
+ short.</para>
+ </section>
+
+ <section>
+ <title>Latex (Late Context)</title>
+
+ <para>Static(compile-time) context reasoning is <emphasis>weak</emphasis>
+ since it's able to infer only partial context, consisting of properties
+ that are true for all possible paths leading in a CFG to a given block.
+ Other part consists of set of possible properties that depends on exact
+ path in CFG. Such uncertainty possible to resolve during runtime once it's
+ known which path is chosen.</para>
+
+ <para>It leads to a necessity of having //late context// - context data
+ gathered on relevant occasion at runtime to determine right
+ decisions.</para>
+
+ <para>However, for any cases it's crucial to consider //possible
+ contexts// that is, contexts valid only under certain conditions.</para>
+
+ <para>Latex approach can be described as follows:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>All possible alternative contexts for the given scope computed
+ during compile time used as input for Latex</para>
+ </listitem>
+
+ <listitem>
+ <para>All possible paths are numerated and specific latex parameter
+ created to keep data about current path.</para>
+ </listitem>
+
+ <listitem>
+ <para>Late parameter used as guard for Late Transcend facts context
+ consists of.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>As of now, to convey late context data latex parameter injected into
+ function signature as hidden parameter.</para>
+
+ <programlisting xml:id="Latex1">import raw ("core/control-context.lp").
+
+compute = function:: int
+ { 0 }
+
+computeFast = function:: int {
+ context:: computation(fast).
+
+ compute()
+}
+
+computePrecisely = function:: int {
+ context:: computation(precise).
+
+ compute()
+}
+
+test = function(cmnd:: int):: int; entry {
+ context:: arithmetic(iee754).
+
+ if (cmnd &gt; 0)::int {computePrecisely()} else {computeFast()}
+}</programlisting>
+
+ <para>Static scope</para>
+
+ <para/>
+
+ <programlisting>import raw ("core/control-context.lp")
+case context:: computation(fast) {
+ compute = function:: num {
+ 0
+ }
+}
+
+case context:: computation(precise) {
+ compute = function:: num {
+ 0
+ }
+}
+
+executeComputation= function:: num {
+ compute()
+}
+
+test = function(cmnd:: num):: num; entry {
+ if (cmnd &gt; 0)::num {
+ context:: computation(fast).
+ executeComputation()
+
+ } else {
+ context:: computation(precise).
+ executeComputation()
+ }
+}</programlisting>
+
+ <para>To sum up, context consists of two complements parts: on the one
+ hand //static(early) context// denotes compile time inferences,</para>
+
+ <para>and on the other hand, //late(dynamic) context// denotes annotations
+ decided upon at runtime.</para>
+
+ <note>
+ <para>Since it is possible to determine number of possible contexts with
+ diffent outcome decisions, it is possible to determine least size for
+ late context data enough to identify each possible variant. (In example
+ above, since there are only two specializons of `compute`, 1 bit is
+ enough to convey late context data)</para>
+ </note>
+ </section>
+
+ <section>
+ <title>Remarks on late context implementation</title>
+
+ <para/>
+
+ <para>To return to a last example, in order to correcly determine
+ `compute`'s context it's necessary:</para>
+
+ <para>After such transformation signature of `executeComputation` looks
+ like `executeComputation(__hidden_context_data__)`,</para>
+
+ <para>where `hidden_context_data` holds data enough to determine within
+ `executeComputation` which one of possible contexts it encountered
+ with.</para>
+
+ <para>Consequently, `executeComputation` decides which specialization of
+ `compute` should be called based on `hidden_context_data` value.</para>
+
+ <para>Only at run-time there is enough information for
+ `executeComputation` to decide what specialization of `compute` to
+ call.</para>
+ </section>
+</chapter>
diff --git a/documentation/Concepts/polymorphism.xml b/documentation/Concepts/polymorphism.xml
new file mode 100644
index 0000000..d1e0674
--- /dev/null
+++ b/documentation/Concepts/polymorphism.xml
@@ -0,0 +1,182 @@
+<?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">
+ <title>Polymorphism</title>
+
+ <para><emphasis>Polymorphism</emphasis> is an umbrella term to denote number
+ of techniques across different programing paradigms. They all share the same
+ intention to provide ability easily recombine software components in a
+ different way with as little as possible manual work on developer's side. It
+ serves two major goals: <emphasis>specialization</emphasis>, when software,
+ initially designed to support wide range of use cases, is configured for
+ concrete particular case and <emphasis>extension</emphasis> - adapting
+ software to an environment and conditions it was not specifically designed
+ for.</para>
+
+ <para>In course of software engineering evolution, number of polymorphism
+ techniques was proposed and experimented with, all suited for different
+ use-cases. Xreate presents generalized and elegant approach that
+ exhaustively covers wide landscape of polymorphism variations.</para>
+
+ <para>Polymorphism in Xreate can be applied on two levels:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>Functions level</emphasis>. Function in Xreate can have
+ a multiple <emphasis>specializations</emphasis> and polymorphism is
+ compiler's ability to decide which exactly specialization to use
+ depending on various factors</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>Modules level</emphasis>. Multiple modules can provide
+ the same service for users. <link
+ xlink:href="/w/syntax/modules/#modules-resolution">Modules
+ Resolution</link> is a process to decide which exactly module to
+ use</para>
+ </listitem>
+ </itemizedlist>
+
+ <section>
+ <title>Function Level Polymorphism</title>
+
+ <para>Basic idea is to allow developer to define several functions with
+ the same name or, in other words, several
+ <emphasis>specializations</emphasis>. Caller code then invokes necessary
+ function by its shared name but can't directly specify particular
+ specialization. Exact specialization to be invoked is decided later by
+ decision process called <emphasis>polymorphism resolution</emphasis>
+ carried out by Transcend. This indirect invocation approach gives enough
+ flexibility to use or replace different specializations depending on
+ various conditions during compile time as well as at runtime.</para>
+
+ <para>Please refer to <link
+ xlink:href="/w/syntax#function-specializations">syntax</link> for details
+ about function specializations. Each specialization must have unique
+ <emphasis>guard</emphasis>(among all specializations with the same name)
+ to be discernible from others. To summarize, function invocation is a two
+ layered process, in which client code specifies callee function's shared
+ name, and polymorphism resolution specifies specialization guard if
+ needed.</para>
+
+ <para>For an example, assume that we develop program to operate under
+ specified time constraints. To model implementation suitable for real time
+ environment, one specialization of <code>crucialOperation</code> is
+ defined with <code>env(realtime)</code> guard i.e. satisfies some fixed
+ execution time constraints. Caller <code>main</code> specifies only
+ function name <code>crucialOperation</code> thus delegating decision on
+ guard to a polymorphism resolution done elsewhere, based on environment's
+ constraints the code is executed in.</para>
+
+ <programlisting xml:id="FnLvlPoly_1">guard:: env(realtime)
+{
+ crucialOperation = function:: int
+ { 0 }
+}
+
+main = function:: int; entry
+{
+ crucialOperation()
+} </programlisting>
+ </section>
+
+ <section>
+ <title>Polymorphism Resolution</title>
+
+ <synopsis>SYNTAX:
+**dfa_callguard**(//call-site-ref//, //guard//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>call-site-ref</emphasis> reference to a call site in
+ AST</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>guard</emphasis> resolved function specialization
+ guard</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>When compiler encounters function invocation that has several
+ specialization it refers to the table <code>dfa_callguard</code> to find
+ out which specialization to call. It must have entry with appropriate
+ <code>guard</code> for every invocation site <code>call-site-ref</code> of
+ a polymorphic function. Polymorphism resolution is a process of filling
+ out <code>dfa_callguard</code> for a compiler based on custom Transcend
+ rules reflecting one or another polymorphism strategy.</para>
+ </section>
+
+ <section>
+ <title>Late Polymorphism</title>
+
+ <para>Late Polymorphism is an extension to allow polymorphism resolution
+ to be based on data known only at runtime, i.e. resolve function
+ specializations dynamically. The Idea is to use Late Transcend to access
+ runtime data. See <link xlink:href="/w/transcend/latetranscend">Late
+ Transcend</link> for details.</para>
+
+ <para>Example below demonstrates <code>test</code> invoking polymorphic
+ function <code>compute</code>:</para>
+
+ <programlisting xml:id="LatePoly_1">Strategy = type variant {fast, precise}.
+
+guard:: fast
+{
+ compute = function:: int
+ {0}
+}
+
+guard:: precise
+{
+ compute = function:: int
+ {1}
+}
+
+test = function(s:: Strategy; alias(strategy)):: int; entry
+{
+ switch late (s):: int
+ {
+ compute():: int; guardalias(strategy)
+ }
+}</programlisting>
+
+ <para>Function <code>compute</code> has two specializations,
+ <code>fast</code> and <code>precise</code>. We see that <code>test</code>
+ gets parameter <code>s</code> that dictates exact strategy to use.
+ Clearly, resolution should work dynamically to cope with cases like this,
+ for value of parameter <code>s</code> not only is unknown at compile time,
+ but it can change with each <code>test</code> execution.</para>
+
+ <para>Operation Switch Late is compiled into several branches, two in this
+ case, each branch executing appropriate <code>compute</code>
+ specialization. Correct branch executed depending on current
+ <code>s</code> value. Custom annotations <code>alias(Alias)</code> and
+ <code>guardalias(Alias)</code> used to assign an alias in order to specify
+ which parameter to use for as basis for resolution</para>
+ </section>
+
+ <section>
+ <title>Auto Expansion of Late Parameters</title>
+
+ <para>In previous example, switch late operation was used to facilitate
+ calling of polymorphic function with late polymorphism resolution. It's
+ not that convenient to wrap each invocation by switch late whenever there
+ is need to call late polymorphic function. Specifically to handle cases
+ like this, compiler uses late parameter auto expansion technique.</para>
+
+ <para>If compiler discovers that <code>late(dfa_callguard())</code> entry
+ exists for current invocation and it does not have enclosing switch late
+ already, compiler automatically generates different branches that invoke
+ relevant specializations and transfers control to a branch depending on
+ late parameter value. In other words invocation implicitly wrapped into
+ switch late instruction if needed.</para>
+ </section>
+</chapter>
diff --git a/documentation/Syntax/modules.xml b/documentation/Syntax/modules.xml
index 0803122..cf61944 100644
--- a/documentation/Syntax/modules.xml
+++ b/documentation/Syntax/modules.xml
@@ -1,256 +1,262 @@
<?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">
<title>Modules</title>
<para>Xreate offers <emphasis>modules</emphasis> as a way to organize and
reuse source code. For simplicity, it's implemented as one file—one
module.</para>
<para>Modules often require prior compilation of other modules for correct
work. It leads to a problem of a <emphasis>resolution</emphasis> where
required module is located. Especially since modern software products
usually have complicated and volatile file structure depending on exact
configuration and platform to build. Common practice is to rely on build
configuration tools to provide exact path for each module.</para>
<para>For this reason Xreate interferes as little as possible with
resolution. Language does not support for module to directly specify any
path be it relative or absolute of other required modules. Also compiler
does not search modules in some predefined list of directories and does not
assume anything about project's file structure. It expects resolution
information already fully defined before compilation.</para>
<para>However compiler has optional built-in functionality to facilitate
resolution. It is the very kind of problems the transcend level suited
excellently for. It is modeled as <emphasis>supply and demand</emphasis>
approach and lets modules to declare what they <emphasis>provide</emphasis>
and what <emphasis>require</emphasis> expressed by annotations. Compiler
then tries to satisfy requirements and find a match. Alternatively, external
tools always can be used.</para>
<section>
<title>Module Headers</title>
- <programlisting>SYNTAX:
-
-module [:: //annotations-list// ] (Full form)
+ <synopsis>SYNTAX:
+**module** [:: //annotations-list// ] (Full form)
{
//module-statement//...
-}
+}</synopsis>
-module :: //annotations-list// . (Simplified form)
+ <synopsis>**module** :: //annotations-list// . (Simplified form)</synopsis>
-module-statement ::=
- | require ( //annotation// ). (1)
- | discover ( //path// ). (2)
- | controller (//path//). (3)</programlisting>
+ <synopsis>//module-statement// ::=
+ | **require** ( //annotation// ). (1)
+ | **discover** ( //path// ). (2)
+ | **controller** (//path//). (3)</synopsis>
<itemizedlist>
<listitem>
<para><code>annotations-list</code> List of annotations delimited by
semicolon</para>
</listitem>
<listitem>
<para><code>annotation</code> Any valid transcend expression</para>
</listitem>
<listitem>
<para><code>path</code> Absolute or relative path to controller</para>
</listitem>
</itemizedlist>
<para>Xreate recognizes number of module management statements. Those
statements should be located in specific section <code>module {...}</code>
of a source code which is called <emphasis>module header</emphasis>.
Module can have several headers. All headers gathered from a whole file
are combined into one before actual processing.</para>
<note>
<para>Modules processing happens before compilation. It means any data
produced in course of compilation is inaccessible at this stage</para>
</note>
</section>
<section>
<title>Requesting Modules</title>
<para>Statement <code>require(..)</code> expresses which modules are
required for correct compilation.</para>
- <programlisting>module {
- require(logger).
+ <programlisting xml:id="Requesting_Modules_1">module {
+ require(logger).
}</programlisting>
<para>In this example module in question requires some other module that
<emphasis>provides</emphasis> feature called <code>logger</code>. There is
no way to specify direct external module location. Instead, module
expresses requirement in abstract form as propositional expression which
is later used by resolution to find exact match.</para>
- <programlisting>module{require(stringslib).}
+ <programlisting xml:id="Requesting_Modules_2">module{require(stringslib).}
processString = function(a:: string):: string
{
- someStrFunc(a)
+ someStrFunc(a)
}
module{require(mathlib).}
processNumber = function(a:: num):: num
{
- someMathFunc(a)
+ someMathFunc(a)
}</programlisting>
<para>Example above demonstrates using several headers in one file. It's
particularly useful if developer finds it convenient to put requirements
near the actual code that uses it. This way it can be easily spotted when
requirements are no more needed. After all, code locality improves
readability.</para>
</section>
<section>
<title>Module Annotations</title>
<para>Module can declare additional information for various uses. This is
expressed by annotations located in the header. They are called module
annotations. For instance, module annotations can be used by module
resolution to find modules that satisfy requirements of others.</para>
- <programlisting>module:: status(obsolete).</programlisting>
+ <programlisting xml:id="ModuleAnnotations_1">module:: status(obsolete).</programlisting>
<para>The example shows module that declares its status. It can be used by
resolution to choose most appropriate module out of number of candidates.
One way to view annotations used by resolution is to treat them as
something that module <emphasis>provides</emphasis>.</para>
<note>
<para>There are no predefined module annotations and developer can put
- arbitrary information there. </para>
+ arbitrary information there.</para>
</note>
</section>
<section>
<title>Modules Resolution</title>
<para>Modules resolution is a process to find exact modules locations that
match requests. Compiler does not search modules in predefined directories
and does not assume anything about project's file structure. In order to
allow developer to determine it themselves the compiler refers to two
transcend tables</para>
- <programlisting>SYNTAX:
- modules_resolution(//request//, //module-resolved//). (1)
- modules_resolution(//request//, //module-resolved//, //module-context//). (2)</programlisting>
+ <synopsis>SYNTAX:
+ **modules_resolution**(//request//, //module-resolved//). (1)
+ **modules_resolution**(//request//, //module-resolved//, //module-context//). (2)</synopsis>
<itemizedlist>
<listitem>
<para><emphasis>request</emphasis> annotation used in statement
<code>request(...)</code></para>
</listitem>
<listitem>
<para><emphasis>module-resolved</emphasis> Path or identifier of a
module that matches request</para>
</listitem>
<listitem>
<para><emphasis>module-context</emphasis> Path or identifier of a
module that requires other module</para>
</listitem>
</itemizedlist>
<para>These tables contain resolved modules for all possible requests.
Form (1) contains requests that should always be resolved to the same
module. Form (2) contains such requests for which resolution depends on
- requesting module <emphasis>module-context</emphasis>. </para>
+ requesting module <emphasis>module-context</emphasis>.</para>
- <programlisting> modules_resolution(numlib, "/path/to/numlib").
+ <programlisting xml:id="ModulesResolution_1"> modules_resolution(numlib, "/path/to/numlib").
modules_resolution(strings, "/path/to/ansi-lib", "moduleA").
modules_resolution(strings, "/path/to/utf8-lib", "moduleB"). </programlisting>
<para>For the example above the compiler would always resolve path to
numerical lib(<code>numlib</code>) as "/path/to/numlib" (line 1). However
<code>strings</code> library would be resolved as "/path/to/ansi-lib" if
requested in <code>moduleA</code>(line 2) and as "/path/to/utf8-lib" if
- requested in <code>moduleB</code>(line 3). </para>
+ requested in <code>moduleB</code>(line 3).</para>
<para>When compiler encounters module request it looks up table
<code>modules_resolution</code> (first or second form) to find path of the
requested module. Tables can be populated by any means be it either
transcend reasoning or external tools.</para>
<note>
- <para>There is no defined order or priority or fallback behavior while
+ <para>There is no defined order or priority or fall back behavior while
looking into tables. If the same request occurs in both tables they are
considered to be ill-formed</para>
</note>
</section>
<section>
<title>Advanced Modules Resolution</title>
<para>Xreate provide additional layer, optional helper to simplify modules
management. It introduces two more built-in statements that can be used in
module header: <emphasis>Discover</emphasis> statement and
<emphasis>Controller</emphasis> Statement.</para>
<itemizedlist>
<listitem>
<para><emphasis>Discover Statement</emphasis> has the form
<code>discover (<emphasis>path</emphasis>)</code>.It allows to specify
directory where compiler would recursively search for all xreate files
and extract module header annotations. It gathers info about all found
source files.</para>
</listitem>
<listitem>
<para><emphasis>Controller Statement</emphasis> has the form
<code>controller (<emphasis>path</emphasis>)</code> and specifies path
to modules resolution controller. Controller is a file that contains
transcend rules in order to process data gathered by discovery and
populate resolution tables as its result of work.</para>
</listitem>
</itemizedlist>
<para>Example below shows 3 modules:</para>
- <programlisting>//First Module
+ <programlisting xml:id="AdvModRes_1">//First Module
module::
name(testA);
provide(superService);
status(needToTestEvenMore).
//Second Module
module::
name(testB);
provide(superService);
status(needToTest).
//Third Module
module {
require(superService).
- discover(“/modules/path/”).
- controller(“/path/to/controller”).
+ discover("/modules/path/").
+ controller("/path/to/controller").
}</programlisting>
<para>Two modules offer the same feature
<code>provide(superSerivce)</code>. Third module requires it and specifies
directory where to look up for needed files. Controller's task is to
populate resolution table if needed module is found and choose appropriate
candidate, if more than one module offer this service.</para>
<para>One way to decide what to choose in this example is to look at
status of both modules. Let score be assigned to each possible status.
Let's say <code>0</code> for <code>status(needToTestEvenMore)</code>,
<code>1</code> for <code>status(needToTest)</code>. Then controller would
proceed with the best scoring module, <code>Second Module</code> in this
case.</para>
</section>
+
+ <section>
+ <title>See Also</title>
+
+ <para>Transcend: <link xlink:href="/w/transcend/modules-api">Modules
+ API</link></para>
+ </section>
</chapter>
diff --git a/documentation/Syntax/syntax.xml b/documentation/Syntax/syntax.xml
index 84567ba..e03c42a 100644
--- a/documentation/Syntax/syntax.xml
+++ b/documentation/Syntax/syntax.xml
@@ -1,639 +1,707 @@
<?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">
<title>Syntax</title>
<para><informaltable>
<tgroup cols="3">
<tbody>
<row>
<entry>Literals, Expressions, Basic Statements</entry>
<entry>Annotations</entry>
<entry>Intrinsics: query</entry>
</row>
<row>
<entry>Identifiers, Code Blocks</entry>
<entry>Branch Statements</entry>
<entry>Interfaces: Extern-C</entry>
</row>
<row>
<entry>Functions</entry>
<entry>Loops</entry>
<entry>Other: Transcend, Versions</entry>
</row>
<row>
<entry>Types</entry>
<entry>Variants</entry>
<entry/>
</row>
</tbody>
</tgroup>
</informaltable></para>
<para>There are number of principles Xreate syntax based on:</para>
<itemizedlist>
<listitem>
<para>Follows SSA form: each identifier is defined only once and no
redefinitions allowed</para>
</listitem>
<listitem>
<para>Order in which identifiers are defined does not influence
computation order. Identifiers are computed in order based on
dependencies between expressions. Order in which identifiers are defines
reflects preferences and what is convenient for a developer.</para>
</listitem>
</itemizedlist>
<section>
<title>Literals and expressions</title>
<para>In Xreate expressions have a form:</para>
- <programlisting>SYNTAX:
-//expression// [:: //type//; //annotations-list// ]</programlisting>
+ <synopsis>SYNTAX:
+//expression// [:: //type//; //annotations-list// ]</synopsis>
<para>where <emphasis>annotation-list</emphasis> is a list of annotations
delimited by semicolon.</para>
<para>Expressions consist of literals and various operations as
follows:</para>
<informaltable>
<tgroup cols="2">
<colspec colwidth="115*"/>
<colspec colwidth="885*"/>
<tbody>
<row>
<entry>Literals</entry>
<entry>numbers, strings: <code>5, "Nimefurahi
kukujua"</code></entry>
</row>
<row>
<entry>Lists, records</entry>
<entry>Record is a collection of elements of different types -
<code>{year = 1934, month = "april"}</code>. List is a collection
of elements of the same type without keys - <code>{16, 8,
3}</code></entry>
</row>
<row>
<entry>Arithmetic operations</entry>
<entry>Basic arithmetic operations: <code>+, -, *,
/</code></entry>
</row>
<row>
<entry>Relations</entry>
<entry><code>==, !=, &lt;&gt;, &lt;, &lt;=, &gt;, &gt;=</code>.
Both <code>!=, &lt;&gt;</code> mean <emphasis>not equal</emphasis>
relation. Examples: <code>8&gt;=3, "Blue" &lt;&gt;
"Green"</code></entry>
</row>
<row>
<entry>List and struct operations</entry>
<entry><emphasis>index</emphasis> operation to access individual
elements of a list or a record. Example: <code>colors = {"Green",
"Blue"}::[string]. color = colors[0]:: string.</code> Record's
element access: <code>date = {year = 1934, month = "april"}. year
= date["year"]</code></entry>
</row>
<row>
<entry>Identifiers</entry>
<entry>Example: <code>a - b</code></entry>
</row>
<row>
<entry>Functions</entry>
<entry>Example: <code>result = isOdd(6).</code></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title>Code Blocks</title>
<para>Block is a list of expressions delimited by period. It has a
<emphasis>body</emphasis> - main expression and optionally some identifier
definitions.</para>
- <programlisting>SYNTAX:
+ <synopsis>SYNTAX:
{
[//ident// = //expression// . | //body-expression// . ]..
-}</programlisting>
+}</synopsis>
- <para>In order to compute code block the compiler search a body expression
- - only one expression that does not have assignment in that block. Result
- of body computation used as a result of block computation. If any
- expression includes identifiers they are computed first.</para>
+ <para>Code block consists of expression called <emphasis>body
+ expression</emphasis> and optional set of assignments to define
+ identifiers used by body expression. Block computation is defined as
+ result of associated body expression computation. If any expression
+ encountered during computation includes some identifiers they are computed
+ first.</para>
- <programlisting>{
+ <programlisting xml:id="CodeBlocks1">test = function:: int
+{
a = 10:: int.
b = 2:: int.
a + b:: int
}</programlisting>
<para>Above is an example of code block which have <code>a+b</code> as a
body expression. In this case body depends on identifiers <code>a</code>,
<code>b</code> so compiler computes both of them beforehand.</para>
<para>Computation order depends only on dependencies between expressions.
This approach has properties as follows:</para>
<itemizedlist>
<listitem>
<para>Mutually independent identifiers can be evaluated in any
order</para>
</listitem>
<listitem>
<para>Identifier gets computed only if it's required by block body
expression or other required identifier</para>
</listitem>
</itemizedlist>
</section>
<section>
<title>Functions</title>
- <programlisting>SYNTAX:
-//function-name// = function ([//argument//:: //type//[; //annotation-list//]]...):: //return-type// [; //annotations//]...
-//function-block//</programlisting>
+ <synopsis>SYNTAX:
+//function-name// = **function** ([//argument//:: //type//[; //annotation-list//]]...):: //return-type// [; //annotations//]...
+//function-block//</synopsis>
<itemizedlist>
<listitem>
<para><emphasis>function-name</emphasis> name of function</para>
</listitem>
<listitem>
<para><emphasis>argument</emphasis> formal parameter. Arguments
delimited by comma.</para>
</listitem>
<listitem>
<para><emphasis>type</emphasis>, <emphasis>return-type</emphasis>
formal parameter and returning value types</para>
</listitem>
<listitem>
<para><emphasis>function-block</emphasis> code block that holds
function definition</para>
</listitem>
<listitem>
<para><emphasis>annotations</emphasis> list of annotations delimited
by semicolon</para>
</listitem>
</itemizedlist>
- <para>Below is an example of a simple function <code>sum</code>. It has
- two arguments and returns their sum. Also it has few annotations. First
+ <para>Below is an example of a function <code>sum</code>. It takes two
+ arguments and returns their sum. Also it has few annotations. First
annotation <code>entry</code> has a special meaning - it depicts entry
point or main function in a program. Second annotation
<code>status(needs_review)</code> is an example that developers can
annotate function using custom annotations to express different
properties.</para>
- <programlisting>sum = function(x:: int, y:: int):: int; entry; status(needs_review)
+ <programlisting xml:id="Functions1">sum = function(x:: int, y:: int):: int; entry; status(needs_review)
{
x+y
}</programlisting>
</section>
+ <section>
+ <title>Function Specializations</title>
+
+ <synopsis>SYNTAX:
+**guard**:: //annotation//
+{
+ //functions-list//
+}</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>annotation</emphasis> Guard expressed by
+ annotation</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>functions-list</emphasis> one or more function that
+ share the same guard</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Xreate allows several functions called
+ <emphasis>specializations</emphasis> to share the same name. This is
+ syntactic foundation for <emphasis>function level polymorphism</emphasis>
+ i.e. ability for compiler to decide which exactly function is called out
+ of several options. Resolution can happen during compilation or at
+ run-time.</para>
+
+ <para>Functions with the same name i.e. different specializations should
+ have unique identifiers called <emphasis>guards</emphasis>. When function
+ is actually called it's expected that resolution is already done at some
+ point before and supplies correct guard to uniquely specify which exactly
+ specialization to call.</para>
+
+ <para>Example:</para>
+
+ <programlisting xml:id="FunctionSpecialization1">guard:: safe_enviroment
+{
+ sum = function (a::int, b::int) :: int
+ {
+ a + b
+ }
+}</programlisting>
+
+ <note>
+ <para>See <link
+ xlink:href="/w/transcend/ast-api#function-s-specializatio">API</link> to
+ get more information on how guards are processed</para>
+ </note>
+ </section>
+
<section>
<title>Branch Statements</title>
<section>
<title>IF Statement</title>
- <programlisting>SYNTAX:
-if (//condition//):: //type// [; //annotations// ]..
+ <synopsis>SYNTAX:
+**if** (//condition//):: //type// [; //annotations// ]..
//block-true//
- else
- //block-false//</programlisting>
+ **else**
+ //block-false//</synopsis>
<para>IF statement executes <emphasis>block-true</emphasis> or
<emphasis>block-false</emphasis> depending on
<emphasis>condition</emphasis> evaluation result.</para>
<para>Example:</para>
- <programlisting>answer = if (question == "Favorite color?"):: string
+ <programlisting xml:id="IfStatement1">answer = if (question == "Favorite color?"):: string
{"Yellow"} else {"Don't know"}.</programlisting>
</section>
<section>
<title>SWITCH Statement</title>
- <programlisting>switch ( //condition// ) :: //type// [; //annotations//]..
-[case ( //guard// ) code-block]..
-case default //default-code-block//
-</programlisting>
+ <synopsis>SYNTAX:
+**switch** ( //condition// ) :: //type// [; //annotations//]..
+[**case** ( //guard// ) code-block]..
+**case default** //default-code-block//
+</synopsis>
<itemizedlist>
<listitem>
<para><emphasis>condition</emphasis>'s result is used to decide
which branch to execute next</para>
</listitem>
<listitem>
<para><emphasis>guard</emphasis> value to match against
<emphasis>condition</emphasis></para>
</listitem>
<listitem>
<para><emphasis>default-code-block</emphasis> executed if no
- appropriate cases found</para>
+ appropriate case found</para>
</listitem>
</itemizedlist>
<para>SWITCH statement evaluation's result is that of branch whose
<emphasis>guard</emphasis> matches
<emphasis>condition</emphasis>.</para>
<para>Example:</para>
- <programlisting>monthName = switch(monthNum) :: string
+ <programlisting xml:id="SwitchStatement1">monthName = switch(monthNum) :: string
case (1) {"Jan"}
case (2) {"Feb"}
case default {"Strange.. Don't know this month"}.</programlisting>
</section>
</section>
<section>
<title>Loop Statements</title>
<section>
<title>LOOP Statement</title>
- <programlisting>SYNTAX:
-loop ( //init-value// -&gt; //accumulator// ) //loop-body//</programlisting>
+ <synopsis>SYNTAX:
+
+**loop** ( //init-value// -&gt; //accumulator// ):: //type// [; //annotations//] //loop-body//</synopsis>
<itemizedlist>
<listitem>
<para><emphasis>init-value</emphasis> initial value loop starts
from</para>
</listitem>
<listitem>
<para><emphasis>accumulator</emphasis> identifier which holds loop's
result after each iteration</para>
</listitem>
</itemizedlist>
<para>For each iteration <emphasis>accumulator</emphasis> assumes result
of previous iteration or <emphasis>init-value</emphasis> during first
iteration. Result of the <emphasis>loop-body</emphasis> evaluation is
used as <emphasis>accumulator</emphasis>'s next iteration value and as
overall loop statement result after the last iteration.</para>
<para>This notation does not have termination condition. Compiler relies
on loop body fixed point in order to decide when to interrupt loop.
Let's consider example:</para>
- <programlisting>//infinite loop
+ <programlisting xml:id="LoopStatement1">COUNTEREXAMPLE
+//infinite loop
answer = loop (2-&gt;x) :: int
{
if(IsPerfect(x)):: int {x} else {x+1}
}.</programlisting>
<para>The example tests numbers for being perfect(sum of all proper
divisors equals to the number itself). While iterating accumulator
<code>x</code> assumes values as follows: 2, 3, 4, 5, 6, 6 ... After it
founds first perfect number any further iteration do not change result
anymore since there is no increment and it continues to test the same
number again and again. Obviously, <code>x=6</code> is a fixed point in
this example. There is no point to continue going through further
iterations once fixed point is evaluated and hence loop can be safely
interrupted.</para>
<para>Compiler relies on manually provided annotations to recognize when
fixed point is reached. There is special annotation <code>final</code>
to specify fixed point for loops. Once expression marked as
<code>final</code> gets evaluated it's assumed to be fixed point or in
other words compiler knows it's the very last iteration after which loop
ends. Correct code for the example above is:</para>
- <programlisting>//loop exits after first perfect number is found
+ <programlisting xml:id="LoopStatement2">//loop exits after first perfect number is found
answer2 = loop (2-&gt;x) :: int
{
if(IsPerfect(x))::int {x:: int; final} else {x+1}
}.</programlisting>
<para>In this case compiler able to recognize when fixed point is
reached to exit loop. After loops is done <code>answer</code> is
<code>6</code>.</para>
</section>
<section>
<title>LOOP FOLD Statement</title>
- <programlisting>SYNTAX:
-loop fold (//list// -&gt; //element//:: //type// [; //annotations//], //init-value// -&gt; //accumulator//):: //type// [; //annotations//]
- //loop-body//</programlisting>
+ <synopsis>SYNTAX:
+
+**loop fold** (//list// **-&gt;** //element//:: //type// [; //annotations//], //init-value// **-&gt;** //accumulator//):: //type// [; //annotations//]
+ //loop-body//</synopsis>
<itemizedlist>
<listitem>
<para><emphasis>list</emphasis> to iterate through</para>
</listitem>
<listitem>
<para><emphasis>element</emphasis> identifier that assumes value of
currently processed list element</para>
</listitem>
<listitem>
<para><emphasis>type</emphasis>, <emphasis>annotations</emphasis>
expression types and optional annotations delimited by
semicolon</para>
</listitem>
<listitem>
<para><emphasis>init-value</emphasis> accumulator's initial value
loop starts with</para>
</listitem>
<listitem>
<para><emphasis>accumulator</emphasis> identifier assumes loop-body
evaluation result after each iteration</para>
</listitem>
</itemizedlist>
- <para>Iterates over <emphasis>list</emphasis> and stores intermediate
- result in <emphasis>accumulator. </emphasis>Overall loop value is a
- accumulator's value after the last iteration. If fixed point is found
- during execution terminates earlier.</para>
+ <para>Iterates over <emphasis>list</emphasis> in order to accumulate
+ result by applying <emphasis>loop-body</emphasis> transformation to each
+ <emphasis>element</emphasis> and intermediate
+ <emphasis>accumulator</emphasis>. Overall loop value is a accumulator's
+ value after the last iteration. If fixed point is found an execution
+ terminates earlier.</para>
+
+ <para>Example shows code excerpt that looks for a minimal element in the
+ given list(and less then initial value <code>10</code>).</para>
- <programlisting>numbers = {4, 8, 7, 1, 5}:: [int].
+ <programlisting xml:id="FoldStatement1">numbers = {4, 8, 7, 1, 5}:: [int].
min = loop fold(numbers-&gt;x:: int, 10-&gt;acc):: int
{
if (acc &gt; x):: int {x} else {acc}
}.</programlisting>
-
- <para>Example shows code excerpt that looks for a minimal element in the
- given list(and less then initial value <code>10</code>).</para>
</section>
<section>
<title>LOOP MAP Statement</title>
- <programlisting>SYNTAX:
-loop map ( //list// -&gt; //element// :: //type// [; //annotations// ] ) :: //type// [; //annotations// ]
- //loop-body//</programlisting>
+ <synopsis>SYNTAX:
+
+**loop map** ( //list// **-&gt;** //element// :: //type// [; //annotations// ] ) :: //type// [; //annotations// ]
+ //loop-body//</synopsis>
<itemizedlist>
<listitem>
<para><emphasis>list</emphasis> to iterate through</para>
</listitem>
<listitem>
<para><emphasis>element</emphasis> identifier that assumes value of
currently processed list element</para>
</listitem>
<listitem>
<para><emphasis>type</emphasis>, <emphasis>annotations</emphasis>
type and optional annotations delimited by semicolon.</para>
</listitem>
<listitem>
<para><emphasis>loop-body</emphasis></para>
</listitem>
</itemizedlist>
- <para>Iterates over list and creates another list with elements that are
- results of a transformation by <emphasis>loop-body</emphasis> of
- iterated elements of the given list.</para>
+ <para>Iterates over input <emphasis>list</emphasis> and applies
+ <emphasis>loop-body</emphasis> transformation to each element. Result is
+ a list that consists of all transformed elements.</para>
- <programlisting>odd_numbers = {1, 3, 5}:: [int].
+ <programlisting xml:id="MapStatement1">odd_numbers = {1, 3, 5}:: [int].
even_numbers = loop map(odd_numbers-&gt;number::int) :: [int]
{ 2 * number }.</programlisting>
<para>Example demonstrates creating <code>even_number</code> list by
multiplying by 2 every element of <code>odd_numbers</code>.</para>
</section>
</section>
<section>
<title>Types</title>
<para>Primitive Types</para>
<informaltable>
<tgroup cols="2">
<colspec colwidth="173*"/>
<colspec colwidth="827*"/>
<tbody>
<row>
<entry><code>num</code></entry>
<entry><code>i32</code> alias. Reserved for auto detected most
appropriate either integral of floating-point number type</entry>
</row>
<row>
<entry><code>int</code></entry>
<entry><code>i32</code> alias. Reserved for auto detected most
appropriate integral number type</entry>
</row>
<row>
<entry><code>float</code></entry>
<entry>Double precision floating-point number</entry>
</row>
<row>
<entry><code>bool</code></entry>
<entry>Boolean type</entry>
</row>
<row>
<entry><code>i8, i32, i64</code></entry>
<entry>Signed integers. 8, 32, 64 bit wide respectively</entry>
</row>
<row>
<entry><code>string</code></entry>
<entry>Pointer to a null terminated ANSI char string. Reserved for
auto detected most appropriate string type.</entry>
</row>
<row>
<entry><code>*</code></entry>
<entry>Unspecified type. Example <code>x = {amount=200,
currency="USD"}::*.</code></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>Compound types:</para>
<informaltable>
<tgroup cols="2">
<colspec colwidth="312*"/>
<colspec colwidth="688*"/>
<tbody>
<row>
<entry><code>[ <emphasis>element-type</emphasis> ]</code></entry>
<entry>List of elements of the same type
<emphasis>element-type</emphasis>. Example: <code>[int]</code> -
list of <code>int</code>'s</entry>
</row>
<row>
<entry><code>{<emphasis>key</emphasis>::
<emphasis>type</emphasis>, ...}</code></entry>
<entry>List of elements of different type possibly with named
keys. Examples: <code>{int, string}</code>, <code>{name::string,
age::int}</code></entry>
</row>
<row>
<entry><code>variant {<emphasis>option</emphasis> ::
(<emphasis>type</emphasis>, ...}, ...}</code></entry>
<entry>Holds a single element of type of one out of number of
options. Examples: <code>variant {FullAddress:: {string, string,
string}, ShortAddress:: {string}}</code></entry>
</row>
<row>
<entry><code>slave <emphasis>identifier</emphasis></code></entry>
<entry>Type determined by Transcend. Example: <code>slave
unit_test</code></entry>
</row>
<row>
<entry><code><emphasis>compound-type</emphasis> [
<emphasis>key</emphasis> ]</code></entry>
<entry>Accessing elements of compound type. Example: <code>Bio =
type {birth_year:: int, name:: string}. Year = type
Bio[birth_year].</code></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>New types defined as:</para>
- <programlisting><emphasis>type-name</emphasis> = type (<emphasis>parameters</emphasis>...) <emphasis>type-definition</emphasis> .</programlisting>
+ <synopsis>SYNTAX:
+
+//type-name// = **type** (//parameters//...) //type-definition// .</synopsis>
<para>Example:</para>
- <programlisting>Tuple = type {string, int}.
+ <programlisting xml:id="Types1">Tuple = type {string, int}.
Int = type Tuple[1]. //accessing by index</programlisting>
</section>
<section>
<title>Variants and SWITCH VARIANT Instruction</title>
- <programlisting>SYNTAX:
-switch variant ( condition [-&gt; alias ] [:: type [; annotations... ] ] ) :: type [; annotations... ]
-[ case ( guard ) case-branch ]...</programlisting>
+ <synopsis>SYNTAX:
+
+**switch variant** ( //condition// [-&gt; //alias// ] [:: //type// [; //annotations//... ] ] ) :: type [; annotations... ]
+[ **case** ( //guard// ) //case-branch// ]...</synopsis>
<itemizedlist>
<listitem>
<para><emphasis>condition</emphasis> expression of variant type</para>
</listitem>
<listitem>
<para><emphasis>alias</emphasis> identifier to denote unwrapped
content of condition withing case branches.</para>
</listitem>
<listitem>
<para><emphasis>guard</emphasis> name of variant to match against
actual condition's variant</para>
</listitem>
<listitem>
<para><emphasis>case-branch</emphasis> block of code to execute in
case of matched variant. Content is accessible by using alias Within
the branch .</para>
</listitem>
</itemizedlist>
<para>Sometimes it is useful for a variable to have value of different
types depending on some conditions, in other words it has
<emphasis>variant type</emphasis>.</para>
<para>Let's consider example with variable <emphasis>month</emphasis> of
variant type <emphasis>Month</emphasis>:</para>
- <programlisting>Month = type variant {
- MonName:: {string},
+ <programlisting xml:id="Variants1">Month = type variant {
+ MonName :: {string},
MonNumber:: {int}
}.
-month = MonName("April"):: Month.</programlisting>
+test = function:: Month
+{
+ month = MonName("April"):: Month.
+ month
+}</programlisting>
<para>Variable <code>month</code> holds value of either
<code>string</code> or <code>int</code> type. Value is not accessible
directly. It should be <emphasis>unwrapped</emphasis> before using. Xreate
supports <code>switch variant</code> instruction for this
operation.</para>
<para>As an example below is <code>nextMonth</code> function
definition:</para>
<programlisting>nextMonth = funcrtion(month:: Month):: Month
{
switch variant(month):: Month
case (MonName)
{
//
}
- case
+ case (MonNumber)
}</programlisting>
</section>
</chapter>
diff --git a/documentation/Transcend/ast-api.xml b/documentation/Transcend/ast-api.xml
new file mode 100644
index 0000000..75f4cb0
--- /dev/null
+++ b/documentation/Transcend/ast-api.xml
@@ -0,0 +1,450 @@
+<?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">
+ <title>AST API</title>
+
+ <para>In order to reason about program, code model is translated into form
+ suited for processing by Transcend. Translation details are described
+ below.</para>
+
+ <section>
+ <title>Expression Annotations: 'bind'</title>
+
+ <synopsis>SYNTAX:
+**bind**(//symbol-ref//, //annotation//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>symbol-ref</emphasis> assigned reference to the
+ expression or identifier</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>annotation</emphasis> expression's annotation</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Generated for each expression's annotation. Example:</para>
+
+ <programlisting>x = 5:: int; expected(even_number).</programlisting>
+
+ <para>gets translated into:</para>
+
+ <programlisting>bind(v(1,-2,0), expected(even_number)).</programlisting>
+ </section>
+
+ <section>
+ <title>Code Block: 'scope'</title>
+
+ <synopsis>SYNTAX:
+**scope**(//scope-ref//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>scope-ref</emphasis> reference to the code
+ block</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Declares code block under its unique reference identifier.</para>
+
+ <para>Example:</para>
+
+ <programlisting>{
+ x = 0.3:: float.
+ y = 0.8:: float.
+
+ x + y
+}</programlisting>
+
+ <para>Translation result: <code>scope(2).</code></para>
+ </section>
+
+ <section>
+ <title>Code Block Annotations: 'bind_scope'</title>
+
+ <synopsis>SYNTAX:
+**bind_scope**(//scope-ref//, //annotation//, strong) (1)
+**bind_scope**(//scope-ref//, //annotation//, weak(..)) (2)
+</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>scope-ref</emphasis> child block's reference</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>annotation</emphasis> code block's annotation</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Declares code block's annotations called
+ <emphasis>context</emphasis>. There are two forms for different context'
+ type:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>strong</emphasis> context known at compile time</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>weak</emphasis> possible context, can't be decided for
+ sure at compile time</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Example:</para>
+
+ <programlisting>{
+ context:: arithmetic(fast).
+
+ x = 0.3:: float.
+ y = 0.8:: float.
+
+ x + y
+}</programlisting>
+
+ <para>Translation's result:</para>
+
+ <programlisting>bind_scope(0, arithmetic(fast), strong).</programlisting>
+ </section>
+
+ <section>
+ <title>Code Block Bindings: 'ast_scope_binding'</title>
+
+ <synopsis>SYNTAX:
+**ast_scope_binding**(//scope-ref//, //binding-id//, //binding-alias//)
+</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>scope-ref</emphasis> code block's reference</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>binding-id</emphasis> number of code block's
+ binding</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>binding-alias</emphasis> name of a binding</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Code blocks can have <emphasis>bindings</emphasis>, i.e. Identifiers
+ that have special meaning within a block. Declared for each block's
+ binding.</para>
+
+ <para>Example:</para>
+
+ <programlisting>loop ( 0 -&gt; acc ) :: int
+{
+ if(acc &gt; 10) {acc:: int; final} else {acc + 1}
+}</programlisting>
+
+ <para>Translation result: <code>ast_scope_binding(2, 0, acc)</code></para>
+ </section>
+
+ <section>
+ <title>Code Block Parents: 'cfa_parent'</title>
+
+ <synopsis>SYNTAX:
+**cfa_parent**(//scope-ref//, scope(//scope-parent-ref//))</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>scope-ref</emphasis> child block's reference</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>scope-parent-ref</emphasis> parent block's
+ reference</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Represents nested code blocks structure in terms of
+ <emphasis>child-parent</emphasis> relation.</para>
+
+ <para>Example:</para>
+
+ <programlisting>{
+ if (x&gt;5):: int {x + 1} else {x - 1}
+}</programlisting>
+
+ <para>Translation's result:</para>
+
+ <programlisting>cfa_parent(1, scope(0)).
+cfa_parent(2, scope(0)).</programlisting>
+ </section>
+
+ <section>
+ <title>Function: 'function'</title>
+
+ <synopsis>SYNTAX:
+**function**(//fn-name//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>fn-name</emphasis> function name</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Declares function known by its name.</para>
+
+ <para>Example:</para>
+
+ <programlisting>test = function:: int {0}</programlisting>
+
+ <para>Translation's result: <code>function(test)</code></para>
+ </section>
+
+ <section>
+ <title>Function's Annotations: 'bind_func'</title>
+
+ <synopsis>SYNTAX:
+**bind_func**(//fn-name//, //annotation//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>fn-name</emphasis> function's name</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Declares function's annotations.</para>
+
+ <para>Example:</para>
+
+ <programlisting>test = function:: int; status(obsolete) {0}</programlisting>
+
+ <para>Translation's result:
+ <code>bind_func(test,status(obsolete))</code></para>
+ </section>
+
+ <section>
+ <title>Function's Specialization: 'cfa_function_specializations'</title>
+
+ <synopsis>SYNTAX:
+**cfa_function_specializations**(//fn-name//, //guard//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>fn-name</emphasis> name of function</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>guard</emphasis> specialization guard</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>There is a possibility to have several functions with the same name
+ called specializations. Each specialization is uniquely determined by
+ annotation of special kind called <emphasis>guard</emphasis>.</para>
+
+ <para>Example:</para>
+
+ <programlisting>guard:: arch(amd64)
+{
+ test = function:: i64 {0}
+}</programlisting>
+
+ <para>Translation's result:
+ <code>cfa_function_specializations(test,arch(amd64))</code><note>
+ <para>See also <link
+ xlink:href="/w/syntax#function-specializations">specializations
+ syntax</link></para>
+ </note></para>
+ </section>
+
+ <section>
+ <title>Function's Entry: 'cfa_parent'</title>
+
+ <synopsis>SYNTAX:
+**cfa_parent**(//scope-entry-ref//, functon(//fn-name//))</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>scope-entry-ref</emphasis> function's entry code block
+ reference</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>fn-name</emphasis> function's name</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Each function has a single <emphasis>entry</emphasis> code block and
+ is declared in terms of <emphasis>child-parent</emphasis> relation between
+ entry block(which is top-level in blocks hierarchy of the given function)
+ and the function itself.</para>
+
+ <para>Example:</para>
+
+ <programlisting>test = function:: int {0}</programlisting>
+
+ <para>Translation's result: <code>cfa_parent(0,
+ function(test))</code></para>
+ </section>
+
+ <section>
+ <title>Function's Result: 'dfa_fnret'</title>
+
+ <synopsis>SYNTAX:
+**dfa_fnret**(//fn-name//, //symbol-ret-ref//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para>symbol-ret-ref reference to a function's return
+ expression</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Specifies which expression is used to compute function's return
+ value.</para>
+
+ <para>Example:</para>
+
+ <programlisting>test = function:: int {0}</programlisting>
+
+ <para>Translation's result: <code>dfa_fnret(test, v(0,-2,0))</code></para>
+ </section>
+
+ <section>
+ <title>Operations. Invocation: 'cfa_call', 'dfa_callfn',
+ 'dfa_callargs'</title>
+
+ <synopsis>SYNTAX:
+**cfa_call**(//scope-caller-ref//, //fn-callee-name//) (1)
+**dfa_callfn**(//symbol-ref//, //fn-callee-name//) (2)
+**dfa_callargs**(//symbol-ref//, //arg-formal-name//, //arg-actual-ref//) (3)
+**weak**(**dfa_callargs**(//symbol-ref//, //arg-formal-name//, //arg-actual-ref//)) (4)
+</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>scope-caller-ref</emphasis> caller's code block's
+ reference</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>fn-callee-name</emphasis> callee function name</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>symbol-ref</emphasis> invocation operation
+ reference</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>arg-formal-name</emphasis> function's formal
+ argument</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>arg-actual-ref</emphasis> actual argument
+ reference</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Each function invocation is transformed into several transcend facts
+ as explained below:</para>
+
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colwidth="225*"/>
+
+ <colspec colwidth="775*"/>
+
+ <tbody>
+ <row>
+ <entry>(1) <code>cfa_call</code></entry>
+
+ <entry>Specifies caller's code block and callee function
+ name</entry>
+ </row>
+
+ <row>
+ <entry>(2) <code>dfa_callfn</code></entry>
+
+ <entry>Declares unique reference to a particular invocation
+ site.The reference used by other facts to supply additional
+ information</entry>
+ </row>
+
+ <row>
+ <entry>(3) <code>dfa_callargs</code></entry>
+
+ <entry>Declares assignment relations between actual arguments and
+ formal arguments</entry>
+ </row>
+
+ <row>
+ <entry>(4) <code>weak(dfa_callargs)</code></entry>
+
+ <entry>The same as form (3). <emphasis>Weak</emphasis> relation
+ used in cases when there is no enough information at compile time.
+ One such case is when several function specializations exist and
+ it's impossible to say which exactly specialization is
+ called</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+
+ <para>Example:</para>
+
+ <programlisting>inc = function (x::int) :: int {x + 1}
+
+main = function:: int
+{
+ arg = 10:: int
+ inc(arg)
+}</programlisting>
+
+ <para>After translation following transcend facts are present:</para>
+
+ <programlisting>cfa_call(1, test)
+dfa_callfn(v(0,1,-2), test)
+dfa_callargs(v(0,1,-2), x, v(1,1,-2)</programlisting>
+ </section>
+
+ <section>
+ <title>Operations. Loops</title>
+
+ <synopsis>**ast_op_map**(//symbol-result-ref//, //symbol-source-ref//, //loop-body-ref//)
+**ast_op_fold**(//symbol-result-ref//, //symbol-source-ref//, //symbol-acc-ref//, //loop-body-ref//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para>symbol-source-ref input list reference</para>
+ </listitem>
+
+ <listitem>
+ <para>symbol-acc-ref accumulator reference</para>
+ </listitem>
+
+ <listitem>
+ <para>symbol-result-ref result list reference</para>
+ </listitem>
+
+ <listitem>
+ <para>loop-body-ref refers to a loop body's code block</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Facts declare loop operations.</para>
+
+ <para>Example:</para>
+
+ <programlisting>singles = {1, 2, 3}:: [int].
+doubles = loop map(singles-&gt;element)::[int]{2 * element}</programlisting>
+
+ <para>produces fact: <code>ast_op_map(v(0,-2,0),v(1,-2,0),1)</code></para>
+ </section>
+</chapter>
diff --git a/documentation/Transcend/latetranscend.xml b/documentation/Transcend/latetranscend.xml
new file mode 100644
index 0000000..e627b48
--- /dev/null
+++ b/documentation/Transcend/latetranscend.xml
@@ -0,0 +1,168 @@
+<?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">
+ <title>Late Transcend</title>
+
+ <para>Transcend is a powerful tool and as a consequence it's computationally
+ inefficient. Well, expressiveness has its cost. That's the reason why it's
+ mostly suited only for a compile time where it shines unequivocally.
+ Obviously, at this stage compiler lacks dynamic part - the data that is
+ known for sure only during actual program execution. In other words, Early
+ Transcend reasons over <emphasis>weak</emphasis> data - set of facts
+ reflecting possible states and conditions the program could go through
+ during execution. Before that, there is no way to be sure what exactly is
+ going to happen, only set of possibilities is available. Nevertheless, in
+ many cases it's not enough and that's why <emphasis>Late
+ Transcend</emphasis> is introduced - reasoning and making decisions based on
+ data available at runtime.</para>
+
+ <para>Late Transcend approach can be described as having three
+ phases:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Input: at compile time Transcend working with weak data produces
+ decisions for all possible alternatives. Generated set is used as an
+ input for Late Transcend. As it's unknown which exactly decision turns
+ out to be true, every decision has a <emphasis>guards</emphasis> - set
+ of pairs <emphasis>(variable, value)</emphasis> that describe exact
+ state for which it's possible to reach given decision.</para>
+ </listitem>
+
+ <listitem>
+ <para>Validation: A decision is considered to be valid only if all
+ guards are met, i.e. variables from guard pairs actually have required
+ values. In a sense Late Transcend decisions are deferred until
+ correspondent preconditions proved to be true.</para>
+ </listitem>
+
+ <listitem>
+ <para>Execution: DIfferent <emphasis>guarded</emphasis> decisions may
+ produce different code branches. All correspondent code branches are
+ compiled and present in the code in order to be used when needed. At
+ branching point guards are tested and appropriate branch is selected to
+ be executed next.</para>
+ </listitem>
+ </itemizedlist>
+
+ <section>
+ <title>Late Annotations and ASP Representation</title>
+
+ <para><emphasis>Late annotations</emphasis> is a particular type of
+ annotations that depend on parameters known only at runtime.
+ Example:</para>
+
+ <programlisting>y = mul(a, b)::float; arithmetic(ArithmX)</programlisting>
+
+ <para>Suppose we have different specializations of <code>mul</code>
+ function each implementing different multiplication precision and it
+ controlled by using <code>arithmetic(fast)</code>,
+ <code>arithmetic(accurate)</code> and similar annotations. In this example
+ <code>arithmetic(ArithmX)</code> is a late annotation, if
+ <code>ArithmX</code> is a parameter known only during program
+ execution.</para>
+
+ <para>Currently, late annotations do not differ syntactically from other
+ annotations. Only if annotation is recognized to have late arguments it's
+ marked internally as a <emphasis>late</emphasis> and special rules of
+ conversion to ASP form apply.</para>
+
+ <para>Late annotation in ASP form presented as follows:</para>
+
+ <synopsis>**late**(//target//, (//guard-identifiers-list//), (//guard-values-list//), //body//):- //parameter-types-list//. </synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>target</emphasis> References entity for which late
+ annotation is applicable</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>guard-identifiers-list</emphasis> List of guard
+ identifiers</para>
+ </listitem>
+
+ <listitem>
+ <para>guard-values-list List of guard values</para>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>body</emphasis> Decision deemed valid if guards are
+ met</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>parameter-types-list</emphasis> List of types of late
+ parameters</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Meaning that a fact <code>body</code> wrapped by modifier
+ <code>late()</code> alongside with two lists: guards' identifiers and
+ guards' values.</para>
+
+ <para>For an example above, <code>arithmetic(ArithmX)</code> translated
+ into form below where exact references depend on a program:</para>
+
+ <programlisting>late(s(0,-2,2), (s(1,-2,2)), (ArithmX), arithmetic(ArithmX)):- arithmetic(ArithmX).</programlisting>
+
+ <para>This rule generates different facts for each possible <code>x</code>
+ alternative. At runtime only those facts are selected whose guards are
+ met, i.e. referenced variables actually have specified values.</para>
+ </section>
+
+ <section>
+ <title>Switch Late Operation</title>
+
+ <synopsis>SYNTAX:
+**switch late** ( //condition// [-&gt; //alias// ] [:: //condition-type// [; //annotations-list//] ] ) :: //type// [; //annotations-list//]
+ //switch-block//</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>condition</emphasis> switch's condition</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>alias</emphasis> optional alias to denote condition's
+ result within internal code block annotations. If there is no alias
+ and condition is just one identifier it's accessible by its own
+ name</para>
+ </listitem>
+
+ <listitem>
+ <para>condition-type Condition must have slave type</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Switch Late operation allows to designate <emphasis>alias</emphasis>
+ as a <emphasis>late parameter</emphasis> to use in late annotation. It can
+ be conceptualised as lifting Brute value to Transcend level. During
+ compilation it generates different <emphasis>switch-block</emphasis>
+ branches for each possible condition value and only branch is executed
+ whose guard correspond condition. Example:</para>
+
+ <programlisting>ArithmeticT = type slave arithmetic.
+
+test = function(a::float, b::float, ArithmX::ArithmeticT):: float; entry
+{
+ switch late (ArithmX):: float
+ {
+ mul(a, b)::float; arithmetic(ArithmX)
+ }
+}</programlisting>
+
+ <para>Compiler generates several branches for all possible
+ <code>arithmetic</code> variants. Only one branch executed depending on
+ <code>arithmX</code>.</para>
+ </section>
+</chapter>
diff --git a/documentation/Transcend/latex-api.xml b/documentation/Transcend/latex-api.xml
new file mode 100644
index 0000000..0644949
--- /dev/null
+++ b/documentation/Transcend/latex-api.xml
@@ -0,0 +1,102 @@
+<?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">
+ <title>Latex API</title>
+
+ <section>
+ <title>Latex Parameters: 'latex_registered_subjects'</title>
+
+ <synopsis>SYNTAX:
+**latex_registered_subjects**(//parameter//, //decision//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>parameter</emphasis> Name of particular latex
+ parameter</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>decision</emphasis> Possible parameter's value</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Table to declare latex parameters along with all possible parameter
+ values - decisions.</para>
+ </section>
+
+ <section>
+ <title>Block's Demand: 'latex_scope_demand'</title>
+
+ <synopsis>SYNTAX:
+**latex_scope_demand**(//scope-ref//, //parameter//)</synopsis>
+
+ <para>Declares demand for a given scope specified by
+ <emphasis>scope-ref</emphasis>. It initiates latex reasoning in order to
+ find satisfying decision for each demand.</para>
+ </section>
+
+ <section>
+ <title>Function's Demand: 'latex_fn_demand',
+ 'latex_fn_demand_ordered'</title>
+
+ <synopsis>SYNTAX:
+**latex_fn_demand**(//fn-ref//, //parameter//) (1)
+**latex_fn_demand_ordered**(//fn-ref//, //parameter//, //id//) (2)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>fn-ref</emphasis> function reference</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>parameter</emphasis> latex parameter</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>id</emphasis> number of the parameter in function
+ signature's arguments list</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Latex reasoning determines which functions require additional
+ parameters during runtime. Table (2) holds the same data as (1) along with
+ additional field <emphasis>id</emphasis> to specify exact order of latex
+ parameters in the given function's signature.</para>
+ </section>
+
+ <section>
+ <title>Decisions: 'latex_decision', 'late(latex_decision)'</title>
+
+ <synopsis>SYNTAX:
+**latex_decision**(//scope-ref//, //parameter//, //decision//);</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>scope-ref</emphasis> code block reference</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>parameter</emphasis> latex parameter</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>decision</emphasis> latex decision</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Latex reasoning stores its output, found decisions, in this table.
+ Field <emphasis>decision</emphasis> specifies value of a latex parameter
+ <emphasis>parameter</emphasis> in a given code block denoted by
+ <emphasis>scope-ref</emphasis>. If some demand can't be satisfied and no
+ appropriate decision is found, compiler raises an error. Latex parameter
+ can have different values in different code blocks, thus
+ <emphasis>scope-ref</emphasis> is used as a guard.</para>
+ </section>
+</chapter>
diff --git a/documentation/Transcend/modules-api.xml b/documentation/Transcend/modules-api.xml
new file mode 100644
index 0000000..fb780af
--- /dev/null
+++ b/documentation/Transcend/modules-api.xml
@@ -0,0 +1,116 @@
+<?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">
+ <title>Modules API</title>
+
+ <para>Modules Resolution is a process of finding out which modules should be
+ preloaded for a correct compilation of a given module.</para>
+
+ <para>Resolution expected to use <code>bind_module</code>,
+ <code>modules_require</code> as an input and produce results in form of
+ <code>modules_resolution</code> data table.</para>
+
+ <section>
+ <title>Module Annotations: 'bind_module'</title>
+
+ <synopsis>SYNTAX:
+**bind_module**(//module-ref//, //annotation//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>module-ref</emphasis> module's path</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Declares module annotations.</para>
+
+ <para>Example:</para>
+
+ <programlisting>module:: status(obsolete).</programlisting>
+
+ <para>Produced fact:
+ <code>bind_module(path/to/module, status(obsolete))</code></para>
+ </section>
+
+ <section>
+ <title>Requesting Modules: 'modules_require'</title>
+
+ <synopsis>SYNTAX:
+**modules_require**(//module-ref//, //request//)</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>module-ref</emphasis> module's path</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>request</emphasis> expressed by annotation</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Module can request other modules necessary for correct work.
+ Declared requests can be processed to find a resolution.</para>
+
+ <para>Example:</para>
+
+ <programlisting>module
+{
+ require(logger).
+}</programlisting>
+
+ <para>Produced declaration:
+ <code>modules_require(/path/to/module, logger)</code></para>
+ </section>
+
+ <section>
+ <title>Modules Resolution: 'modules_resolution'</title>
+
+ <synopsis>SYNTAX:
+**modules_resolution**(//request//, //module-resolved-ref//) (1)
+**modules_resolution**(//request//, //module-resolved-ref//, //module-context-ref//) (2)
+</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>request</emphasis> expressed by annotation</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>module-resolved-ref</emphasis> resolved module's
+ path</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>module-context-ref</emphasis> context module's
+ path</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Xreate uses the data table to find correspondent modules for each
+ request.</para>
+
+ <para>Form (1) assigns resolved module to a request and assumes that
+ assignment is valid in all cases, i.e. whenever compiler encounters
+ request it loads associated module.</para>
+
+ <para>Form (2) assigns resolution valid only in a specific context.
+ Compiler uses particular resolution only for requests that came from a
+ module specified in a context. In other words, form (2) allows to resolve
+ the same request differently for different modules depending on resolution
+ strategy, thus implementing <emphasis>polymorphism on module
+ level</emphasis>.</para>
+ </section>
+
+ <section>
+ <title>See Also</title>
+
+ <para>Syntax: <link xlink:href="/w/syntax/modules">Modules</link></para>
+ </section>
+</chapter>
diff --git a/documentation/Transcend/transcend.xml b/documentation/Transcend/transcend.xml
new file mode 100644
index 0000000..743c93c
--- /dev/null
+++ b/documentation/Transcend/transcend.xml
@@ -0,0 +1,337 @@
+<?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">
+ <title>Transcend</title>
+
+ <para>Transcend is a compilation phase and process of reasoning about
+ program in order to influence compilation.</para>
+
+ <para>First, compiler extracts <emphasis>annotations</emphasis> from source
+ code and other facts from number of sources to form a complete
+ <emphasis>logic program</emphasis>. Then, solver processes logic program and
+ outputs decisions that affect and control compilation process in a number of
+ ways.</para>
+
+ <section>
+ <title>Annotations' Syntax</title>
+
+ <para>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>
+ <tgroup cols="2">
+ <colspec colwidth="183*"/>
+
+ <colspec colwidth="817*"/>
+
+ <tbody>
+ <row>
+ <entry>Literals</entry>
+
+ <entry>Strings, numbers. Example:
+ <code>5, "success"</code></entry>
+ </row>
+
+ <row>
+ <entry>Predicates</entry>
+
+ <entry>Predicates have zero or more arguments. Example:
+ <code>final, status(broken), version("12.0.3", unstable)</code></entry>
+ </row>
+
+ <row>
+ <entry>Negation</entry>
+
+ <entry>Example: <code>-i12n, -access(allowed)</code></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+
+ <para>Various Xreate's entities can be annotated. At the time following
+ entities are supported:</para>
+
+ <informaltable>
+ <tgroup cols="4">
+ <tbody>
+ <row>
+ <entry><link xlink:href="#expression-and-identifiers">Expressions
+ and Identifiers</link></entry>
+
+ <entry><link xlink:href="#code-blocks-and-context">Code blocks and
+ context</link></entry>
+
+ <entry><link xlink:href="/w/syntax#functions">Functions</link> and
+ <link xlink:href="/w/syntax#function-guards">Function
+ Guards</link></entry>
+
+ <entry><link
+ xlink:href="/w/syntax/modules#module-annotations">Modules</link></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+
+ <section>
+ <title>Expression and Identifiers</title>
+
+ <synopsis>SYNTAX:
+//expression// **::** //type//**;** //annotation-list//.</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>type</emphasis> expression's type</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>annotation-list</emphasis> one or more annotation
+ attached to the expression. Annotations are delimited by
+ semicolon</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Example:</para>
+
+ <programlisting xml:id="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>
+ <para>For readability sake compound statements(e.g. <link
+ xlink:href="/w/syntax#loop-statements">loops</link>) have different
+ syntax for an annotations. See particular statement's <link
+ xlink:href="/w/syntax">syntax</link> for details</para>
+ </note>
+ </section>
+
+ <section>
+ <title>Code Blocks and Context</title>
+
+ <synopsis>SYNTAX:
+**context** :: //annotations-list//.</synopsis>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>annotations-list</emphasis> List of annotation
+ delimited by semicolon</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Code block annotations called <emphasis>context</emphasis>.
+ Keyword <code>context</code> used to declare annotation within enclosing
+ code block.</para>
+
+ <para>Example:</para>
+
+ <programlisting xml:id="Codeblocks1">test = function:: int
+{
+ context:: arithm_optimization(off).
+
+ x = 10 :: int.
+ 2 * x - 16
+}</programlisting>
+ </section>
+
+ <section>
+ <title>Special Annotations</title>
+
+ <para>There are some annotations in Xreate that have special
+ meaning</para>
+
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colwidth="201*"/>
+
+ <colspec colwidth="799*"/>
+
+ <tbody>
+ <row>
+ <entry><code>entry</code></entry>
+
+ <entry>Specifies entry point of a program. See <link
+ xlink:href="/w/syntax#functions">Function Syntax</link></entry>
+ </row>
+
+ <row>
+ <entry><code>final</code></entry>
+
+ <entry>Specifies fixed point of loop statements. See <link
+ xlink:href="/w/syntax#loop-statement">Loop
+ Statement</link></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </section>
+ </section>
+
+ <section>
+ <title>Annotations and Reasoning</title>
+
+ <para>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>Annotations are <emphasis>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>
+ <tgroup cols="2">
+ <colspec colwidth="287*"/>
+
+ <colspec colwidth="713*"/>
+
+ <tbody>
+ <row>
+ <entry>Explicit annotations in source files</entry>
+
+ <entry>Annotations provided by developer in order to explicitly
+ affect compilation</entry>
+ </row>
+
+ <row>
+ <entry>Code Analysis</entry>
+
+ <entry>Different code analyses during compilation provide
+ information implicitly inferred from source code</entry>
+ </row>
+
+ <row>
+ <entry>Supervision</entry>
+
+ <entry>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>
+ <entry>Audit</entry>
+
+ <entry>Third party supplied external information that reflect
+ additional software properties, e.g. results of security
+ audit</entry>
+ </row>
+
+ <row>
+ <entry>Reasoning rules</entry>
+
+ <entry>Reasoning infers additional facts from pool of previously
+ gathered information. It is done by using <emphasis>resoning
+ rules</emphasis> that govern reasoning process</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </section>
+
+ <section>
+ <title>Why Annotations Matter</title>
+
+ <para>This section goes through differences that annotations have over
+ traditional statements.</para>
+
+ <section>
+ <title>Extensible</title>
+
+ <para>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>
+ <para>Yet there are several reserved annotations that have specific
+ meaning in Xreate. See <link xlink:href="#special-annotations">special
+ annotations</link> for details.</para>
+ </note>
+ </section>
+
+ <section>
+ <title>Indicative Nature</title>
+
+ <para>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>
+ <title>Cooperation</title>
+
+ <para>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>
+ <title>External Sources and Adaptability</title>
+
+ <para>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>
+ <title>Feedback</title>
+
+ <para>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>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>It can be conceptualized as a <emphasis>feedback</emphasis> from a
+ client. Annotations is good candidate to express feedback to improve
+ interaction quality.</para>
+ </section>
+
+ <section>
+ <title>Resiliency</title>
+
+ <para>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>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>
diff --git a/scripts/dsl/regexp.xreate b/scripts/dsl/regexp.xreate
index 73d03f9..8c7b71b 100644
--- a/scripts/dsl/regexp.xreate
+++ b/scripts/dsl/regexp.xreate
@@ -1,76 +1,76 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
interface(extern-c){
xml2 = library:: pkgconfig("libxml-2.0").
include {
xml2 = {"string.h"}
}.
}
Matcher = type variant {Sequence, ZeroOrMore, Text}.
matchText = function(text::string, matcher::string, posStart::i64):: i64 {
textLength = strlen(text):: i64.
matcherLength = strlen(matcher):: i64.
if(textLength >= posStart + matcherLength):: i64{
if(strncmp(text + posStart, matcher, matcherLength) == 0):: i64 {
matcherLength
} else {-1:: i64}
} else {-2:: i64}
}
matchSequence = function(text::string, pattern::undefType; i12n(on), posStart::i64):: i64; i12n(off){
textLength = length(text):: i64.
loop fold(pattern-> matcher:: undefType, posStart->pos):: i64{
recognizedSymbols = match(text, matcher, pos):: i64.
if (recognizedSymbols > (0::i64)):: i64{
pos+recognizedSymbols
} else {
- pos:: i64; break
+ pos:: i64; final
}
}
}
matchZeroOrMore= function(text::string, matcher::undefType; i12n(on), posStart::i64):: i64; i12n(off){
textLength = length(text):: i64.
- loop fold inf(posStart->pos):: i64{
+ loop (posStart->pos):: i64{
recognizedSymbols = match(text, matcher, pos):: i64.
if (recognizedSymbols > (0::i64)):: i64{
pos+recognizedSymbols
} else {
- pos:: i64; break
+ pos:: i64; final
}
}
}
match = function(text::string, pattern::undefType; i12n(on), posStart::i64)::i64; i12n(off){
key= pattern[0]::Matcher.
switch variant(key) :: int
case (Sequence) {matchSequence(text, pattern[1], posStart)}
case (ZeroOrMore) {matchZeroOrMore(text, pattern[1], posStart)}
case (Text) {matchText(text, pattern[1], posStart)}
}
main = function:: i64; entry {
patternAB =
{Sequence(),
{{ZeroOrMore(), {Text(), "a"}},
{Text(), "b"}}} :: undefType; i12n(on).
// matchers = ["The ", "only ", "way "] :: [string]; i12n(on).
match("aaab", patternAB, 0):: i64
}

Event Timeline