spot 2.15.1
Loading...
Searching...
No Matches
ltsmin.hh
1// -*- coding: utf-8 -*-
2// Copyright (C) by the Spot authors, see the AUTHORS file for details.
3//
4// This file is part of Spot, a model checking library.
5//
6// Spot is free software; you can redistribute it and/or modify it
7// under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 3 of the License, or
9// (at your option) any later version.
10//
11// Spot is distributed in the hope that it will be useful, but WITHOUT
12// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14// License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19#pragma once
20
21#include <spot/ltsmin/spins_interface.hh>
22#include <spot/ltsmin/spins_kripke.hh>
23#include <spot/kripke/kripke.hh>
24#include <spot/twacube/twacube.hh>
25#include <spot/tl/apcollect.hh>
26#include <tuple>
27
33
34namespace spot
35{
36 class SPOT_API ltsmin_model final
37 {
38 public:
40
41 // \brief Load an ltsmin model, either from divine or promela.
42 //
43 // The filename given can be either a *.pm/*.pml/*.prom promela
44 // source or a *.spins dynamic library compiled with "spins file".
45 // If a promela source is supplied, this function will call spins to
46 // update the *.spins library only if it is not newer.
47 //
48 // Similarly the divine models can be specified as *.dve source or
49 // *.dve or *.dve2C libraries.
50 //
51 static ltsmin_model load(const std::string& file);
52
53 // \brief Generate a Kripke structure on-the-fly
54 //
55 // The dead parameter is used to control the behavior of the model
56 // on dead states (i.e. the final states of finite sequences). If
57 // DEAD is formula::ff(), it means we are not interested in finite
58 // sequences of the system, and dead state will have no successor.
59 // If DEAD is formula::tt(), we want to check finite sequences as
60 // well as infinite sequences, but do not need to distinguish
61 // them. In that case dead state will have a loop labeled by
62 // true. If DEAD is any atomic proposition (formula::ap("...")),
63 // this is the name of a property that should be true when looping
64 // on a dead state, and false otherwise.
65 //
66 // This function returns nullptr on error.
67 //
68 // \a to_observe the list of atomic propositions that should be observed
69 // in the model
70 // \a dict the BDD dictionary to use
71 // \a dead an atomic proposition or constant to use for looping on
72 // dead states
73 // \a compress whether to compress the states. Use 0 to disable, 1
74 // to enable compression, 2 to enable a faster compression that only
75 // works if all variables are smaller than 2^28.
76 kripke_ptr kripke(const atomic_prop_set* to_observe,
77 bdd_dict_ptr dict,
78 formula dead = formula::tt(),
79 int compress = 0) const;
80
81 // \brief The same as above but returns a kripkecube, i.e. a kripke
82 // that can be used in parallel. Moreover, it supports more elaborate
83 // atomic propositions such as "P.a == P.c"
84 ltsmin_kripkecube_ptr kripkecube(std::vector<std::string> to_observe,
85 formula dead = formula::tt(),
86 int compress = 0,
87 unsigned int nb_threads = 1) const;
88
90 int state_size() const;
92 const char* state_variable_name(int var) const;
94 int state_variable_type(int var) const;
96 int type_count() const;
98 const char* type_name(int type) const;
100 int type_value_count(int type);
102 const char* type_value_name(int type, int val);
103
104 private:
105 ltsmin_model(std::shared_ptr<const spins_interface> iface) : iface(iface)
106 {
107 }
108 std::shared_ptr<const spins_interface> iface;
109 };
110}
Main class for temporal logic formula.
Definition formula.hh:850
Interface for a Kripke structure.
Definition kripke.hh:177
This class is a template representation of a Kripke structure. It is composed of two template paramet...
Definition kripke.hh:40
Definition ltsmin.hh:37
const char * type_value_name(int type, int val)
Name of each enumerated value for a type.
int type_value_count(int type)
Count of enumerated values for a type.
int type_count() const
Number of different types.
const char * type_name(int type) const
Name of each type.
int state_variable_type(int var) const
Type of each variable.
const char * state_variable_name(int var) const
Name of each variable.
int state_size() const
Number of variables in a state.
std::set< formula > atomic_prop_set
Set of atomic propositions.
Definition apcollect.hh:34
Definition automata.hh:26
std::shared_ptr< spot::kripkecube< spot::cspins_state, spot::cspins_iterator > > ltsmin_kripkecube_ptr
shortcut to manipulate the kripke below
Definition spins_kripke.hh:260

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.8