edu.toronto.cs.yasm.pgenerator
Class WPPredicateGenerator
java.lang.Object
edu.toronto.cs.yasm.pgenerator.BasePredicateGenerator
edu.toronto.cs.yasm.pgenerator.WPPredicateGenerator
- All Implemented Interfaces:
- PredicateGenerator
- Direct Known Subclasses:
- WPPredicateGenerator.WPDiff, WPPredicateGenerator.WPSame
public abstract class WPPredicateGenerator
- extends BasePredicateGenerator
Generates predicates based on the weakest pre-condition of
existing predicates
This class solely handles the part that generates new predicate(s)
Call the constructor Function to initiate.
Call the function newPred() to return a list of Predicates
- Version:
- 1.0
- Author:
- Xin Ma
Method Summary |
boolean |
find()
runs the predicate generator and returns true if
anything has changed like new predicates are added
or the abstraction of the program has changed |
protected abstract java.util.List |
findSuspects(CVectorExpr pStatePred,
CVectorExpr cStatePred)
Given parent state and child state return the list
of predicates that should be used for refining |
protected boolean |
maybeTransition(Expr from,
Expr to)
This method checks whether the change of value
of the same predicate before and after the maybe
transition is due to a change of
value (in a true transition), or it's during a
maybe transition |
java.util.List |
newPred()
This is the main function to call after construct and object
to obtain one or more new Predicates in the form of a list |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WPPredicateGenerator
public WPPredicateGenerator(PProgram p,
PrllAsmtPStmt _stmt,
PredicateRefiner _refiner,
WPComputer _wp,
CVectorExpr _pStatePred,
CVectorExpr _cStatePred)
find
public boolean find()
- Description copied from interface:
PredicateGenerator
- runs the predicate generator and returns true if
anything has changed like new predicates are added
or the abstraction of the program has changed
- Returns:
- a
boolean
value
newPred
public java.util.List newPred()
- This is the main function to call after construct and object
to obtain one or more new Predicates in the form of a list
- Returns:
- a
List
value
findSuspects
protected abstract java.util.List findSuspects(CVectorExpr pStatePred,
CVectorExpr cStatePred)
- Given parent state and child state return the list
of predicates that should be used for refining
- Parameters:
pStatePred
- a CVectorExpr
valuecStatePred
- a CVectorExpr
value
- Returns:
- a
List
value
maybeTransition
protected boolean maybeTransition(Expr from,
Expr to)
- This method checks whether the change of value
of the same predicate before and after the maybe
transition is due to a change of
value (in a true transition), or it's during a
maybe transition
- Parameters:
from
- an Expr
valueto
- an Expr
value
- Returns:
- a
boolean
value