Skip to content

Commit

Permalink
Rename temp vars to local
Browse files Browse the repository at this point in the history
  • Loading branch information
mondokm committed Aug 15, 2024
1 parent 07353cc commit 08963dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import hu.bme.mit.theta.core.utils.ExprUtils;
import hu.bme.mit.theta.core.utils.StmtUtils;

import java.util.Collection;
import java.util.Collections;
import java.util.Set;

import static com.google.common.base.Preconditions.checkNotNull;
Expand All @@ -33,7 +31,7 @@ public final class XSTS {

private final Set<VarDecl<?>> vars;
private final Set<VarDecl<?>> stateVars;
private final Set<VarDecl<?>> tempVars;
private final Set<VarDecl<?>> localVars;
private final Set<VarDecl<?>> ctrlVars;

private final NonDetStmt tran;
Expand Down Expand Up @@ -67,8 +65,8 @@ public Set<VarDecl<?>> getVars() {
return vars;
}

public Set<VarDecl<?>> getTempVars() {
return tempVars;
public Set<VarDecl<?>> getLocalVars() {
return localVars;
}

public Set<VarDecl<?>> getStateVars() {
Expand Down Expand Up @@ -96,11 +94,11 @@ public XSTS(final Set<VarDecl<?>> ctrlVars,
vars.addAll(ExprUtils.getVars(initFormula));
vars.addAll(ExprUtils.getVars(prop));
this.stateVars = this.vars;
this.tempVars = Containers.createSet();
this.localVars = Containers.createSet();
}

public XSTS(final Set<VarDecl<?>> stateVars,
final Set<VarDecl<?>> tempVars,
final Set<VarDecl<?>> localVars,
final Set<VarDecl<?>> ctrlVars,
final NonDetStmt init, final NonDetStmt tran, final NonDetStmt env,
final Expr<BoolType> initFormula, final Expr<BoolType> prop) {
Expand All @@ -113,9 +111,9 @@ public XSTS(final Set<VarDecl<?>> stateVars,

this.vars = Containers.createSet();
this.vars.addAll(checkNotNull(stateVars));
this.vars.addAll(checkNotNull(tempVars));
this.vars.addAll(checkNotNull(localVars));
this.stateVars = stateVars;
this.tempVars = tempVars;
this.localVars = localVars;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ public XSTS instantiate() {
final Expr<BoolType> prop = cast(
new XstsExpression(this, typeTable, context.prop).instantiate(env), Bool());

final Set<VarDecl<?>> tempVars = Containers.createSet();
tempVars.addAll(StmtUtils.getVars(tranSet));
tempVars.addAll(StmtUtils.getVars(envSet));
tempVars.addAll(StmtUtils.getVars(initSet));
tempVars.addAll(ExprUtils.getVars(initFormula));
tempVars.addAll(ExprUtils.getVars(prop));
tempVars.removeAll(stateVars);

return new XSTS(stateVars, tempVars, ctrlVars, initSet, tranSet, envSet, initFormula, prop);
final Set<VarDecl<?>> localVars = Containers.createSet();
localVars.addAll(StmtUtils.getVars(tranSet));
localVars.addAll(StmtUtils.getVars(envSet));
localVars.addAll(StmtUtils.getVars(initSet));
localVars.addAll(ExprUtils.getVars(initFormula));
localVars.addAll(ExprUtils.getVars(prop));
localVars.removeAll(stateVars);

return new XSTS(stateVars, localVars, ctrlVars, initSet, tranSet, envSet, initFormula, prop);
}

@Override
Expand Down

0 comments on commit 08963dd

Please sign in to comment.