Changeset 15795 for branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration
- Timestamp:
- 02/21/18 10:44:54 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/Grammar.cs
r15794 r15795 27 27 public NonterminalSymbol SimpleTerm; 28 28 29 public NonterminalSymbol InvExpr; 30 public NonterminalSymbol InvTerm; 31 29 32 public TerminalSymbol Addition; 30 33 public TerminalSymbol Multiplication; … … 74 77 SimpleTerm = new NonterminalSymbol("SimpleTerm"); 75 78 79 InvExpr = new NonterminalSymbol("InvExpr"); 80 InvTerm = new NonterminalSymbol("InvTerm"); 81 76 82 Addition = new TerminalSymbol("+"); 77 83 Multiplication = new TerminalSymbol("*"); … … 93 99 94 100 Term.AddProduction(Factor, Term, Multiplication); 95 Term.AddProduction(Expr, Inv, Term, Multiplication);96 101 Term.AddProduction(Factor); 102 Term.AddProduction(InvExpr, Inv); 97 103 98 104 Factor.AddProduction(Var); … … 110 116 SimpleTerm.AddProduction(Var, SimpleTerm, Multiplication); 111 117 SimpleTerm.AddProduction(Var); 118 119 InvExpr.AddProduction(InvTerm, InvExpr, Addition); 120 InvExpr.AddProduction(InvTerm); 121 122 InvTerm.AddProduction(Factor, InvTerm, Multiplication); 123 InvTerm.AddProduction(Factor); 112 124 #endregion 113 125 … … 137 149 138 150 Stack<Symbol> parseStack = new Stack<Symbol>(sentence); 139 CancelOutCompoundInverse(parseStack);140 151 141 152 Symbol peek = parseStack.Peek(); … … 145 156 146 157 private string[] GetSubtreeHashes(Stack<Symbol> parseStack) { 147 CancelOutCompoundInverse(parseStack);148 158 Symbol currentSymbol = parseStack.Pop(); 149 159 … … 237 247 } 238 248 249 /* 239 250 private void CancelOutCompoundInverse(Stack<Symbol> parseStack) { 240 251 // Resolve compound divisions … … 250 261 parseStack.Push(Inv); 251 262 } // else: compound divisions fully cancel out each other. 252 } 263 } */ 253 264 #endregion 254 265
Note: See TracChangeset
for help on using the changeset viewer.