faudes::LangK Class Reference
|
Public Member Functions | |
LangK (const PushdownGenerator &gen) | |
Constructor. | |
std::set< std::string > | FindLangK (uint k, bool showStack=false) |
find all words that can be generated by traversing k transitions | |
void | PrintWords () |
Print the words that were found in the last execution of FindLangK. | |
Private Member Functions | |
void | Traverse (Idx i, std::string word, std::vector< Idx > stack, uint depth, bool showStack) |
Recursively traverse the generator and build new words until word length is k. | |
Private Attributes | |
std::set< std::string > | words |
storage for the words | |
const PushdownGenerator | pd |
the generator | |
uint | k |
maximum word length |
This class is used to find all words that can be found when traversing a maximum of k transitions of a given generator.
It is intended mainly for debugging purposes, not for finding whole languages.
Note: length k can include "empty" (lambda) strings
Overview
Contents
Definition at line 40 of file pd_lang_k.h.
faudes::LangK::LangK | ( | const PushdownGenerator & | gen | ) | [inline] |
std::set< std::string > faudes::LangK::FindLangK | ( | uint | k, | |
bool | showStack = false | |||
) |
find all words that can be generated by traversing k transitions
k | number of transitions to traverse | |
showStack | show stack while traversing, defaults to false |
Definition at line 14 of file pd_lang_k.cpp.
void faudes::LangK::PrintWords | ( | ) |
Print the words that were found in the last execution of FindLangK.
Definition at line 27 of file pd_lang_k.cpp.
void faudes::LangK::Traverse | ( | Idx | i, | |
std::string | word, | |||
std::vector< Idx > | stack, | |||
uint | depth, | |||
bool | showStack | |||
) | [private] |
Recursively traverse the generator and build new words until word length is k.
i | Index of the current state | |
word | current word | |
stack | current stack | |
depth | current length | |
showStack | indicator whether to print the stack or not |
Definition at line 35 of file pd_lang_k.cpp.
uint faudes::LangK::k [private] |
maximum word length
Definition at line 74 of file pd_lang_k.h.
const PushdownGenerator faudes::LangK::pd [private] |
the generator
Definition at line 72 of file pd_lang_k.h.
std::set<std::string> faudes::LangK::words [private] |
storage for the words
Definition at line 70 of file pd_lang_k.h.
libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen