Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Static Public Member Functions
grammar::generate::CockeYoungerKasami Class Reference

#include <CockeYoungerKasami.h>

Static Public Member Functions

template<class TerminalSymbolType , class NonterminalSymbolType >
static bool generate (const grammar::CNF< TerminalSymbolType, NonterminalSymbolType > &grammar, const string::LinearString< TerminalSymbolType > &string)
 

Detailed Description

Implements the Cocke Younger Kasami algorithm.

Member Function Documentation

◆ generate()

template<class TerminalSymbolType , class NonterminalSymbolType >
bool grammar::generate::CockeYoungerKasami::generate ( const grammar::CNF< TerminalSymbolType, NonterminalSymbolType > &  grammar,
const string::LinearString< TerminalSymbolType > &  string 
)
static

Implements the Cocke Younger Kasami algorithm to test whether string is in language generated by a grammar

Template Parameters
TerminalSymbolTypethe type of terminal symbol of the grammar
NonterminalSymbolTypethe type of nonterminal symbol of the grammar
Parameters
grammarcontext free grammar in chomsky's normal form.
stringthe tested string
Returns
true if the grammar generates a language containing string
Here is the call graph for this function:

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