Skip to content

Commit c7e1c3e

Browse files
authored
Merge pull request #389 from ftsrg/satfix
Fix issue with simple saturation and improve identity detection
2 parents 3cba9cd + 3ccbfcc commit c7e1c3e

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ buildscript {
2929

3030
allprojects {
3131
group = "hu.bme.mit.theta"
32-
version = "6.19.0"
32+
version = "6.19.1"
3333

3434

3535
apply(from = rootDir.resolve("gradle/shared-with-buildSrc/mirrors.gradle.kts"))

subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/mdd/ansd/impl/OnTheFlyReachabilityNextStateDescriptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public IntObjMapView<AbstractNextStateDescriptor> getDiagonal(StateSpaceInfo loc
9393
: new IntObjMapViews.Transforming<>(
9494
wrapped.getDiagonal(localStateSpace),
9595
(descriptor, key) -> {
96-
if (key == null) return AbstractNextStateDescriptor.terminalEmpty();
96+
if (key == null) return descriptor;
9797
return OnTheFlyReachabilityNextStateDescriptor.of(
9898
descriptor, target.get(key), killSwitch);
9999
});

subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/mdd/expressionnode/MddExpressionRepresentation.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,14 +613,16 @@ private void cacheModel(Valuation valuation) {
613613
}
614614
}
615615

616-
if (childNode.isTerminal()) break;
616+
if (childNode.isTerminal()) return;
617617

618618
// Preconditions.checkArgument(childNode.getRepresentation() instanceof
619619
// MddExpressionRepresentation);
620620
// TODO assert
621621
var nextRepr = childNode.getRepresentation();
622622
while (nextRepr instanceof IdentityRepresentation identity) {
623-
nextRepr = identity.getContinuation().getRepresentation();
623+
var cont = identity.getContinuation();
624+
if (cont.isTerminal()) return;
625+
nextRepr = cont.getRepresentation();
624626
}
625627
representation = (MddExpressionRepresentation) nextRepr;
626628
}

subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/mdd/expressionnode/MddExpressionTemplate.java

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ public RecursiveIntObjMapView<? extends MddNode> toCanonicalRepresentation(
126126

127127
if (transExpr
128128
&& decl instanceof IndexedConstDecl<?> constDecl
129-
&& constDecl.getIndex() == 0
130-
&& mddVariable.getLower().isPresent()
131-
&& mddVariable.getLower().get().getLower().isPresent()) {
129+
&& constDecl.getIndex() == 0) {
132130
final Substitution sub =
133131
BasicSubstitution.builder()
134132
.put(
@@ -138,18 +136,25 @@ public RecursiveIntObjMapView<? extends MddNode> toCanonicalRepresentation(
138136
final Expr<BoolType> identityContinuationExpr =
139137
ExprUtils.simplify(sub.apply(canonizedExpr));
140138
if (!ExprUtils.getConstants(identityContinuationExpr).contains(decl)) {
141-
final var cont =
142-
mddVariable
143-
.getLower()
144-
.get()
145-
.getLower()
146-
.get()
147-
.checkInNode(
148-
new MddExpressionTemplate(
149-
identityContinuationExpr,
150-
extractDecl,
151-
solverPool,
152-
transExpr));
139+
final MddNode cont;
140+
if (mddVariable.getLower().isPresent()
141+
&& mddVariable.getLower().get().getLower().isPresent()) {
142+
cont =
143+
mddVariable
144+
.getLower()
145+
.get()
146+
.getLower()
147+
.get()
148+
.checkInNode(
149+
new MddExpressionTemplate(
150+
identityContinuationExpr,
151+
extractDecl,
152+
solverPool,
153+
transExpr));
154+
} else {
155+
final MddGraph<Expr> mddGraph = (MddGraph<Expr>) mddVariable.getMddGraph();
156+
cont = mddGraph.getNodeFor(identityContinuationExpr);
157+
}
153158
return new IdentityRepresentation(cont);
154159
}
155160
}

0 commit comments

Comments
 (0)