Browse Source

add Expression.isReachWithStateFormula

isReach() is more restrictive, only allowing propositions as operand
of R=?[ F phi ], while we are also interested in the case where phi
as some complex state formula, potentially with nested operators, etc.
accumulation-v4.7
Joachim Klein 7 years ago
committed by Joachim Klein
parent
commit
f4dab093cb
  1. 17
      prism/src/parser/ast/Expression.java

17
prism/src/parser/ast/Expression.java

@ -820,7 +820,8 @@ public abstract class Expression extends ASTElement
}
/**
* Test if an expression is a reachability path formula (F phi), possibly with a time bound.
* Test if an expression is a reachability path formula (F phi), possibly with a time bound,
* where phi is a proposition.
*/
public static boolean isReach(Expression expr)
{
@ -832,6 +833,20 @@ public abstract class Expression extends ASTElement
return false;
}
/**
* Test if an expression is a reachability path formula (F phi), possibly with a time bound,
* where phi is an arbitrary state formula.
*/
public static boolean isReachWithStateFormula(Expression expr)
{
if (expr instanceof ExpressionTemporal) {
if (((ExpressionTemporal) expr).getOperator() == ExpressionTemporal.P_F) {
return ((ExpressionTemporal) expr).getOperand2().getType() == TypeBool.getInstance();
}
}
return false;
}
/**
* Test if an expression contains time bounds on temporal operators
*/

Loading…
Cancel
Save