libgsjj  1
Deterministic finite automata learning library
SMTMethod.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 
5 #include <cvc4/cvc4.h>
6 
7 #include "gsjj/passive/Method.h"
8 
9 namespace gsjj {
10  namespace passive {
16  namespace SMT {
20  class SMTMethod : public Method {
21  public:
22  SMTMethod() = delete;
23  virtual ~SMTMethod();
24 
25  bool solve() override;
26 
27  std::unique_ptr<DFA<char>> constructDFA() override;
28 
29  virtual void setStopTrigger(const std::chrono::seconds &timeLimit, std::atomic_bool &stopTrigger, const bool *stopPointer) override;
30 
31  protected:
35  CVC4::ExprManager m_exprManager;
39  CVC4::SmtEngine m_SMTEngine;
40 
41  protected:
45  virtual void createVariables() = 0;
50  virtual CVC4::Expr createConstraints() = 0;
55  virtual std::unique_ptr<DFA<char>> toDFA() = 0;
56 
57  SMTMethod(const std::set<std::string> &SpSet, const std::set<std::string> &SmSet, const std::set<std::string> &SSet, const std::set<std::string> &prefixesSet, const std::set<char> &alphabetSet, unsigned int n);
58  };
59  }
60  }
61 }
The namespace of the library.
Definition: binary.h:11
virtual CVC4::Expr createConstraints()=0
Creates an unique expression describing the constraints of this method.
virtual void setStopTrigger(const std::chrono::seconds &timeLimit, std::atomic_bool &stopTrigger, const bool *stopPointer) override
Sets the stop trigger for this method.
Definition: SMTMethod.cpp:43
virtual void createVariables()=0
Creates all needed variables for the method.
The base class for every SMT-based method.
Definition: SMTMethod.h:20
The base class of all passive methods.
Definition: Method.h:40
CVC4::ExprManager m_exprManager
This must be used to create new variables, constants and expressions.
Definition: SMTMethod.h:35
virtual std::unique_ptr< DFA< char > > toDFA()=0
Effectively creates the DFA from the values of the variables in the SMT solver (see SMTMethod::m_SMTE...
std::unique_ptr< DFA< char > > constructDFA() override
Constructs the DFA induced by the variables according to the method.
Definition: SMTMethod.cpp:33
CVC4::SmtEngine m_SMTEngine
This computes acceptable values for the variables and allows to retrieve them.
Definition: SMTMethod.h:39
bool solve() override
Solves the SAT/SMT problem induced by the method.
Definition: SMTMethod.cpp:21