Class AbstractTemporalLogic<I>

java.lang.Object
net.maswag.falcaun.temporal.AbstractTemporalLogic<I>
Type Parameters:
I - The type of the input at each step.
All Implemented Interfaces:
Function<IOSignal<I>,Double>, TemporalLogic<I>
Direct Known Subclasses:
LTLAtomic, STLAbstractAtomic, TemporalAnd, TemporalConst, TemporalImply, TemporalNext, TemporalNot, TemporalOp, TemporalOr, TemporalRelease, TemporalSub, TemporalUntil

public abstract class AbstractTemporalLogic<I> extends Object implements TemporalLogic<I>
Abstract base class for temporal logic formulas. This class provides a framework for implementing temporal logic formulas, which can be used to specify properties of system behavior over time.
Author:
Masaki Waga <masakiwaga@gmail.com>
  • Field Details

    • nonTemporal

      protected boolean nonTemporal
      Indicates whether the formula is non-temporal.
    • initialized

      boolean initialized
      Indicates whether the formula has been initialized.
    • satisfyingAtomicPropositions

      protected Set<String> satisfyingAtomicPropositions
      A set of atomic propositions such that the formula is satisfied if and only if one of these propositions is satisfied. This field is null for temporal formulas.
    • iOType

      The type of input/output (I/O) that the formula is concerned with, either TemporalLogic.IOType.INPUT or TemporalLogic.IOType.OUTPUT.
  • Constructor Details

    • AbstractTemporalLogic

      protected AbstractTemporalLogic()
      Default constructor for AbstractTemporalLogic. Initializes a new instance with default values. Subclasses should call this constructor and then set appropriate values for their specific implementation.
  • Method Details

    • equals

      public final boolean equals(Object o)

      Formulas are equal if and only if they have the same structuralKind() and equal structuralFields(). This is syntactic equality, not logical equivalence: e.g., p && q and q && p are different. The STL/LTL-specific subclasses do not take part in equality, e.g., a generic TemporalGlobally equals an STLGlobally with an equal operand. Derived state, caches, and the abstraction configuration (e.g., the mappers of STLAbstractAtomic) are ignored, so a cache depending on the configuration must include it in its key separately.

      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()

      The hash code is deterministic across executions.

      Overrides:
      hashCode in class Object
    • structuralKind

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

      protected abstract 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().
      Returns:
      the syntactic fields of this formula in a fixed order
    • parenthesize

      static String parenthesize(String s)
      Wraps the given string with parentheses.
      Parameters:
      s - the string to wrap
      Returns:
      "( " + s + " )"
    • makeAbstractStringWithAtomicStrings

      protected String makeAbstractStringWithAtomicStrings()
      Constructs an abstract string representation of the formula using the strings of atomic propositions. This method is meaningful only for non-temporal formulas that contain constraints on either inputs or outputs.
      Returns:
      The abstract string representation of the formula.
      Throws:
      IllegalStateException - If the formula is not initialized when this method is called.
    • makeAbstractStringWithAtomicStrings

      protected String makeAbstractStringWithAtomicStrings(Optional<Map<String,String>> mapper)
    • getSatisfyingAtomicPropositions

      public Set<String> getSatisfyingAtomicPropositions()
      Returns the set of atomic propositions such that the formula is satisfied if and only if one of these propositions is satisfied. For temporal formulas, this method returns null because no such set exists.
      Specified by:
      getSatisfyingAtomicPropositions in interface TemporalLogic<I>
      Returns:
      The set of satisfying atomic propositions, or null if the formula is temporal.