Skip to content
soulne4ny edited this page Nov 4, 2012 · 3 revisions

Matching Simple Formulas

Simple Formula

Simple Formula is a kind of string containing chemical elements, indexes and brackets. Chemical elements are http://en.wikipedia.org/wiki/Chemical_element#List_of_the_118_known_chemical_elements.

Example:

  • H2SO4 consist of terminals H, 2, S, O, 4.

Implementations

Straight

There should be a set of terminals and a set of chemical compounds. It requires

  • TerminalRegistry and CompoundRegistry that could be simple sets of String.
    • specific API for showing field cells content in UI.
  • FormulaReactor in place of SimpleReactor or FormulaReporter in place of CompoundReporter.

Based on existing ElementRegistry

ElementRegistry should be populated with wildcard 'elements', like H{*} and {*}2.

Wildcard-elements representing atoms Xx{*} should be associated with all possible productions. Wildcard-elements representing indexes -- with all possible inputs(left-parts) having the same productions as inputs. This will result in filtering inputs.

It seem existing element registry and algorithms should be enough, as also UI representation.

Conclusion

The straight way looks simpler.

Clone this wiki locally