pd_alg_nb_sub_a.h
Go to the documentation of this file.
1 /** @file pd_alg_nb_sub_a.h Nonblock subfunctions, part A*/
2 
3 
4 /* Pushdown plugin for FAU Discrete Event Systems Library (libfaudes)
5 
6  Copyright (C) 2013 Stefan Jacobi, Sven Schneider, Anne-Kathrin Hess
7 
8 */
9 
10 
11 #ifndef FAUDES_PD_ALG_NB_SUB_A_H
12 #define FAUDES_PD_ALG_NB_SUB_A_H
13 
14 #include "corefaudes.h"
15 #include "pd_pdgenerator.h"
16 
17 
18 namespace faudes {
19 
20  /**
21  * Extract all symbols from the word that are in the symbol set
22  *
23  * @param symbolSet
24  * the symbol set
25  * @param w
26  * the word
27  * @return
28  * set of found symbols
29  */
30  std::set<Nonterminal> Filter(const std::set<Nonterminal>& symbolSet, const GrammarSymbolVector& w);
31 
32  /**
33  * Find all nonterminals that are eliminable in one step and assuming that a certain
34  * set of nonterminals has already been eliminated.
35  *
36  * @param gr
37  * the grammar
38  * @param ntSet
39  * the set of already eliminated nonterminals
40  * @return
41  * eliminable symbols including the already eliminated ones
42  */
43  std::set<Nonterminal> Rnpp1(const Grammar& gr, const std::set<Nonterminal>& ntSet);
44 
45  /**
46  * Find all nonterminals that are eliminable in as many steps as needed and assuming
47  * that a certain set of nonterminals has already been eliminated.
48  *
49  * @param gr
50  * the grammar
51  * @param ntSet
52  * the set of already eliminated nonterminals
53  * @return
54  * eliminable symbols including the already eliminated ones
55  */
56  std::set<Nonterminal> Rnppl(const Grammar& gr, const std::set<Nonterminal>& ntSet);
57 
58  /**
59  * Remove all productions from a grammar that are nonproductive, i. e. they
60  * contain nonterminals that are not eliminable.
61  */
62  Grammar Rnpp(const Grammar& gr);
63 
64  /**
65  * Transform a simple pushdown generator into an LR(1) grammar.
66  *
67  * @param pd
68  * the generator
69  * @return
70  * the grammar
71  */
72  Grammar Sp2Lr(const PushdownGenerator& pd);
73 
74  /**
75  * Transform a simple pushdown generator into an LR(1) grammar. Memory-optimized version.
76  * May take significantly longer than the non-optimized version.
77  *
78  * @param pd
79  * the generator
80  * @return
81  * the grammar
82  */
83  Grammar Sp2Lr2(const PushdownGenerator& pd);
84 
85  /**
86  * Remove all unreachable productions and nonterminals from the grammar
87  *
88  * @param gr
89  * grammar with productions to be removed
90  * @return
91  * grammar with only reachable productions
92  */
93  Grammar Rup(const Grammar& gr);
94 
95 } // namespace faudes
96 
97 #endif

libFAUDES 2.24g --- 2014.09.15 --- c++ api documentaion by doxygen