Commit c4f6722b authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

org: add explicit Kripke structure example

Fixes #376.

* doc/org/tut52.org: New file.
* doc/org/tut.org, doc/org/tut51.org: Link to it.
* doc/Makefile.am: Add it.
parent eb02db85
## -*- coding: utf-8 -*-
## Copyright (C) 2010-2011, 2013-2018 Laboratoire de Recherche et
## Copyright (C) 2010-2011, 2013-2019 Laboratoire de Recherche et
## Développement de l'Epita (LRDE).
## Copyright (C) 2003-2005 Laboratoire d'Informatique de Paris 6
## (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
......@@ -113,6 +113,7 @@ ORG_FILES = \
org/tut31.org \
org/tut50.org \
org/tut51.org \
org/tut52.org \
org/upgrade2.org \
org/satmin.org \
org/satmin.tex \
......
......@@ -36,6 +36,7 @@ three interfaces supported by Spot: shell commands, Python, or C++.
- [[file:tut22.org][Creating an automaton by adding states and transitions]]
- [[file:tut23.org][Creating an alternating automaton by adding states and transitions]]
- [[file:tut24.org][Iterating over alternating automata]]
- [[file:tut52.org][Creating an explicit Kripke structure]]
* Examples in C++ only
......
......@@ -13,11 +13,14 @@ represent the state space of the model to verify.
* Implementing a toy Kripke structure
In this example, our goal is to implement a Kripke structure that
constructs its state space on the fly. The states of our toy model
will consist of a pair of modulo-3 integers $(x,y)$; and at any state
the possible actions will be to increment any one of the two integer
(nondeterministicaly). That increment is obviously done modulo 3.
For instance state $(1,2)$ has two possible successors:
constructs its state space on the fly. ([[file:tut52.org][Another page]] shows how to
implement this Kripke structure using an explicit graph instead.)
The states of our toy model will consist of a pair of modulo-3
integers $(x,y)$; and at any state the possible actions will be to
increment any one of the two integer (nondeterministicaly). That
increment is obviously done modulo 3. For instance state $(1,2)$ has
two possible successors:
- $(2,2)$ if =x= was incremented, or
- $(1,0)$ if =y= was incremented.
Initially both variables will be 0. The complete state space is
......@@ -396,6 +399,9 @@ $txt
[[file:kripke-1.svg]]
* Checking a property on this state space
:PROPERTIES:
:CUSTOM_ID: prop-check
:END:
Let us pretend that we want to verify the following property: if
=odd_x= infinitely often holds, then =odd_y= infinitely often holds.
......@@ -412,7 +418,6 @@ counterexample:
#+BEGIN_SRC C++ :exports code :noweb strip-export :results verbatim
#include <spot/tl/parse.hh>
#include <spot/twaalgos/translate.hh>
#include <spot/twa/twaproduct.hh>
#include <spot/twaalgos/emptiness.hh>
<<demo-1-aux>>
int main()
......@@ -469,7 +474,6 @@ We also pass option "~A~" to hide the acceptance condition (which is
#include <spot/twaalgos/dot.hh>
#include <spot/tl/parse.hh>
#include <spot/twaalgos/translate.hh>
#include <spot/twa/twaproduct.hh>
#include <spot/twaalgos/emptiness.hh>
<<demo-3-aux>>
int main()
......@@ -521,7 +525,6 @@ figure:
#include <spot/twaalgos/dot.hh>
#include <spot/tl/parse.hh>
#include <spot/twaalgos/translate.hh>
#include <spot/twa/twaproduct.hh>
#include <spot/twaalgos/emptiness.hh>
<<demo-3-aux>>
int main()
......
This diff is collapsed.
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