Class SequencePredicate<State>
java.lang.Object
eu.iv4xr.framework.extensions.ltl.SequencePredicate<State>
- Direct Known Subclasses:
BoundedLTL
,LTL
An abstract class representing a predicate over finite sequences, defining a
minimum interface needed to evaluate such a predicate on a given sequence.
The class itself does not provide an implementation for the predicate.
Since we typically use such a sequence to represent an execution of some system through a series of states, elements of the sequence will be called 'states'. These states can be thought as representing the series of states passed by some execution of a system. Note this class does not in itself restrict what a 'state' is. For example, if we need to express a predicate over pairs of (transition,state), then we can use a sequence of such pairs as our 'path'.
Two modes for checking/evaluating a sequence predicate on a sequence are supported:
- (1) Invoke
sat(List)
, giving the sequence to it. - (2) However, giving a sequence of states is not always possible. Assuming
we can still give the states one at a time, we can do the checking incrementally like this:
- (a) invoke
startChecking()
- (b) feed the state one at a time using
checkNext(Object)
- (c) when there is no more state to check (so, we are at the end of the sequence),
invoke
endChecking()
- (d) invoke
sat()
to get the result.
- (a) invoke
- Author:
- Wish
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Use this to check this predicate on a sequence of states by feeding the states one state at a time.abstract void
Call this to mark that the last state of the execution under evaluation has been fed to this predicate.abstract SATVerdict
sat()
Return the result of the checking whether this predicate holds on the last sequence given to it.Check is the given sequence of states (representing some execution) satisfies this LTL formula.abstract void
Invoke this first before start checking this predicate on a sequence.
-
Constructor Details
-
SequencePredicate
public SequencePredicate()
-
-
Method Details
-
startChecking
public abstract void startChecking()Invoke this first before start checking this predicate on a sequence. -
checkNext
Use this to check this predicate on a sequence of states by feeding the states one state at a time. The typical setup is if the execution under evaluation does not allow states to be serialized or cloned. This means that we cannot collect those states in some collection and therefore the execution has to be checked incrementally by feeding this predicate one state (the current state) at a time. -
endChecking
public abstract void endChecking()Call this to mark that the last state of the execution under evaluation has been fed to this predicate. So, we can now call sat() to inspect whether this predicate holds on the execution or not. -
sat
Return the result of the checking whether this predicate holds on the last sequence given to it. The the sequence was given one state at a time using checkNext(), sat() should be called after endChecking() was called.- The method returns SAT if this predicate holds on the sequence (it is satisfied by the sequence):
- UNSAT if the sequence does not satisfy this predicate.
- UNKNOWN if neither SAT nor UNSAT can be decided.
-
sat
Check is the given sequence of states (representing some execution) satisfies this LTL formula. This method will implicitly call startChecking() and endChecking(). A verdict is returned, saying whether this predicate holds on the given sequence.- The method returns SAT if this predicate holds on the sequence (it is satisfied by the sequence).
- UNSAT if the sequence does not satisfy this predicate.
- UNKNOWN if neither SAT nor UNSAT can be decided.
-