Class STLAbstractAtomic

java.lang.Object
net.maswag.falcaun.parser.AbstractTemporalLogic<List<Double>>
net.maswag.falcaun.parser.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>
  • Field Details

  • Constructor Details

    • STLAbstractAtomic

      public STLAbstractAtomic(int sigIndex, STLAbstractAtomic.Operation op, double comparator)

      Constructor for STLAbstractAtomic.

      Parameters:
      sigIndex - An index of signals
      op - The comparison operator STLAbstractAtomic.Operation
      comparator - The value to compare against
  • Method Details

    • getAllAPs

      protected Set<String> getAllAPs(int signalSize)
      Parameters:
      signalSize - the length of the signal greater than this.sigIndex
    • getRoSISingle

      public RoSI getRoSISingle(net.automatalib.word.Word<List<Double>> signal)
    • getSignalName

      protected abstract String getSignalName()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • constructAtomicStrings

      protected void constructAtomicStrings(int signalSize)
      Parameters:
      signalSize - the length of the signal
    • toAbstractString

      public String toAbstractString()
      Returns a string representation of the formula in the format of LTSMin.
      Specified by:
      toAbstractString in interface TemporalLogic<List<Double>>
      Returns:
      a String object representing the formula in the format of LTSMin.
    • toAbstractLTLString

      public String toAbstractLTLString(Map<String,String> mapper)
      Specified by:
      toAbstractLTLString in interface TemporalLogic<List<Double>>
    • toOwlString

      public String toOwlString()
      Specified by:
      toOwlString in interface TemporalLogic<List<Double>>
    • constructSmallerAPs

      protected abstract Set<Character> 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.
      Parameters:
      index - The index of the signal.
      Returns:
      A set of characters representing the atomic propositions.
    • constructLargerAPs

      protected abstract Set<Character> 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.
      Parameters:
      index - The index of the signal.
      Returns:
      A set of characters representing the atomic propositions.
    • constructEqAPs

      protected abstract Set<Character> 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.
      Parameters:
      index - The index of the signal.
      Returns:
      A set of characters representing the atomic propositions.
    • constructAllAPs

      protected abstract Set<Character> constructAllAPs(int index)
      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

      static <T> org.apache.commons.math3.util.Pair<List<T>,List<Double>> decomposeMap(Map<T,Double> map)
      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.