Changeset 15803 for branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/Grammar.cs
- Timestamp:
- 02/22/18 13:11:40 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/Grammar.cs
r15800 r15803 11 11 public class Grammar { 12 12 13 public Symbol StartSymbol ;13 public Symbol StartSymbol { get; } 14 14 15 15 #region Symbols 16 17 16 public VariableSymbol Var; 18 17 … … 43 42 #endregion 44 43 45 46 44 #region HL Symbols for Parsing ExpressionTrees 47 48 45 private TypeCoherentExpressionGrammar symbolicExpressionGrammar; 49 46 … … 60 57 private ISymbol rootSy; 61 58 private ISymbol startSy; 62 63 59 #endregion 64 60 … … 90 86 ClosingBracket = new TerminalSymbol(")"); 91 87 #endregion 92 93 88 94 89 #region Production rules … … 179 174 } 180 175 181 var result = uniqueChildHashes.To List();182 result.Sort();183 return result .ToArray();176 var result = uniqueChildHashes.ToArray(); 177 Array.Sort(result); 178 return result; 184 179 } 185 180 … … 266 261 return hashesArray.Aggregate(start, (result, ti) => ((result << 5) + result) ^ ti.GetHashCode()); 267 262 } 268 269 /*270 private void CancelOutCompoundInverse(Stack<Symbol> parseStack) {271 // Resolve compound divisions272 int compoundFractionsCount = 0;273 274 while (ReferenceEquals(parseStack.Peek(), Inv)) {275 compoundFractionsCount++;276 parseStack.Pop();277 }278 279 if (compoundFractionsCount % 2 != 0) {280 // Compound division are reduced to a single division.281 parseStack.Push(Inv);282 } // else: compound divisions fully cancel out each other.283 } */284 263 #endregion 285 264
Note: See TracChangeset
for help on using the changeset viewer.