Package net.maswag.falcaun.parser
Class LTLFormulaHelper
java.lang.Object
net.maswag.falcaun.parser.LTLFormulaHelper
Helper class for LTL formula operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LTLAPscollectAPs(TemporalLogic.LTLFormula formula) Collects all atomic propositions from a formula tree and creates an APs collection.private static voidcollectAtomicPropositionsRecursive(Object formula, LTLAPs aps) static List<TemporalLogic.LTLFormula>convertToLTLFormulas(List<TemporalLogic.STLCost> stlFormulas) Converts a list of STL formulas to prepared LTL formulas.private static voidhandleAtomicFormula(LTLAtomic atomic, LTLAPs aps) Handles atomic formulas by collecting their atomic propositions.private static voidhandleBinaryOperator(Object leftFormula, Object rightFormula, LTLAPs aps) Handles binary operators (operators with two subformulas).private static voidhandleMultiaryOperator(Iterable<? extends TemporalLogic<?>> subFormulas, LTLAPs aps) Handles multiary operators (operators with multiple subformulas).private static voidhandleUnaryOperator(Object subFormula, LTLAPs aps) Handles unary operators (operators with a single subformula).static TemporalLogic.LTLFormulaprepareFormula(TemporalLogic.LTLFormula formula) Prepares a formula for use by collecting its atomic propositions and setting them.static voidsetAPs(TemporalLogic.LTLFormula formula, LTLAPs aps) Sets the atomic propositions on a formula tree and propagates it to all subformulas.
-
Constructor Details
-
LTLFormulaHelper
public LTLFormulaHelper()
-
-
Method Details
-
collectAPs
Collects all atomic propositions from a formula tree and creates an APs collection.- Parameters:
formula- The root formula- Returns:
- An LTLAPs containing all atomic propositions found in the formula
-
setAPs
Sets the atomic propositions on a formula tree and propagates it to all subformulas.- Parameters:
formula- The root formulaaps- The atomic propositions to set
-
prepareFormula
Prepares a formula for use by collecting its atomic propositions and setting them.- Parameters:
formula- The formula to prepare- Returns:
- The same formula with atomic propositions set
-
collectAtomicPropositionsRecursive
-
handleAtomicFormula
Handles atomic formulas by collecting their atomic propositions. -
handleUnaryOperator
Handles unary operators (operators with a single subformula). -
handleBinaryOperator
Handles binary operators (operators with two subformulas). -
handleMultiaryOperator
private static void handleMultiaryOperator(Iterable<? extends TemporalLogic<?>> subFormulas, LTLAPs aps) Handles multiary operators (operators with multiple subformulas). -
convertToLTLFormulas
public static List<TemporalLogic.LTLFormula> convertToLTLFormulas(List<TemporalLogic.STLCost> stlFormulas) Converts a list of STL formulas to prepared LTL formulas.- Parameters:
stlFormulas- The list of STL formulas to convert- Returns:
- A list of prepared LTL formulas with atomic propositions set
- Throws:
IllegalArgumentException- if stlFormulas is null
-