spot/doc/org/tut.org
Alexandre Duret-Lutz 690b8f51c7 org: some documentation about compiling C++
* doc/org/compile.org: New file.
* doc/Makefile.am: Add it.
* NEWS: Mention it.
* doc/org/tut.org, doc/org/tut01.org: Link to it.
2015-12-05 11:29:02 +01:00

3 KiB

Code Examples

This section contains code examples for using Spot. This is a work in progress. Feel free to send suggestion of small tasks you would like to see illustrated here.

If you have difficulties compiling the C++ examples, check out these instructions.

Examples with Shell, Python, and C++

All the following pages show how to perform the same task using the three interfaces supported by Spot: shell commands, Python, or C++.

Examples in Python and C++

Examples in

C++ only

The following examples are too low-level to be implemented in shell or Python (at least at the moment), so they are purely C++ so far.

Examples in Python only

In directory wrap/python/tests, the Spot tarball contains a small collection of IPython notebooks. As the name of the directory implies, these are part of the test suite for the Python bindings, however they can be interesting to look at if you want to see more code examples.

For convenience, the following links offer static HTML renderings of these notebooks, but we strongly suggest interactively evaluating the real notebooks instead.

  • formulas.ipynb covers the basics of LTL/PSL formula parsing and printing, with some light operations
  • automata.ipynb covers translation from formulas to automata, automata printing, and some lights transformations
  • automata-io.ipynb shows how to save and read automata from files
  • piperead.ipynb shows how to save and read automata output from other commands, using pipes
  • randaut.ipynb shows a simple case where the randaut commands generated random automata, which are displayed in a table before and after acceptance simplification
  • accparse.ipynb exercises the acceptance condition parser
  • randltl.ipynb demonstrates a Python-version of randltl
  • decompose.ipynb illustrates the decompose_strength() function
  • testingaut.ipynb shows the step necessary to build a testing automaton