taatgba.cc 2.13 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (C) 2009 Laboratoire d'Informatique de Paris
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Spot; see the file COPYING.  If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.

#include <iostream>
#include <cassert>
#include "misc/hash.hh"
#include "ltlenv/defaultenv.hh"
#include "ltlast/allnodes.hh"
Damien Lefortier's avatar
Damien Lefortier committed
27
#include "tgbaalgos/dotty.hh"
28
#include "tgba/taatgba.hh"
29
30
31
32
33
34
35
36

int
main()
{
  spot::bdd_dict* dict = new spot::bdd_dict();

  spot::ltl::default_environment& e =
    spot::ltl::default_environment::instance();
37
  spot::taa_tgba* a = new spot::taa_tgba(dict);
38

39
40
41
  typedef spot::taa_tgba::transition trans;
  typedef spot::taa_tgba::state state;
  typedef spot::taa_tgba::state_set state_set;
42
43
44
45
46
47
48
49
50
51
52

  std::string ss1_values[] = { "state 2", "state 3" };
  std::vector<std::string> ss1_vector(ss1_values, ss1_values + 2);
  trans* t1 = a->create_transition("state 1", ss1_vector);
  trans* t2 = a->create_transition("state 2", "state 3");
  trans* t3 = a->create_transition("state 2", "state 4");

  a->add_condition(t1, e.require("a"));
  a->add_condition(t2, e.require("b"));
  a->add_condition(t3, e.require("c"));

53
  a->set_init_state("state 1");
Damien Lefortier's avatar
Damien Lefortier committed
54
  spot::dotty_reachable(std::cout, a);
55
56
57

  delete a;
  delete dict;
Damien Lefortier's avatar
Damien Lefortier committed
58
59
60
61
  assert(spot::ltl::atomic_prop::instance_count() == 0);
  assert(spot::ltl::unop::instance_count() == 0);
  assert(spot::ltl::binop::instance_count() == 0);
  assert(spot::ltl::multop::instance_count() == 0);
62
}