Turns programs into relational representations of event structures.
This program is licensed under the GPLv3 license. Some portions of this software are derived from Scott Owens' example compiler, notably the tokeniser and parser. See COPYING for the full license text.
This supports an abstraction of C like programming languages. It currently does not support loops. Loop support will be implemented by loop unrolling soon.
Appoximate grammar:
<block> ::= { <stmts>* }
<stmts> ::= l = l
| l = v
| l = <expr>
| if(<condition) <block> else <block>
<expr> ::= (<expr> * <expr>)
| (<expr> / <expr>)
| (<expr> + <expr>)
| (<expr> - <expr>)
| v
| l
<cond> ::= <expr> > <expr>
| <expr> < <expr>
| <expr> == <expr>
| <expr> != <expr>
| (<cond> && <cond>)
<program> ::= <block>
| PAR_LIST <program> <program>
Extension | Format |
---|---|
.es |
Relations for QBF |
.dot |
Graphviz |
.tex |
Tikz |
.thy |
Isabelle Theory |
.als |
Alloy |
./compile.native <input file.jef> [output] [options]
Defaults to spitting out .es
format onto standard out.
Flag | Function |
---|---|
--print-tokens |
Print out a list of tokens before the program is parsed. |
--alloy-path |
Specify the path to the alloy model files for alloy output |
--values | -V |
Set the max value (V) such that the modeled. Values = {v |
--long-names |
Print long names in output, e.g. c_Rx1_r2 |
As with Scott's compiler from which this is derived, you'll need a handful of dependencies:
opam install extlib ppx_deriving ppx_monadic ocamlgraph
Then all going well, you can run make
to build the binaries.
This is a fairly boring compiler:
- Mostly done
A C-like language with some aditional concurrency notation and a limited set of control flow structures. Should be enough to express litmus tests.
- Mostly done
Converts the input language into a list of tokens for the parser.
- Mostly done
Converts the token list formed from the input language into an AST.
- Mostly done
Swaps all locations for the AST for virtual memory or register locations. This
is just a simple regex, variables which begin "r" such as r12
will be treated
as a register, any other variable will be a memory location. E.g. x
, y
,
foo
.
- Mostly done
This is Alan Jeffrey style notation for event structures as presented in his LICS'16 paper Towards an Event Structure Memory Model of Relaxed Memory.
- Mostly done
A relational realisation of an actual event structure. Transformations from this to the various output formats will be very simplistic, as each of the output formats is intended to be relational.
This should provide various useful outputs built from the relational representations.
- Done
To go into Jon's work on a formal Isabelle definition of event structures.
- Nearly there
To go into my work on modelling an event structure memory model in Alloy.
- Done
Output for display of an event structure.