E - public class BinarizingAlgebra<E> extends Algebra<E>
By default, this algebra uses "_@_" for the concatenation symbol. You can specify your own symbol by passing it to the constructor.
| Constructor and Description |
|---|
BinarizingAlgebra(Algebra<E> underlyingAlgebra)
Create a new instance with _@_ as the concatenation symbol.
|
BinarizingAlgebra(Algebra<E> underlyingAlgebra,
String appendSymbol)
Create a new instance with a user specified concatenation symbol.
|
| Modifier and Type | Method and Description |
|---|---|
TreeAutomaton |
binarizeTreeAutomaton(TreeAutomaton<? extends Object> underlyingAutomaton)
Returns a tree automaton in which all rules are binarized by introducing
intermediate rules with the concatenation symbol of this algebra.
|
TreeAutomaton |
decompose(E value)
Computes a decomposition automaton for the given value.
|
E |
evaluate(Tree<String> t)
Evaluates a term over the algebra's signature into an algebra object.
|
String |
getAppendSymbol()
Returns the concatenation symbol used by this algebra.
|
E |
parseString(String representation)
Resolves the string representation of some element of the algebra's
domain to this element.
|
getAllAlgebraClasses, getClassOfValues, getSignature, hasOptions, readOptions, representAsString, setOptions, visualize, writeOptionspublic BinarizingAlgebra(Algebra<E> underlyingAlgebra)
underlyingAlgebra - public BinarizingAlgebra(Algebra<E> underlyingAlgebra, String appendSymbol)
underlyingAlgebra - appendSymbol - public String getAppendSymbol()
public E evaluate(Tree<String> t)
Algebrapublic TreeAutomaton binarizeTreeAutomaton(TreeAutomaton<? extends Object> underlyingAutomaton)
underlyingAutomaton - public TreeAutomaton decompose(E value)
Algebrapublic E parseString(String representation) throws ParserException
AlgebraTreeAlgebra.parseString(java.lang.String)
resolves the string "f(a,b)" into a tree with three nodes.It is the job of an algebra class to keep track of the signature of the algebra. Many algebras have a potentially infinite domain (e.g. the string algebra can be used with arbitrary alphabets), so the algebra class should keep track of the symbols that were actually used in the current run of the program. The best practice is to update the signature each time the parseString method is called. The rest of the IRTG tool code takes care to call parseString of the respective algebra to obtain objects of type E, so this ensures that the signature is always up-to-date.
parseString in class Algebra<E>ParserExceptionCopyright © 2017. All rights reserved.