CBMC
edit_distance.h
Go to the documentation of this file.
1 
12 #ifndef CPROVER_UTIL_EDIT_DISTANCE_H
13 #define CPROVER_UTIL_EDIT_DISTANCE_H
14 
15 #include "nfa.h"
16 
17 #include <cstddef>
18 #include <optional>
19 #include <string>
20 
25 {
26 private:
29  std::vector<state_labelt> final_states;
30 
31 public:
33  const std::string &string,
34  std::size_t allowed_errors = 2);
35 
36  bool matches(const std::string &string) const;
37  std::optional<std::size_t> get_edit_distance(const std::string &string) const;
38 
39  void dump_automaton_dot_to(std::ostream &out)
40  {
42  };
43 };
44 
45 #endif // CPROVER_UTIL_EDIT_DISTANCE_H
Simple automaton that can detect whether a string can be transformed into another with a limited numb...
Definition: edit_distance.h:25
levenshtein_automatont(const std::string &string, std::size_t allowed_errors=2)
nfat< char >::state_labelt state_labelt
Definition: edit_distance.h:28
std::optional< std::size_t > get_edit_distance(const std::string &string) const
void dump_automaton_dot_to(std::ostream &out)
Definition: edit_distance.h:39
bool matches(const std::string &string) const
std::vector< state_labelt > final_states
Definition: edit_distance.h:29
void dump_automaton_dot_to(std::ostream &out) const
Write the automaton structure to out in graphviz dot format.
Definition: nfa.h:105