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 <string>
19 
20 #include <util/optional.h>
21 
26 {
27 private:
30  std::vector<state_labelt> final_states;
31 
32 public:
34  const std::string &string,
35  std::size_t allowed_errors = 2);
36 
37  bool matches(const std::string &string) const;
38  optionalt<std::size_t> get_edit_distance(const std::string &string) const;
39 
40  void dump_automaton_dot_to(std::ostream &out)
41  {
43  };
44 };
45 
46 #endif // CPROVER_UTIL_EDIT_DISTANCE_H
levenshtein_automatont
Simple automaton that can detect whether a string can be transformed into another with a limited numb...
Definition: edit_distance.h:25
optional.h
levenshtein_automatont::get_edit_distance
optionalt< std::size_t > get_edit_distance(const std::string &string) const
Definition: edit_distance.cpp:58
nfa.h
nfat::dump_automaton_dot_to
void dump_automaton_dot_to(std::ostream &out) const
Write the automaton structure to out in graphviz dot format.
Definition: nfa.h:105
levenshtein_automatont::nfa
nfat< char > nfa
Definition: edit_distance.h:28
optionalt
nonstd::optional< T > optionalt
Definition: optional.h:35
levenshtein_automatont::state_labelt
nfat< char >::state_labelt state_labelt
Definition: edit_distance.h:29
levenshtein_automatont::levenshtein_automatont
levenshtein_automatont(const std::string &string, std::size_t allowed_errors=2)
Definition: edit_distance.cpp:8
levenshtein_automatont::final_states
std::vector< state_labelt > final_states
Definition: edit_distance.h:30
levenshtein_automatont::matches
bool matches(const std::string &string) const
Definition: edit_distance.cpp:52
nfat< char >
levenshtein_automatont::dump_automaton_dot_to
void dump_automaton_dot_to(std::ostream &out)
Definition: edit_distance.h:40