This class is used to find all words that can be found when traversing a maximum of k transitions of a given generator. More...

#include <pd_lang_k.h>

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

Detailed Description

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

Overview

Contents

Contents

Definition at line 40 of file pd_lang_k.h.

Constructor & Destructor Documentation

faudes::LangK::LangK ( const PushdownGenerator gen)
inline

Constructor.

Parameters
genthe generator

Definition at line 50 of file pd_lang_k.h.

Member Function Documentation

std::set< std::string > faudes::LangK::FindLangK ( uint  k,
bool  showStack = false 
)

find all words that can be generated by traversing k transitions

Parameters
knumber of transitions to traverse
showStackshow 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.

Parameters
iIndex of the current state
wordcurrent word
stackcurrent stack
depthcurrent length
showStackindicator whether to print the stack or not

Definition at line 35 of file pd_lang_k.cpp.

Member Data Documentation

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.


The documentation for this class was generated from the following files:

libFAUDES 2.26g --- 2015.08.17 --- c++ api documentaion by doxygen