Commit c1c7e6b2 authored by Stefan Jaax's avatar Stefan Jaax

Change readme

parent a58acf69
...@@ -16,47 +16,39 @@ and the build system [cabal >= 1.22](https://www.haskell.org/cabal/). ...@@ -16,47 +16,39 @@ and the build system [cabal >= 1.22](https://www.haskell.org/cabal/).
Input Input
------ ------
Peregrine takes a single population protocol as input. Peregrine takes a single population protocol as JSON-encoded input.
The following example shows how a protocol is encoded: The following example shows the input format:
``` ```
population protocol "Majority Protocol" { {
states { a b a_small b_small} "title": "Majority Protocol",
transitions { t1 t2 t3 t4 } "states": ["A", "a", "B", "b"],
arcs { { a, b } -> t1 -> { a_small, b_small } "transitions": [
{ b, a_small } -> t2 -> { b, b_small } { "name": "t1",
{ a, b_small } -> t3 -> { a, a_small } "pre": ["A", "B"],
{ a_small, b_small } -> t4 -> { a_small, a_small } "post": ["a", "b"]
} },
initial { a b } { "name": "t2",
true { a a_small } "pre": ["B", "a"],
false { b b_small } "post": ["B", "b"]
},
{ "name": "t3",
"pre": ["A", "b"],
"post": ["A", "a"]
},
{ "name": "t4",
"pre": ["a", "b"],
"post": ["a", "a"]
}
],
initialStates: ["A", "B"],
trueStates: ["A", "a"],
predicate: "A >= B",
description: "This protocol computes whether there are more B-states than A-states"
} }
``` ```
* After the keyword *population protocol* the name of the protocol is given in
quotes.
* Finite sets are specified in braces
through space- or comma-separated lists of names.
Names consist of alphanumerical characters or underscores.
* The set of states is given after the identifier *states*.
* In order to make transitions identifiable,
each transition must be given a name after the keyword *transitions*.
* Transitions are defined after the keyword *arcs*; there must be one definition
for each transition name.
* The set following the keyword *initial* specifies states that can
belong to an initial population.
* The sets following the keywords *true* and *false* identify the states
that map to true and false, respectively.
Usage Usage
------- -------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment