Package net.maswag.falcaun.temporal
Class STLAbstractAtomic
java.lang.Object
net.maswag.falcaun.temporal.AbstractTemporalLogic<List<Double>>
net.maswag.falcaun.temporal.STLAbstractAtomic
- All Implemented Interfaces:
Function<IOSignal<List<Double>>,,Double> TemporalLogic<List<Double>>,TemporalLogic.STLCost
- Direct Known Subclasses:
STLInputAtomic,STLOutputAtomic
public abstract class STLAbstractAtomic
extends AbstractTemporalLogic<List<Double>>
implements TemporalLogic.STLCost
STLAtomic class.
- Author:
- Masaki Waga <masakiwaga@gmail.com>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe comparison operators of STL atomic propositions.Nested classes/interfaces inherited from interface net.maswag.falcaun.temporal.TemporalLogic
TemporalLogic.IOType, TemporalLogic.LTLFormula, TemporalLogic.STLCost -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final doubleprotected final STLAbstractAtomic.Operationprotected final intFields inherited from class net.maswag.falcaun.temporal.AbstractTemporalLogic
initialized, iOType, nonTemporal, satisfyingAtomicPropositions -
Constructor Summary
ConstructorsConstructorDescriptionSTLAbstractAtomic(int sigIndex, STLAbstractAtomic.Operation op, double comparator) Constructor for STLAbstractAtomic. -
Method Summary
Modifier and TypeMethodDescriptioncartesianProductCharacters(@NotNull List<Set<Character>> charList) Take the cartesian product of a list of sets of characters and return a set of strings by concatenating the characters.constructAllAPs(int index) Construct the characters that represent the abstract values of the signal.protected voidconstructAtomicStrings(int signalSize) constructEqAPs(int index, double threshold) Constructs a set of characters representing atomic propositions that are equal to the given threshold for the specified signal index.constructLargerAPs(int index, double threshold) Constructs a set of characters representing atomic propositions that are greater than the given threshold for the specified signal index.constructSmallerOrEqualAPs(int index, double threshold) Constructs a set of characters representing atomic propositions whose values are smaller than or equal to the given threshold for the specified signal index.decomposeMap(Map<T, Double> map) Decomposes a map with value Doubles into a pair of lists of keys and Doubles.(package private) static <T> voidDecomposes a list of maps with value Doubles into a list of pair of lists of keys and Doubles.(package private) static StringformatThreshold(double value) Returns the string representation of a threshold without loss of precision and without the exponent notation, which the STL grammar does not support.getAllAPs(int signalSize) getRoSISingle(net.automatalib.word.Word<List<Double>> signal) protected abstract StringReturns the syntactic fields of this formula, e.g., the operands and the bounds of a bounded temporal operator.protected Class<?> Returns the class representing the operator of this formula, shared by its STL/LTL-specific subclasses.toAbstractLTLString(Map<String, String> mapper) Returns a string representation of the formula in the format of LTSMin.toString()Returns a human-readable string representation of the formula.Methods inherited from class net.maswag.falcaun.temporal.AbstractTemporalLogic
equals, getSatisfyingAtomicPropositions, hashCode, makeAbstractStringWithAtomicStrings, makeAbstractStringWithAtomicStrings, parenthesizeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.maswag.falcaun.temporal.TemporalLogic
apply, constructSatisfyingAtomicPropositions, getAllAPs, getAllConjunctions, getIOType, getRoSI, getSatisfyingAtomicPropositions, isInitialized, isNonTemporal, toDisjunctiveForm, toLTLString, toNnf
-
Field Details
-
op
-
sigIndex
protected final int sigIndex -
comparator
protected final double comparator -
allAPs
-
-
Constructor Details
-
STLAbstractAtomic
Constructor for STLAbstractAtomic.
- Parameters:
sigIndex- An index of signalsop- The comparison operatorSTLAbstractAtomic.Operationcomparator- The value to compare against
-
-
Method Details
-
getAllAPs
- Parameters:
signalSize- the length of the signal greater than this.sigIndex
-
getRoSISingle
-
getSignalName
-
toString
Returns a human-readable string representation of the formula.The representation is unambiguous only for the formulas supported by the parsers: if a formula is structurally equal to one constructed by
STLFactoryorLTLFactory, its string representation is parsed back to a structurally equal formula. Otherwise, structurally different formulas may have the same string representation, e.g.:- empty or singleton conjunctions and disjunctions,
- n-ary conjunctions and disjunctions, which are parsed back as left-nested binary ones,
- the next operator, whose
nullPositiveflag is not printed, - LTL atomic propositions with both input and output symbols, which are printed like conjunctions,
- LTL symbols outside the grammar and non-finite STL thresholds, which the parsers reject, and
- other formulas outside the grammar, e.g.,
TemporalConst.
Thus, this method must not be used as a substitute for structural equality or as a unique key, e.g., of a cache.
-
formatThreshold
Returns the string representation of a threshold without loss of precision and without the exponent notation, which the STL grammar does not support. Non-finite values cannot be parsed.- Parameters:
value- the threshold to print- Returns:
- the string representation of
value
-
structuralKind
Returns the class representing the operator of this formula, shared by its STL/LTL-specific subclasses.- Specified by:
structuralKindin classAbstractTemporalLogic<List<Double>>- Returns:
- the class representing the operator of this formula, e.g.,
TemporalGlobally.class
-
structuralFields
Returns the syntactic fields of this formula, e.g., the operands and the bounds of a bounded temporal operator. Derived state, caches, and the abstraction configuration must not be included. Each element must have a deterministic hash code, e.g., an enum constant must be represented by itsEnum.name().- Specified by:
structuralFieldsin classAbstractTemporalLogic<List<Double>>- Returns:
- the syntactic fields of this formula in a fixed order
-
constructAtomicStrings
protected void constructAtomicStrings(int signalSize) - Parameters:
signalSize- the length of the signal
-
toAbstractString
Returns a string representation of the formula in the format of LTSMin.- Specified by:
toAbstractStringin interfaceTemporalLogic<List<Double>>- Returns:
- a
Stringobject representing the formula in the format of LTSMin.
-
toAbstractLTLString
- Specified by:
toAbstractLTLStringin interfaceTemporalLogic<List<Double>>
-
toOwlString
- Specified by:
toOwlStringin interfaceTemporalLogic<List<Double>>
-
constructSmallerOrEqualAPs
Constructs a set of characters representing atomic propositions whose values are smaller than or equal to the given threshold for the specified signal index. This is used for the non-strict comparison <= (STLAbstractAtomic.Operation.LE).- Parameters:
index- The index of the signal.- Returns:
- A set of characters representing the atomic propositions.
-
constructLargerAPs
Constructs a set of characters representing atomic propositions that are greater than the given threshold for the specified signal index.- Parameters:
index- The index of the signal.- Returns:
- A set of characters representing the atomic propositions.
-
constructEqAPs
Constructs a set of characters representing atomic propositions that are equal to the given threshold for the specified signal index.- Parameters:
index- The index of the signal.- Returns:
- A set of characters representing the atomic propositions.
-
constructAllAPs
Construct the characters that represent the abstract values of the signal.- Parameters:
index- The index of the signal
-
cartesianProductCharacters
@NotNull public static @NotNull Set<String> cartesianProductCharacters(@NotNull @NotNull List<Set<Character>> charList) Take the cartesian product of a list of sets of characters and return a set of strings by concatenating the characters.For example, if the input is [[a, b], [c, d]], the output will be {ac, ad, bc, bd}.
- Parameters:
charList- a list of sets of characters- Returns:
- a set of concatenated character combinations
-
decomposeMap
Decomposes a map with value Doubles into a pair of lists of keys and Doubles.- Type Parameters:
T- the type of the keys- Parameters:
map- a map to Doubles- Returns:
- a pair of lists of keys and Doubles. The first element is a list of keys and the second element is a list of values. The returned lists are sorted in ascending order of the values.
-
decomposeMapList
static <T> void decomposeMapList(List<Map<T, Double>> maps, List<List<T>> keyLists, List<List<Double>> valueLists) Decomposes a list of maps with value Doubles into a list of pair of lists of keys and Doubles.- Type Parameters:
T- the type of the keys- Parameters:
maps- a list of maps to Doubles.keyLists- a list of lists of keys. The contents of this list will be cleared.valueLists- a list of lists of values. The contents of this list will be cleared.
-