Package net.maswag.falcaun.parser
Class STLOutputAtomic
java.lang.Object
net.maswag.falcaun.parser.AbstractTemporalLogic<List<Double>>
net.maswag.falcaun.parser.STLAbstractAtomic
net.maswag.falcaun.parser.STLOutputAtomic
- All Implemented Interfaces:
Function<IOSignal<List<Double>>,,Double> TemporalLogic<List<Double>>,TemporalLogic.STLCost
STLAtomic class.
This class represents an atomic formula in STL for output signals. This class has the functions to construct the atomic propositions, a set of alphabets representing the output signal, from the atomic formula and its output mapper. For example, let an atomic formula be output(0) > 1.0, the 0-th output mapper be {a: 1.0, b: 2.0, c: 3.0}, the 0-th largest be 'd', the set of alphabets of 1st output signal be {'x', 'y'}, and the 1st largest be 'z', then the atomic propositions are {"bx", "by", "bz", "cx", "cy", "cz", "dx", "dy", "dz"}.When the 0-th output mapper is {a: 1.0, b: 2.0, c: 3.0} and largest is {'d'}, the comparator in ranges of (-inf, 1.0], (1.0, 2.0], (2.0, 3.0] is mapped to 'a', 'b', 'c' for each and those in the range (3.0, +inf) are mapped to 'd'.
- Given output(0) > 2.0, the satisfying 0-th alphabets are {'c', 'd'}.
- Given output(0) < 1.0, the satisfying 0-th alphabets are {'a'}. Note that < (Operation.lt) represents a less-than-or-equal-to operator.
- Given output(0) == 4.0,
getAllAPs()raises aRuntimeException.
- Author:
- Masaki Waga <masakiwaga@gmail.com>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.maswag.falcaun.parser.STLAbstractAtomic
STLAbstractAtomic.OperationNested classes/interfaces inherited from interface net.maswag.falcaun.parser.TemporalLogic
TemporalLogic.IOType, TemporalLogic.LTLFormula, TemporalLogic.STLCost -
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class net.maswag.falcaun.parser.STLAbstractAtomic
allAPs, comparator, op, sigIndexFields inherited from class net.maswag.falcaun.parser.AbstractTemporalLogic
initialized, iOType, nonTemporal, satisfyingAtomicPropositions -
Constructor Summary
ConstructorsConstructorDescriptionSTLOutputAtomic(int sigIndex, STLAbstractAtomic.Operation op, double comparator) Constructor for STLOutputAtomic. -
Method Summary
Modifier and TypeMethodDescriptionconstructAllAPs(int index) Construct the characters that represent the abstract values of the signal.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.voidConstructsAbstractTemporalLogic.satisfyingAtomicPropositionsif not initialized.constructSmallerAPs(int index, double threshold) Constructs a set of characters representing atomic propositions that are smaller than the given threshold for the specified signal index.Returns the collection of atomic propositions under consideration.Evaluate the formula on the given signal and returns the RoSI, i.e., the range of the possible robustness values after concatenating a suffix.protected Stringvoid(package private) voidsetLargest(List<Character> largest) Gives the largest alphabets for the atomic formula.(package private) voidsetMapper(OutputMapper mapper) (package private) voidsetOutputMapper(List<Map<Character, Double>> outputMapper) Gives the output mapper for the atomic formula.private voidtoNnf(boolean negate) Methods inherited from class net.maswag.falcaun.parser.STLAbstractAtomic
cartesianProductCharacters, constructAtomicStrings, decomposeMap, decomposeMapList, getAllAPs, getRoSISingle, toAbstractLTLString, toAbstractString, toOwlString, toStringMethods inherited from class net.maswag.falcaun.parser.AbstractTemporalLogic
equals, getSatisfyingAtomicPropositions, hashCode, makeAbstractStringWithAtomicStrings, makeAbstractStringWithAtomicStringsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.maswag.falcaun.parser.TemporalLogic
apply, getIOType, getSatisfyingAtomicPropositions, isInitialized, isNonTemporal, toLTLString
-
Field Details
-
abstractOutputs
-
concreteOutputs
-
largest
-
outputMapper
-
-
Constructor Details
-
STLOutputAtomic
Constructor for STLOutputAtomic.
Constructs an atomic proposition output(sigIndex) op comparator.- Parameters:
sigIndex- An index of output signalsop- The comparison operatorSTLAbstractAtomic.Operationcomparator- The value to compare against
-
-
Method Details
-
getAllAPs
Returns the collection of atomic propositions under consideration. If this formula contains only the input constraints, the atomic propositions are the input constraints. If this formula contains only the output constraints, the atomic propositions are the output constraints. If this formula contains both input and output constraints, the atomic propositions are one of the input and output constraints.- Returns:
- A set of all atomic propositions in the formula
-
constructSatisfyingAtomicPropositions
public void constructSatisfyingAtomicPropositions()ConstructsAbstractTemporalLogic.satisfyingAtomicPropositionsif not initialized. -
constructSmallerAPs
Constructs a set of characters representing atomic propositions that are smaller than the given threshold for the specified signal index.- Specified by:
constructSmallerAPsin classSTLAbstractAtomic- 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.- Specified by:
constructLargerAPsin classSTLAbstractAtomic- 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.- Specified by:
constructEqAPsin classSTLAbstractAtomic- 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. largest is also used to construct the atomic propositions.- Specified by:
constructAllAPsin classSTLAbstractAtomic- Parameters:
index- The index of the signal
-
setOutputMaps
private void setOutputMaps() -
setMapper
-
setAtomic
-
setOutputMapper
Gives the output mapper for the atomic formula. It is required to construct the atomic propositions.- Parameters:
outputMapper- The output mapper to set
-
setLargest
Gives the largest alphabets for the atomic formula. It is required to construct the atomic propositions.- Parameters:
largest- The list of largest characters to set
-
getRoSI
Evaluate the formula on the given signal and returns the RoSI, i.e., the range of the possible robustness values after concatenating a suffix.- Parameters:
signal- The input-output signal to evaluate the formula on- Returns:
- a
RoSIobject representing the range of the possible robustness values after concatenating a suffix.
-
getSignalName
- Specified by:
getSignalNamein classSTLAbstractAtomic
-
toNnf
-
toDisjunctiveForm
-
getAllConjunctions
-