public class SetAlgebra extends Algebra<Set<List<String>>>
TreeAutomaton.getRulesBottomUp(int, int[])
, not
TreeAutomaton.getRulesTopDown(int, int)
. This means that you need to
take care to only ever call methods on them that look at rules bottom-up.Modifier and Type | Class and Description |
---|---|
static class |
SetAlgebra.NoModelException |
Constructor and Description |
---|
SetAlgebra()
Creates a new instance with a new model and signature.
|
SetAlgebra(Map<String,Set<List<String>>> atomicInterpretations)
Creates a new instance with a new signature and model, which adds the
given atomicInterpretations to the model.
|
Modifier and Type | Method and Description |
---|---|
TreeAutomaton |
decompose(Set<List<String>> value)
Computes a decomposition automaton for the given value.
|
Map<String,Set<List<String>>> |
getAtomicInterpretations() |
boolean |
hasOptions()
Returns true if the algebra implementation has options that would make
sense to be set using
Algebra.setOptions(java.lang.String) . |
Set<List<String>> |
parseString(String representation)
Resolves the string representation of some element of the algebra's
domain to this element.
|
void |
readOptions(Reader optionReader)
Reads the options from a Json string representation.
|
void |
setAtomicInterpretations(Map<String,Set<List<String>>> atomicInterpretations) |
void |
writeOptions(Writer optionWriter)
Writes the interpretations of the atomic concepts to the given Writer.
|
evaluate, getAllAlgebraClasses, getClassOfValues, getSignature, representAsString, setOptions, visualize
public SetAlgebra()
public boolean hasOptions()
Algebra
Algebra.setOptions(java.lang.String)
.hasOptions
in class Algebra<Set<List<String>>>
public void writeOptions(Writer optionWriter) throws Exception
writeOptions
in class Algebra<Set<List<String>>>
optionWriter
- Exception
readOptions(java.io.Reader)
public TreeAutomaton decompose(Set<List<String>> value)
Algebra
public void readOptions(Reader optionReader) throws Exception
{"sleep": [["e", "r1"]], "rabbit": [["r1"], ["r2"]], "white": [["r1"], ["b"]], "in": [["r1","h"], ["f","h2"]], "hat": [["h"], ["h2"]] }
public final void setAtomicInterpretations(Map<String,Set<List<String>>> atomicInterpretations)
public Map<String,Set<List<String>>> getAtomicInterpretations()
public Set<List<String>> parseString(String representation) throws ParserException
Algebra
TreeAlgebra.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<Set<List<String>>>
ParserException
Copyright © 2017. All rights reserved.