Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andrew-bedford/ott-ifc

Generates information-flow control mechanisms from a language's specification
https://github.com/andrew-bedford/ott-ifc

information-flow-control ott

Last synced: about 2 months ago
JSON representation

Generates information-flow control mechanisms from a language's specification

Awesome Lists containing this project

README

        

# Ott-IFC
Developing sound information-flow control mechanisms can be a laborious and error-prone task due to the numerous ways through which information may flow in a program, particularly when dealing with complex programming languages. Ott-IFC seeks to help with this task, by generating basic information-flow control mechanisms from language specifications (i.e., syntax and semantics).

As the name implies, the specifications that Ott-IFC takes as input (and outputs) are written in [Ott](https://github.com/ott-lang/ott). Ott is a tool that can generate LaTeX, Coq or Isabelle/HOL versions of a programming language's specification. The specification is written in a concise and readable ASCII notation that resembles what one would write in informal mathematics.

## Example
Consider the imperative language whose syntax and (partial) semantics are defined below:
```
grammar
arith_expr, a :: ae_ ::=
| x :: :: variable
| n :: :: int
| a1 + a2 :: :: addition
| a1 * a2 :: :: multiplication

bool_expr, b :: be_ ::=
| true :: :: true
| false :: :: false
| a1 < a2 :: :: less_than

commands, cmd :: cmd_ ::=
| stop :: :: stop
| skip :: :: skip
| x := a :: :: assignment
| cmd1 ; cmd2 :: :: sequence
| if b then cmd1 else cmd2 end :: :: if
| while b do cmd end :: :: while
| read x from ch :: :: read
| write x to ch :: :: write
```

To prevent explicit flows, Ott-IFC identifies the semantic rules that may modify the memory *m* (e.g., rule `assign`). In each of those rules, it updates the modified variable's label with the label of the expressions that are used in the rule.
```
||
----------------------------- :: assign
|| n], o>

is transformed into

E |- a : l_a
||
----------------------------- :: assign
|| pc |_| l_a], pc, stop, m[x |-> n], o>
```

To prevent implicit flows, it identifies commands that may influence the control-flow of the application. That is, commands for which a program configuration may lead to two different program configurations (e.g., the `if` command). It then updates to the program counter `pc` with the level of the expressions that are present in the rule (only `b` in this case).

```
||
||
---------------------------------------------------------------- :: if_true
||

||
||
---------------------------------------------------------------- :: if_false
||

is transformed into

E |- b : l_b
||
||
---------------------------------------------------------------- :: if_true
||

E |- b : l_b
||
||
---------------------------------------------------------------- :: if_false
||
```

## Usage
```
-i [.ott file] Specification to use as input.
-m [generation | verification] Ott-IFC's mode. Use "generation" to generate a mechanism and "verification" to verify an existing mechanism.
```

### Assumptions
- The specification for the language is contained in a single file
- The language's syntax is composed of two types of productions: expressions and commands.
- The semantics program states are of the form **