Class LTLAtomic

All Implemented Interfaces:
Function<IOSignal<String>,Double>, TemporalLogic<String>, TemporalLogic.LTLFormula

public class LTLAtomic extends AbstractTemporalLogic<String> implements TemporalLogic.LTLFormula
The atomic propositions in LTL formulas
  • Field Details

    • formulaBase

      private final LTLFormulaBase formulaBase
    • inputString

      private final Optional<String> inputString
    • outputString

      private final Optional<String> outputString
    • IDENTIFIER

      private static final Pattern IDENTIFIER
    • KEYWORDS

      private static final Set<String> KEYWORDS
      The keywords of the LTL grammar that match IDENTIFIER but are not lexed as identifiers.
  • Constructor Details

  • Method Details

    • setAPs

      public void setAPs(LTLAPs aps)
      Sets the universe of atomic propositions for this formula. This is necessary for correctly computing negation.
      Specified by:
      setAPs in interface TemporalLogic.LTLFormula
      Parameters:
      aps - The atomic propositions containing all possible input and output APs
    • getAPs

      public LTLAPs getAPs()
      Gets the atomic propositions for this formula.
      Specified by:
      getAPs in interface TemporalLogic.LTLFormula
      Returns:
      The atomic propositions, or null if not set
    • getAllAPs

      public Set<String> getAllAPs()
      Returns all atomic propositions from the appropriate set based on the IO type. Requires that APs have been set via setAPs() before calling this method.
      Specified by:
      getAllAPs in interface TemporalLogic<String>
      Returns:
      Set of atomic propositions based on the IO type (input, output, or both)
      Throws:
      IllegalStateException - if APs have not been set
    • collectAtomicPropositions

      public void collectAtomicPropositions(LTLAPs aps)
      Description copied from interface: TemporalLogic.LTLFormula
      Collects all atomic propositions from this formula and its subformulas.
      Specified by:
      collectAtomicPropositions in interface TemporalLogic.LTLFormula
      Parameters:
      aps - The atomic propositions to populate
    • constructSatisfyingAtomicPropositions

      public void constructSatisfyingAtomicPropositions()
      Specified by:
      constructSatisfyingAtomicPropositions in interface TemporalLogic<String>
    • toAbstractString

      public String toAbstractString()
      Description copied from interface: TemporalLogic
      Returns a string representation of the formula in the format of LTSMin.
      Specified by:
      toAbstractString in interface TemporalLogic<String>
      Returns:
      a String object representing the formula in the format of LTSMin.
    • toString

      public String 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 STLFactory or LTLFactory, 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 nullPositive flag 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.

      Specified by:
      toString in interface TemporalLogic<String>
      Overrides:
      toString in class Object
      Returns:
      a human-readable string representation of the formula
    • formatSymbol

      static String formatSymbol(String symbol)
      Parameters:
      symbol - the symbol to print
      Returns:
      symbol itself if it is an identifier in the LTL grammar, otherwise a quoted string
    • structuralKind

      protected Class<?> structuralKind()
      Returns the class representing the operator of this formula, shared by its STL/LTL-specific subclasses.
      Specified by:
      structuralKind in class AbstractTemporalLogic<String>
      Returns:
      the class representing the operator of this formula, e.g., TemporalGlobally.class
    • structuralFields

      protected List<Object> 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 its Enum.name().
      Specified by:
      structuralFields in class AbstractTemporalLogic<String>
      Returns:
      the syntactic fields of this formula in a fixed order
    • toAbstractLTLString

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

      public String toOwlString()
      Specified by:
      toOwlString in interface TemporalLogic<String>
    • getRoSI

      public RoSI getRoSI(IOSignal<String> signal)
      Description copied from interface: TemporalLogic
      Evaluate the formula on the given signal and returns the RoSI, i.e., the range of the possible robustness values after concatenating a suffix.
      Specified by:
      getRoSI in interface TemporalLogic<String>
      Parameters:
      signal - The input-output signal to evaluate the formula on
      Returns:
      a RoSI object representing the range of the possible robustness values after concatenating a suffix.
    • toNnf

      public TemporalLogic.LTLFormula toNnf(boolean negate)
      Specified by:
      toNnf in interface TemporalLogic<String>
    • toDisjunctiveForm

      public TemporalLogic.LTLFormula toDisjunctiveForm()
      Specified by:
      toDisjunctiveForm in interface TemporalLogic<String>
    • getAllConjunctions

      public List<TemporalLogic<String>> getAllConjunctions()
      Specified by:
      getAllConjunctions in interface TemporalLogic<String>