Skip to content

Commit

Permalink
Generated hash code for xsts state
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamZsofi committed Sep 18, 2022
1 parent 54849fc commit 5ae502c
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import hu.bme.mit.theta.core.type.Expr;
import hu.bme.mit.theta.core.type.booltype.BoolType;

import java.util.Objects;

public final class XstsState<S extends ExprState> implements ExprState {

private final S state;
Expand Down Expand Up @@ -47,4 +49,17 @@ public boolean isBottom() {
public String toString() {
return Utils.lispStringBuilder(getClass().getSimpleName()).aligned().add(initialized ? "post_init" : "pre_init").add(lastActionWasEnv ? "last_env" : "last_internal").body().add(state).toString();
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
XstsState<?> xstsState = (XstsState<?>) o;
return lastActionWasEnv == xstsState.lastActionWasEnv && initialized == xstsState.initialized && state.equals(xstsState.state);
}

@Override
public int hashCode() {
return Objects.hash(state, lastActionWasEnv, initialized);
}
}

0 comments on commit 5ae502c

Please sign in to comment.