Class LTL2Buchi
java.lang.Object
eu.iv4xr.framework.extensions.ltl.LTL2Buchi
For translating an LTL formula to a Buchi automaton. For now, we
exclude the following patterns:
- The translator does not handle conjunctions "phi ∧ psi";
- also does not handle left-recursive until and weak-until. E.g. "(p U q) U r" cannot be handled.
- "not X phi" to "X not phi"
- "not(phi ∧ psi)" to "(not phi) || (not psi)"
- "not(phi || psi)" to "(not phi) ∧ (not psi)"
- "not(phi U psi) to "(phi ∧ not psi) W (not phi ∧ not psi)"
- "not(phi W psi) to "(phi ∧ not psi) U (not phi ∧ not psi)"
- X phi where phi is non-atom LTL formula. Let B is the Buchi of phi, with S1 as the initial state. Create a new initial state S0, and add (S0,true,S1) as a new transition.
- p U psi, where p is a state-predicate (atom). Let B is the Buchi of psi. Let S1 be the initial state of B, Create a new initial state S0, with (S0,p,S0) as a transition. For each out-going transitions of S1: (S1,q,T), add a new transition (S0,q,T).
- phi U psi, where phi is not a state-predicate: unimplemented.
- p W psi, where p is a state-predicate (atom). Let B is the Buchi of psi. Let S1 be the initial state of B, Create a new initial state S0, with (S0,p,S0) as a transition. We also add S0 as an omega-accepting state. For each out-going transition of S1: (S1,q,T), add a new transition (S0,q,T).
- phi W psi, where phi is not a state-predicate: unimplemented.
- phi || psi. Let B and C be the Buchis of phi and psi, respectively, and S1 and S2 their initial states. We make S1 as the initial state of the combined Buchi. We remove S2, and change every transition that goes from or to S2 to go from/to S1.
- phi ∧ psi. Not implemented. TODO.
- Author:
- Wish
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <State> LTL<State>
andRewrite(LTL<State> f)
Normalize an LTL formula by rewriting conjunctions.static <State> LTL<State>
static <State> LTL<State>
static <State> LTL<State>
(package private) static String
(package private) static <State> Predicate<State>
static Buchi
getBuchi(LTL<IExplorableState> phi)
Translate the given LTL formula to a Buchi automaton.static <State> boolean
static <State> boolean
isIrreducibleConj(LTL.And<State> phi)
Check if the cunjunction is irreducible.static <State> LTL.And<State>
Recognize "not(p ∧ ...static <State> boolean
static <State> LTL.Next<State>
Recognize "not(next(psi))".static <State> LTL.Not<State>
Recognize "not(not(phi))".static <State> LTL.Now<State>
To recognize and destruct "not(now p)".static <State> LTL.Or<State>
Recognize "not(p || ...static <State> LTL<State>
To recognize and destruct "not(phi)" pattern, where phi is non-atomic.static <State> LTL.Until<State>
isNotUntil(LTL<State> psi)
Recognize "not(p U q)" .static <State> LTL.WeakUntil<State>
isNotWeakUntil(LTL<State> psi)
Recognize "not(p W q)" .static <State> Predicate<State>
To recognize and destruct "now p".static <State> LTL<State>
pushNegations(LTL<State> f)
Normalize an LTL formula by rewriting it, so that negations are recursively pushed as far as possible inside.
-
Constructor Details
-
LTL2Buchi
public LTL2Buchi()
-
-
Method Details
-
arg
-
argL
-
argR
-
isAtom
-
isNotAtom
-
isNow
To recognize and destruct "now p". Returns p. -
isNotNow
To recognize and destruct "not(now p)". Returns now p. -
isNotPhi
To recognize and destruct "not(phi)" pattern, where phi is non-atomic. This returns phi. -
isNotNext
Recognize "not(next(psi))". Return "next psi". -
isNotNot
Recognize "not(not(phi))". Return "not phi". -
isNotAnd
Recognize "not(p ∧ ... ∧ q)" . Returns "p ∧ ... ∧ q". -
isNotOr
Recognize "not(p || ... || q)" . Returns "p || ... || q". -
isNotUntil
Recognize "not(p U q)" . Returns "p U q". -
isNotWeakUntil
Recognize "not(p W q)" . Returns "p W q". -
pushNegations
Normalize an LTL formula by rewriting it, so that negations are recursively pushed as far as possible inside. -
getBuchi
Translate the given LTL formula to a Buchi automaton. -
atomName
-
atomPred
-
andRewrite
Normalize an LTL formula by rewriting conjunctions. It follows the following rewrite rules:- p ∧ q = (\s -> p(s) ∧ q(s))
- f ∧ (g || h) = (f ∧ g) || (f ∧ h)
- p ∧ (f U g) = (p ∧ g) || (p ∧ f ∧ X(f U g))
- p ∧ (f W g) = (p ∧ g) || (p ∧ f ∧ X(f W g))
- Xf ∧ Xg = X(f ∧ g)
- (*) Xf ∧ (g U h) = (Xf ∧ h) || (g ∧ X(f ∧ (g U h))
- (*) Xf ∧ (g W h) = (Xf ∧ h) || (g ∧ X(f ∧ (g W h)))
- (a U b) ∧ (f U g) = (a ∧ f U (b ∧ (f U g))) || (a ∧ f U (g ∧ (a U b)))
- (a U b) ∧ (f W g) = (a ∧ f U (b ∧ (f W g))) || (a ∧ f U (g ∧ (a U b))) ... notice that two U in the middle. They are correct.
- (a W b) ∧ (f W g) = (a ∧ f W (b ∧ (f W g))) || (a ∧ f W (g ∧ (a U b)))
- Parameters:
f
- An LTL formula. It should not contain any negation. ApplypushNegations(LTL)
firsrt to normalize an LTL by pushing all negations inside until they all disappear inside atoms.- Returns:
-
isIrreducibleConj
Check if the cunjunction is irreducible. It is irreducible if it is of the form p ∧ Xphi. Such a form cannot be further rewritten.
-