Browse Source

symbolic acceptance: provide intersect() method to allow restriction of the state sets

E.g., to restrict to the reachable states.


git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@12040 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Joachim Klein 9 years ago
parent
commit
cbeefa6465
  1. 6
      prism/src/acceptance/AcceptanceBuchiDD.java
  2. 22
      prism/src/acceptance/AcceptanceGenRabinDD.java
  3. 22
      prism/src/acceptance/AcceptanceGenericDD.java
  4. 8
      prism/src/acceptance/AcceptanceOmegaDD.java
  5. 20
      prism/src/acceptance/AcceptanceRabinDD.java
  6. 6
      prism/src/acceptance/AcceptanceReachDD.java
  7. 20
      prism/src/acceptance/AcceptanceStreettDD.java

6
prism/src/acceptance/AcceptanceBuchiDD.java

@ -99,6 +99,12 @@ public class AcceptanceBuchiDD implements AcceptanceOmegaDD
return new AcceptanceBuchiDD(acceptingStates.copy());
}
@Override
public void intersect(JDDNode restrict)
{
acceptingStates = JDD.And(acceptingStates, restrict.copy());
}
@Override
public String getSizeStatistics()
{

22
prism/src/acceptance/AcceptanceGenRabinDD.java

@ -153,6 +153,20 @@ public class AcceptanceGenRabinDD
return new AcceptanceGenericDD(AcceptanceGeneric.ElementType.AND, genericL, genericKs);
}
/**
* Replaces the BDD functions for the acceptance sets
* of this generalized Rabin pair with the intersection
* of the current acceptance sets and the function {@code restrict}.
* <br>[ REFS: <i>none</i>, DEREFS: <i>none</i> ]
*/
public void intersect(JDDNode restrict)
{
L = JDD.And(L, restrict.copy());
for (int i = 0; i < K_list.size(); i++) {
K_list.set(i, JDD.And(K_list.get(i), restrict.copy()));
}
}
/** Returns a textual representation of this Rabin pair. */
@Override
public String toString()
@ -221,6 +235,14 @@ public class AcceptanceGenRabinDD
return result;
}
@Override
public void intersect(JDDNode restrict)
{
for (GenRabinPairDD pair : this) {
pair.intersect(restrict);
}
}
@Override
public void clear()
{

22
prism/src/acceptance/AcceptanceGenericDD.java

@ -176,6 +176,28 @@ public class AcceptanceGenericDD implements AcceptanceOmegaDD {
throw new UnsupportedOperationException("Unsupported operator in generic acceptance expression");
}
@Override
public void intersect(JDDNode restrict)
{
switch(kind) {
case TRUE:
case FALSE:
return;
case AND:
case OR:
left.intersect(restrict);
right.intersect(restrict);
return;
case INF:
case INF_NOT:
case FIN:
case FIN_NOT:
states = JDD.And(states, restrict.copy());
}
throw new UnsupportedOperationException("Unsupported operator in generic acceptance expression");
}
@Override
public AcceptanceGenericDD clone()
{

8
prism/src/acceptance/AcceptanceOmegaDD.java

@ -47,6 +47,14 @@ public interface AcceptanceOmegaDD extends Cloneable
*/
public AcceptanceOmegaDD clone();
/**
* Replaces the BDD functions for all the acceptance sets
* of this acceptance condition with the intersection
* of the current acceptance sets and the function {@code restrict}.
* <br>[ REFS: <i>none</i>, DEREFS: <i>none</i> ]
*/
public void intersect(JDDNode restrict);
/**
* Get a string describing the acceptance condition's size,
* i.e. "x Rabin pairs", etc.

20
prism/src/acceptance/AcceptanceRabinDD.java

@ -130,6 +130,18 @@ public class AcceptanceRabinDD
return new AcceptanceGenericDD(AcceptanceGeneric.ElementType.AND, genericL, genericK);
}
/**
* Replaces the BDD functions for the acceptance sets
* of this Rabin pair with the intersection
* of the current acceptance sets and the function {@code restrict}.
* <br>[ REFS: <i>none</i>, DEREFS: <i>none</i> ]
*/
public void intersect(JDDNode restrict)
{
L = JDD.And(L, restrict.copy());
K = JDD.And(K, restrict.copy());
}
/** Returns a textual representation of this Rabin pair. */
@Override
public String toString()
@ -189,6 +201,14 @@ public class AcceptanceRabinDD
return result;
}
@Override
public void intersect(JDDNode restrict)
{
for (RabinPairDD pair : this) {
pair.intersect(restrict);
}
}
/**
* Get the Streett acceptance condition that is the dual of this Rabin acceptance condition, i.e.,
* any word that is accepted by this condition is rejected by the returned Streett condition.

6
prism/src/acceptance/AcceptanceReachDD.java

@ -99,6 +99,12 @@ public class AcceptanceReachDD implements AcceptanceOmegaDD
return new AcceptanceReachDD(goalStates.copy());
}
@Override
public void intersect(JDDNode restrict)
{
goalStates = JDD.And(goalStates, restrict.copy());
}
@Override
public String getSizeStatistics()
{

20
prism/src/acceptance/AcceptanceStreettDD.java

@ -132,6 +132,18 @@ public class AcceptanceStreettDD
return new AcceptanceGenericDD(AcceptanceGeneric.ElementType.OR, genericR, genericG);
}
/**
* Replaces the BDD functions for the acceptance sets
* of this Streett pair with the intersection
* of the current acceptance sets and the function {@code restrict}.
* <br>[ REFS: <i>none</i>, DEREFS: <i>none</i> ]
*/
public void intersect(JDDNode restrict)
{
R = JDD.And(R, restrict.copy());
G = JDD.And(G, restrict.copy());
}
@Override
public String toString()
{
@ -191,6 +203,14 @@ public class AcceptanceStreettDD
}
@Override
public void intersect(JDDNode restrict)
{
for (StreettPairDD pair : this) {
pair.intersect(restrict);
}
}
@Override
public void clear()
{

Loading…
Cancel
Save