Menu

Examples

Filippo Schiavio

Examples

SpanTools examples files is now available here

Each subfolder contain files with .span extension, these are input file for the program.
Note that SpanTools doesn't need such extension, this is only a facility for execute all files with the sh program "execute-all.sh" contained in downloadable zip file.

You can execute all examples simply executing the file execute-all.sh or execute a single input file entering in the folder containing it and run the program passing the file name as parameter, with the following command:

java -jar [SpanToolsPath] [InputFilePath]

for example, in order to execute the Petri-net example you can use the following commands:

cd petri-net
java -jar ../SpanTools.jar mutual-exclusion-petri.span

Examples description:

There are 4 subfolders with examples:
circuits
expression-comparison
processes
petri-net

circuits folder contain one single .span file, wich contain two simple examples: the first one is a sequential composition of some delays components, the second one is a boolean function obtained composing basic components (and, or, not)

expression-comparison folder contain only a very simple input file with two different expressions, that are equals according to the valid axioms in Span(Graph), evaluating both expressions in Cospan(MonoidalGraph) the result is same monoidal graph.

precesses folder contain two files, the dining philosopher example and a mutual exclusion protocol between two process.

petri-net folder contain a Petri net described by a Span(Graph) expression. The net model a mutual exclusion between two processes, note that this is the same protocol as that one contained in processes folder. A very interesting comparison between these different model pf that protocol can be found in section 3.2 of the paper: The algebra and geometry of networks (Walters, Sabadini, Schiavio)


Related

Wiki: Home
Wiki: Usage

MongoDB Logo MongoDB