@ -38,6 +38,7 @@ public class SamplerBoundedUntilDisc extends SamplerBoolean
private Expression right ;
private Expression right ;
private int lb ;
private int lb ;
private int ub ;
private int ub ;
private boolean haveUpperBound ;
/ * *
/ * *
* Construct a sampler for a ( discrete - time ) bounded until property .
* Construct a sampler for a ( discrete - time ) bounded until property .
@ -68,17 +69,19 @@ public class SamplerBoundedUntilDisc extends SamplerBoolean
}
}
/ / Upper bound
/ / Upper bound
if ( expr . getUpperBound ( ) ! = null ) {
if ( expr . getUpperBound ( ) ! = null ) {
haveUpperBound = true ;
ub = expr . getUpperBound ( ) . evaluateInt ( ) ;
ub = expr . getUpperBound ( ) . evaluateInt ( ) ;
if ( expr . upperBoundIsStrict ( ) ) {
if ( expr . upperBoundIsStrict ( ) ) {
/ / Convert to non - strict bound : < ub < = > < = ub - 1
/ / Convert to non - strict bound : < ub < = > < = ub - 1
ub = ub - 1 ;
ub = ub - 1 ;
}
}
if ( ub < 0 ) {
throw new PrismException ( "Invalid upper bound in " + expr ) ;
}
} else {
} else {
/ / No upper bound
/ / No upper bound
ub = Integer . MAX_VALUE ;
}
if ( ub < 0 ) {
throw new PrismException ( "Invalid upper bound in " + expr ) ;
haveUpperBound = false ;
}
}
/ / Initialise sampler info
/ / Initialise sampler info
@ -95,7 +98,7 @@ public class SamplerBoundedUntilDisc extends SamplerBoolean
long pathSize = path . size ( ) ;
long pathSize = path . size ( ) ;
/ / Upper bound exceeded
/ / Upper bound exceeded
if ( pathSize > ub ) {
if ( haveUpperBound & & pathSize > ub ) {
valueKnown = true ;
valueKnown = true ;
value = false ;
value = false ;
}
}