Skip to content

atikhono/astrakahn-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The concepts of the new coordination language AstraKahn are described in [1]. The language defines the coordination behaviour of asynchronous stateless components (boxes) and their orderly interconnection via stream-carrying channels with finite capacity. AstraKahn structures the interconnect using a fixed set of wiring primitives, viz. serial and parallel composition, wrap-around connection and serial replication. Boxes are connected to the network with one or two input channels and one or more output channels. A stateless box does not synchronise data on its input channels; to this end, AstraKahn provides a synchronisation facility called synchroniser. Synchronisers are finite state machines for joining messages and sending them on to the output channels. A synchroniser is connected to the network with one or more input and output channels. AstraKahn provides a dedicated language to define synchronisers. The grammar of the language is given in [1].

This repository holds the up-to-date synchroniser compiler implementation.

Communication passport

An AstraKahn component, either a box or a synchroniser, is both a consumer and a producer for some other components in the network. The static correctness of a connection demands that the statically guaranteed properties of an output message be sufficient to satisfy the static requirements of its recipients. In order to check the static correctness over the network, a component can be abstracted with respect to its data-transformation behaviour as a so-called communication passport p ⇒ P, where p is the conjunction of all the requirements and P is the conjunction of all the guarantees. Synchronisers are fully analysable by AstraKahn and their passports can be extracted from the source code exclusively by program analysis. Such an analysis is implemented as a part of the synchroniser compiler.

What is implemented so far

  • Lexical analyser (with PLY)
  • Syntax analyser (with PLY)
  • Abstract syntax tree (using cpyparser AST generatpr)
  • Symbol tables and management
  • Types and type checker
  • Input/output passport extraction
  • Tests (with unittest)

For the implementation details see Chapter 4 of my thesis.

The tool is written in python3. It works in a bundle with the AstraKahn runtime and also can run on its own (see sync_compiler.py):

import sync

with open('path/to/sync/code', 'r') as f:
    src_code = f.read()

assert(sync.process(src_code))

To test the tool, run:

python3 sync/tests/tests.py

About

Astrakahn synchroniser compiler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published