spot  1.2.1a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
satsolver.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2013 Laboratoire de Recherche et Développement
3 // de l'Epita.
4 //
5 // This file is part of Spot, a model checking library.
6 //
7 // Spot is free software; you can redistribute it and/or modify it
8 // under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // Spot is distributed in the hope that it will be useful, but WITHOUT
13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 
20 #ifndef SPOT_MISC_SATSOLVER_HH
21 #define SPOT_MISC_SATSOLVER_HH
22 
23 #include "common.hh"
24 #include <vector>
25 #include <stdexcept>
26 
27 namespace spot
28 {
29  class printable;
30 
32  {
33  private:
34  int count_;
35 
36  public:
38  : count_(0)
39  {
40  }
41 
42  void check() const
43  {
44  if (count_ < 0)
45  throw std::runtime_error("too many SAT clauses (more than INT_MAX)");
46  }
47 
48  clause_counter& operator++()
49  {
50  ++count_;
51  check();
52  return *this;
53  }
54 
55  clause_counter& operator+=(int n)
56  {
57  count_ += n;
58  check();
59  return *this;
60  }
61 
62  int nb_clauses() const
63  {
64  return count_;
65  }
66  };
67 
81  SPOT_API int
82  satsolver(printable* input, printable* output);
83 
84 
85  typedef std::vector<int> sat_solution;
86 
88  SPOT_API sat_solution
89  satsolver_get_solution(const char* filename);
90 
91 }
92 
93 #endif // SPOT_MISC_SATSOLVER_HH
Definition: satsolver.hh:31
Definition: formater.hh:30
SPOT_API sat_solution satsolver_get_solution(const char *filename)
Extract the solution of a SAT solver output.
SPOT_API int satsolver(printable *input, printable *output)
Run a SAT solver.

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Tue Jan 21 2014 16:52:01 for spot by doxygen 1.8.5