- java.lang.Object
-
- io.github.contractautomata.catlib.automaton.transition.Transition<S1,L1,S,L>
-
- io.github.contractautomata.catlib.automaton.transition.ModalTransition<S1,L1,S,L>
-
- Type Parameters:
S1
- generic type of the content of SL1
- generic type of the content of LS
- generic type of the stateL
- generic type of the label
public class ModalTransition<S1,L1,S extends State<S1>,L extends Label<L1>> extends Transition<S1,L1,S,L>
Class implementing a Modal Transition of an Automaton.
A modal transition is a transition further equipped with a modality.
Modalities are either permitted and necessary.
A permitted transition is controllable.
Necessary transitions can be either urgent (i.e., uncontrollable) or lazy.
A lazy transition can be either controllable or uncontrollable according
to a controllability predicate that predicates over the set of transitions of an automaton.- Author:
- Davide Basile
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModalTransition.Modality
The enum of possible modalities of a transition
-
Constructor Summary
Constructors Constructor Description ModalTransition(S source, L label, S target, ModalTransition.Modality type)
Constructing a modal transition from the source, target states, the label and the modality.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Overrides the method of the object classModalTransition.Modality
getModality()
Getter of modalityint
hashCode()
Overrides the method of the object classboolean
isLazy()
Returns true if the transition is lazyboolean
isNecessary()
Returns true if the transition is necessaryboolean
isPermitted()
Returns true if the transition is permittedboolean
isUncontrollable(Set<? extends ModalTransition<S1,Action,S,CALabel>> tr, Set<State<S1>> badStates, java.util.function.BiPredicate<ModalTransition<S1,Action,S,CALabel>,ModalTransition<S1,L1,S,L>> controllabilityPred)
Returns true if the transition is uncontrollable.boolean
isUrgent()
Returns true if the transition is urgentString
toString()
Print a String representing this object-
Methods inherited from class io.github.contractautomata.catlib.automaton.transition.Transition
getLabel, getRank, getSource, getTarget
-
-
-
-
Field Detail
-
URGENT
public static final String URGENT
Constant symbol denoting a urgent modality- See Also:
- Constant Field Values
-
LAZY
public static final String LAZY
Constant symbol denoting a lazy modality- See Also:
- Constant Field Values
-
NECESSARY
public static final String NECESSARY
Constant symbol denoting a necessary modality- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ModalTransition
public ModalTransition(S source, L label, S target, ModalTransition.Modality type)
Constructing a modal transition from the source, target states, the label and the modality. The modality must be non-null. Requirements of the constructor of the super-class must hold.- Parameters:
source
- the source statelabel
- the labeltarget
- the target statetype
- the modality
-
-
Method Detail
-
isUrgent
public boolean isUrgent()
Returns true if the transition is urgent- Returns:
- true if the transition is urgent
-
isLazy
public boolean isLazy()
Returns true if the transition is lazy- Returns:
- true if the transition is lazy
-
isNecessary
public boolean isNecessary()
Returns true if the transition is necessary- Returns:
- true if the transition is necessary
-
isPermitted
public boolean isPermitted()
Returns true if the transition is permitted- Returns:
- true if the transition is permitted
-
getModality
public ModalTransition.Modality getModality()
Getter of modality- Returns:
- the modality
-
hashCode
public int hashCode()
Overrides the method of the object class
-
equals
public boolean equals(Object obj)
Overrides the method of the object class
-
toString
public String toString()
Print a String representing this object
-
isUncontrollable
public boolean isUncontrollable(Set<? extends ModalTransition<S1,Action,S,CALabel>> tr, Set<State<S1>> badStates, java.util.function.BiPredicate<ModalTransition<S1,Action,S,CALabel>,ModalTransition<S1,L1,S,L>> controllabilityPred)
Returns true if the transition is uncontrollable. An urgent transition is uncontrollable, a permitted transition is not uncontrollable. A lazy transition is uncontrollable if and only if none of the pairs formed by this transition and a transition t belonging to tr satisfies the controllability predicate, where t must be a match and the source state of t must not be contained in the set badStates.- Parameters:
tr
- the set of transitions to checkbadStates
- the set of badstates to checkcontrollabilityPred
- the controllability predicate- Returns:
- true if the transition is uncontrollable
-
-