pd_alg_nb_sub_a.h

Go to the documentation of this file.
00001 /** @file pd_alg_nb_sub_a.h  Nonblock subfunctions, part A*/
00002 
00003 
00004 /* Pushdown plugin for FAU Discrete Event Systems Library (libfaudes)
00005 
00006    Copyright (C) 2013  Stefan Jacobi, Sven Schneider, Anne-Kathrin Hess
00007 
00008 */
00009 
00010 
00011 #ifndef FAUDES_PD_ALG_NB_SUB_A_H
00012 #define FAUDES_PD_ALG_NB_SUB_A_H
00013 
00014 #include "corefaudes.h"
00015 #include "pd_pdgenerator.h"
00016 
00017 
00018 namespace faudes {
00019   
00020   /**
00021    * Extract all symbols from the word that are in the symbol set
00022    * 
00023    * @param symbolSet
00024    *    the  symbol set
00025    * @param w
00026    *    the word
00027    * @return
00028    *    set of found symbols
00029    */
00030   std::set<Nonterminal> Filter(const std::set<Nonterminal>& symbolSet, const GrammarSymbolVector& w);
00031   
00032   /**
00033    * Find all nonterminals that are eliminable in one step and assuming that a certain 
00034    * set of nonterminals has already been eliminated.
00035    * 
00036    * @param gr
00037    *    the grammar
00038    * @param ntSet
00039    *    the set of already eliminated nonterminals
00040    * @return
00041    *    eliminable symbols including the already eliminated ones
00042    */
00043   std::set<Nonterminal> Rnpp1(const Grammar& gr, const std::set<Nonterminal>& ntSet);
00044   
00045   /**
00046    * Find all nonterminals that are eliminable in as many steps as needed and assuming 
00047    * that a certain set of nonterminals has already been eliminated.
00048    * 
00049    * @param gr
00050    *    the grammar
00051    * @param ntSet
00052    *    the set of already eliminated nonterminals
00053    * @return
00054    *    eliminable symbols including the already eliminated ones
00055    */
00056   std::set<Nonterminal> Rnppl(const Grammar& gr, const std::set<Nonterminal>& ntSet);
00057   
00058   /**
00059    * Remove all productions from a grammar that are nonproductive, i. e. they 
00060    * contain nonterminals that are not eliminable.
00061    */
00062   Grammar Rnpp(const Grammar& gr);
00063   
00064   /**
00065    * Transform a simple pushdown generator into an LR(1) grammar.
00066    * 
00067    * @param pd
00068    *    the generator
00069    * @return
00070    *    the grammar
00071    */
00072   Grammar Sp2Lr(const PushdownGenerator& pd);
00073   
00074   /**
00075    * Transform a simple pushdown generator into an LR(1) grammar. Memory-optimized version.
00076    * May take significantly longer than the non-optimized version.
00077    * 
00078    * @param pd
00079    *    the generator
00080    * @return
00081    *    the grammar
00082    */
00083   Grammar Sp2Lr2(const PushdownGenerator& pd);
00084   
00085   /**
00086    * Remove all unreachable productions and nonterminals from the grammar
00087    * 
00088    * @param gr
00089    *    grammar with productions to be removed
00090    * @return
00091    *    grammar with only reachable productions
00092    */
00093   Grammar Rup(const Grammar& gr);
00094 
00095 } // namespace faudes
00096 
00097 #endif

libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen